From 098ad25c2ed064a3a8a90250ddfce93821d2f8ba Mon Sep 17 00:00:00 2001 From: Christian Arlt Date: Sun, 22 Nov 2026 21:20:13 +0100 Subject: [PATCH 1/6] feat(atemschutz): name a CSA-Trupp by its number ("CSA-Trupp 1") MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A CSA-Trupp is called "CSA-Trupp 1" on the radio, but the form only offered a free-text Funkrufname, so crews typed "1" and the row read "1 · CSA-Trupp". A Trupp-Typ can now be marked "Funkrufname aus Nummer" in the Stammdaten. The Atemschutz form then shows NUMMER in place of FUNKRUFNAME, suggests the next number free for that Trupp-Art, refuses one already in use, and copies "CSA-Trupp 1" into the Trupp's own Funkrufname, so the grid, banners, ETB and Bericht all use it. The display name drops the Trupp-Art when the Funkrufname already names it. The flag is a Stammdaten setting rather than a check on the name (#398). A one-time migration sets it on an existing CSA-Trupp, and a pre-#398 JSON backup translates the same way. /masterdata carries the optional field, so the protocol rises to 45 with the floor at 44. Closes #995 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Christian Arlt --- changelog.d/+trupp-named-by-number.added.md | 1 + docs/master-data.example.json | 2 +- .../Views/MasterDataEditorView.axaml | 14 +- src/LageBuch.App.Shared/Views/ScbaView.axaml | 14 +- .../ViewModels/ScbaViewModel.cs | 76 ++++++- .../ViewModels/TruppTypeRow.cs | 10 +- .../ViewModels/TruppTypesSection.cs | 9 +- .../ViewModels/ValidationMessages.cs | 4 + .../Atemschutz/AtemschutzTrupp.cs | 37 +++- src/LageBuch.Domain/Incident.cs | 15 ++ .../MasterData/MasterDataSet.cs | 22 +- .../MasterData/MasterDataStore.cs | 59 +++++- src/LageBuch.Sync/SyncProtocol.cs | 8 +- tests/Fixtures/stammdaten-vollstaendig.json | 9 +- .../MasterDataEditorRenderTests.cs | 9 +- .../WorkspaceRenderHelper.cs | 2 +- .../MasterDataSectionTests.cs | 19 ++ .../ScbaNumberedTruppTests.cs | 191 ++++++++++++++++++ .../LageBuch.Domain.Tests/AtemschutzTests.cs | 61 ++++++ .../MasterDataJsonTests.cs | 23 ++- .../MasterDataStoreTests.cs | 60 +++++- .../VersionHandshakeTests.cs | 12 +- 22 files changed, 621 insertions(+), 36 deletions(-) create mode 100644 changelog.d/+trupp-named-by-number.added.md create mode 100644 tests/LageBuch.AppLogic.Tests/ScbaNumberedTruppTests.cs diff --git a/changelog.d/+trupp-named-by-number.added.md b/changelog.d/+trupp-named-by-number.added.md new file mode 100644 index 000000000..97e49f9d9 --- /dev/null +++ b/changelog.d/+trupp-named-by-number.added.md @@ -0,0 +1 @@ +A Trupp-Typ can be set to "Funkrufname aus Nummer" in the Stammdaten, so the Atemschutz form asks for a number instead of a Funkrufname and the Trupp is called "CSA-Trupp 1" rather than "1 · CSA-Trupp" (#995). diff --git a/docs/master-data.example.json b/docs/master-data.example.json index 69c96c8fe..3076944d2 100644 --- a/docs/master-data.example.json +++ b/docs/master-data.example.json @@ -35,7 +35,7 @@ { "name": "Angriffstrupp", "memberCount": 2, "maxDurationMinutes": 30 }, { "name": "Wassertrupp", "memberCount": 2, "maxDurationMinutes": 30 }, { "name": "Schlauchtrupp", "memberCount": 2, "maxDurationMinutes": 30 }, - { "name": "CSA-Trupp", "memberCount": 3, "maxDurationMinutes": 20 }, + { "name": "CSA-Trupp", "memberCount": 3, "maxDurationMinutes": 20, "namedByNumber": true }, { "name": "Strahlenschutztrupp", "memberCount": 3, "maxDurationMinutes": 30 }, { "name": "LPA-Trupp", "memberCount": 2, "maxDurationMinutes": 60 } ], diff --git a/src/LageBuch.App.Shared/Views/MasterDataEditorView.axaml b/src/LageBuch.App.Shared/Views/MasterDataEditorView.axaml index e62e06047..04797be2a 100644 --- a/src/LageBuch.App.Shared/Views/MasterDataEditorView.axaml +++ b/src/LageBuch.App.Shared/Views/MasterDataEditorView.axaml @@ -1400,18 +1400,20 @@ HorizontalAlignment="Left" Margin="0,12,0,0" Command="{Binding AddCommand}" /> - + + - + + -