From 01694e2753a7c236d4c4354b5ed479f0dcf9c1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schultz=20Madsen?= Date: Tue, 12 May 2026 05:34:00 +0200 Subject: [PATCH] =?UTF-8?q?feat(events):=20Phase=202=20=E2=80=94=20rename?= =?UTF-8?q?=20gRPC=20tavle=20types=20to=20board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror of the Phase 1 plugin pattern (PR #802) for the next noun in the opgave→event migration: rename the gRPC message types and RPC method names from Tavle to Board. Wire field names stay (`tavler`, `tavle_id`, `tavle_ids`) so generated C# accessors don't churn — only the type names and RPC method move. Concrete proto changes: - rpc ListTavler(ListTavlerRequest) returns (ListTavlerResponse) → rpc ListBoards(ListBoardsRequest) returns (ListBoardsResponse) - message Tavle → message Board - message ListTavlerRequest/Response → ListBoardsRequest/Response - Top-of-file comment updated to document Phase 2 boundaries. Concrete handler changes (EventsGrpcService.cs): - public override Task ListTavler(...) → Task ListBoards(...) - new Tavle { ... } → new Board { ... } - response.Tavler.Add(...) kept (generated from carved wire field) - All 15 generated accessors (request.TavleIds reads, event.TavleId setters) untouched — they're driven by carved wire fields. Build: dotnet clean + build green from eFormAPI.Web (0 errors, 10 pre-existing warnings). Backend restarts cleanly on :5000+:5001. Embedded copy at eform-angular-frontend/eFormAPI/Plugins/BackendConfiguration.Pn/ synced (diff -q silent). Spec: docs/superpowers/specs/2026-05-11-opgave-to-event-migration.md Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Protos/events.proto | 23 ++++++++----------- .../GrpcServices/EventsGrpcService.cs | 10 ++++---- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/events.proto b/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/events.proto index f05d677c5..0442908a3 100644 --- a/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/events.proto +++ b/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/events.proto @@ -1,16 +1,11 @@ syntax = "proto3"; -// Mid-migration: opgave -> event per +// Mid-migration: opgave -> event, tavle -> board per // docs/superpowers/specs/2026-05-11-opgave-to-event-migration.md. -// -// This phase renames the "opgave" noun only: service, package, message -// types (Opgave/OpgaveChange/CompleteOpgave* -> Event/...), and RPC -// method names. The Ejendom/Tavle/rode nouns and all field names (e.g. -// `repeated Event opgaver = 1;`) deliberately stay as-is — keeping the -// wire identifiers preserves the generated C# accessors -// (`response.Opgaver.Add(...)`, `new CompleteEventResponse { Opgave = -// ... }`) and limits this PR to the smallest viable diff. Follow-up -// phases handle those renames. +// Wire field names (`opgaver`, `tavler`, `tavle_id`, `tavle_ids`, +// `ejendom_id`) stay as-is so generated accessors don't churn; only +// message types and RPC method names move. Ejendom and rode renames +// land in follow-up phases. package backend_configuration; @@ -21,7 +16,7 @@ import "documents.proto"; service Events { rpc ListEjendomme(ListEjendommeRequest) returns (ListEjendommeResponse); - rpc ListTavler(ListTavlerRequest) returns (ListTavlerResponse); + rpc ListBoards(ListBoardsRequest) returns (ListBoardsResponse); rpc ListEvents(ListOpgaverRequest) returns (ListOpgaverResponse); rpc ListTaskTracker(ListTaskTrackerRequest) returns (ListTaskTrackerResponse); rpc StreamEventChanges(StreamOpgaveChangesRequest) returns (stream EventChange); @@ -130,8 +125,8 @@ message SetFieldValueResponse { Event opgave = 1; } message ListEjendommeRequest {} message ListEjendommeResponse { repeated Ejendom ejendomme = 1; } -message ListTavlerRequest { string ejendom_id = 1; } -message ListTavlerResponse { repeated Tavle tavler = 1; } +message ListBoardsRequest { string ejendom_id = 1; } +message ListBoardsResponse { repeated Board tavler = 1; } message ListOpgaverRequest { string ejendom_id = 1; @@ -168,7 +163,7 @@ message Ejendom { string name = 2; } -message Tavle { +message Board { string id = 1; string ejendom_id = 2; string name = 3; diff --git a/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs b/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs index 537dc1c39..f5b43c875 100644 --- a/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs +++ b/eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs @@ -32,7 +32,7 @@ namespace BackendConfiguration.Pn.Services.GrpcServices; /// /// gRPC adapter for the mobile "Opgaver" feature. -/// Read-only RPCs (ListEjendomme / ListTavler / ListOpgaver) reuse the existing +/// Read-only RPCs (ListEjendomme / ListBoards / ListOpgaver) reuse the existing /// Properties + Calendar service paths and reshape the result into the /// microting.opgaver wire contract. CompleteOpgave performs the SDK-case /// completion inline (mirroring CompliancesGrpcService.UpdateComplianceCase, @@ -145,8 +145,8 @@ public override async Task ListEjendomme( return response; } - public override async Task ListTavler( - ListTavlerRequest request, + public override async Task ListBoards( + ListBoardsRequest request, ServerCallContext context) { var propertyId = ParsePropertyId(request.EjendomId); @@ -160,7 +160,7 @@ public override async Task ListTavler( var result = await calendarService.GetBoards(propertyId); - var response = new ListTavlerResponse(); + var response = new ListBoardsResponse(); if (!result.Success || result.Model == null) { @@ -169,7 +169,7 @@ public override async Task ListTavler( foreach (var board in result.Model) { - response.Tavler.Add(new Tavle + response.Tavler.Add(new Board { Id = board.Id.ToString(CultureInfo.InvariantCulture), EjendomId = board.PropertyId.ToString(CultureInfo.InvariantCulture),