Skip to content

feat(einsatzdaten): pre-fill the Einsatznummer from a Stammdaten format - #751

Merged
DeepDiver1975 merged 4 commits into
mainfrom
feat/462-einsatznummer-format
Oct 27, 2026
Merged

DeepDiver1975 merged 4 commits into
mainfrom
feat/462-einsatznummer-format

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #462

What

The Stammdaten → Einstellungen tab gets an Einsatznummer-Format, e.g. {A} 1.2 {JJMMTT} {NNNN}:

  • {A} is the Einsatzart, taken from the Stichwort's first letter: B3P → B, THL 1 → T, ABC … → A, SON … → S, RD … → R.
  • 1.2 is the spec's version and stays literal.
  • {JJMMTT} (also {JJJJ}, {JJ}, {MM}, {TT} and the Y/D spellings) is the incident's start date.
  • A run of N is the gap for the Leitstelle's running number. Nothing is counted locally.

B for Brand and R for Rettungsdienst are confirmed by KBI Dachau, which gives R 1.2 YYMMDD XXXX. Taking the first letter for THL, ABC and Sonstige is an inference from how the Bavarian Stichwörter are written.

The EINSATZDATEN dialog of an incident that has no number yet opens with the known parts typed in:

  • Stichwort first: the Stichwort is usually typed in the same dialog, so the number follows it while it is still the untouched pre-fill. Once the number has been typed into, changing the Stichwort never touches it.
  • No Stichwort yet: the Einsatzart is a gap, and the caret waits on it.
  • Tab into the field puts the caret on the first gap. A TextBox normally selects all on Tab, so the first digit would have wiped the pre-fill.

The open questions from the issue, as decided:

  • Running number: left as a gap.
  • Pre-fill: lives only in the dialog. The untouched pre-fill is never stored, so SPEICHERN after typing only the Stichwort keeps the number empty, and ABBRECHEN closes without the discard question.
  • Mismatch: a number of another shape is accepted, with a non-blocking hint: „Entspricht nicht dem Format …".

How

  • IncidentNumberFormat (Domain) parses the template, builds the pre-fill and checks the shape. The template arrives from an import or a sync host, so the matcher is hand-rolled and linear rather than a Regex built from untrusted text.
  • The shape check reads the Einsatzart as one capital letter, and each date field as digits rather than the actual date, so an Einsatz past midnight is not flagged.
  • IncidentSettings.IncidentNumberFormat is trimmed, blank → none, and capped at 60 characters. It is stored in md_text_settings (no migration; cleared as ""), and imported/exported as settings.incidentNumberFormat. docs/master-data.example.json is updated.
  • Sync: /masterdata gains an optional key. ProtocolVersion 24 → 25 (rebased above main's 24), and the floor stays at 24.

Screenshots

Before — EINSATZDATEN for an incident without a number (also what it looks like with no format configured):

Before: empty Einsatznummer

After — Stichwort B3P, Tab into the number: the Brand letter and date are typed in, with the caret on the gap:

After: pre-filled Brand Einsatznummer

After — THL 1 typed into an empty dialog, then Tab: the number follows the Stichwort:

After: pre-filled THL Einsatznummer

After — a number of another shape shows the hint and still saves:

After: format hint

After — the new setting in Stammdaten → Einstellungen (no before shot rendered; the tab simply ended at Rückzugsdruck):

After: Stammdaten Einstellungen

Verification

  • make clean ci: all 9 test assemblies pass. make format-check passes.
  • make mutate SINCE=origin/main, score on changed lines: Domain 95.0 %, AppLogic 92.4 %, Persistence 95.2 %, Sync (no mutants on changed lines).
  • The headless test Typing_the_stichwort_first_puts_its_einsatzart_in_front_of_the_number runs the real order: type THL 1, Tab, 77, Enter. It stores T 1.2 260622 77.

🤖 Generated with Claude Code

@DeepDiver1975
DeepDiver1975 force-pushed the feat/462-einsatznummer-format branch 2 times, most recently from 02f149b to 88dab14 Compare October 25, 2026 22:18
@DeepDiver1975
DeepDiver1975 force-pushed the feat/462-einsatznummer-format branch 2 times, most recently from f348d6e to feadd73 Compare October 26, 2026 21:17
DeepDiver1975 and others added 3 commits October 26, 2026 22:41
The Stammdaten take an Einsatznummer template such as
"B 1.2 {JJMMTT} {NNN}": {JJMMTT} (and JJJJ/JJ/MM/TT) is the incident's
start date, a run of N the gap for the Leitstelle's running number.

The Einsatzdaten dialog of an incident without a number opens with the
prefix and date typed in; tabbing into the field puts the caret on the
gap instead of selecting everything. The untouched pre-fill is never
stored, so SPEICHERN after only the Stichwort keeps the number empty and
ABBRECHEN closes without asking. A number of another shape is accepted
with a non-blocking hint.

The template is untrusted input (import, sync host), so it is trimmed
and capped, and matched by a hand-rolled linear matcher rather than a
regular expression built from it. The /masterdata payload gains an
optional settings key: ProtocolVersion 25, floor unchanged at 24.

Fixes #462

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…tichwort

The leading letter of a Bavarian Einsatznummer is the Einsatzart, not a
constant: B for Brand, R for Rettungsdienst ("R 1.2 YYMMDD XXXX"), and so
on. Only "1.2", the spec's version, is fixed.

A new {A} placeholder takes the Stichwort's first letter (B3P -> B,
THL 1 -> T, RD -> R). The Stichwort is usually typed in the same dialog,
so the pre-fill follows it while the number is still untouched, and
never once typed into. Without a Stichwort the letter is a gap and the
caret waits on it. The shape check reads it as one capital letter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…able ones

Field report: "{A} 1.2 {LLMMTT} {NNNN}" was saved without a word, and
the Einsatzdaten dialog then pre-filled nothing, since L is no
placeholder letter.

The format field now names the problem under it and turns red while a
template cannot be read; saving is not refused, so it can be fixed
later. It is also a suggestion box offering the published formats,
Bayern's "{A} 1.2 {JJMMTT} {NNNN}" first, then Baden-Württemberg's
"{A} {JJMMTT} {NNN}" (Landesfeuerwehrschule F3 material) and the UCRI
Leitstellen-Schnittstelle's "{JJJJ}-{MM}-{TT}-{NNNN}". Any other
template stays typeable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 force-pushed the feat/462-einsatznummer-format branch from feadd73 to a2ded18 Compare October 26, 2026 21:41
@DeepDiver1975

DeepDiver1975 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Stammdaten editor follow-up (a2ded18), from a field report: {A} 1.2 {LLMMTT} {NNNN} was saved silently and the dialog pre-filled nothing, because L is no placeholder letter.

  • Validation: an unreadable template turns the field red and names the placeholders under it. Saving is not refused, so it can be fixed later.
  • Suggestions: the field is a suggestion box. It offers the published formats, Bayern's first:
Format Source
{A} 1.2 {JJMMTT} {NNNN} Bayern: KBI Dachau shows R 1.2 YYMMDD XXXX; 1.2 is the spec version
{A} {JJMMTT} {NNN} Baden-Württemberg: Landesfeuerwehrschule F3 "Einsatzplanung und -vorbereitung" (Sept 2026) shows B 240511 112
{JJJJ}-{MM}-{TT}-{NNNN} UCRI Leitstellen-Schnittstelle (DFV explanation v1.7) gives 2021-01-05-2553 as a Leitstelle's Einsatznummer

No published scheme turned up for NRW, Hessen or Niedersachsen. FeuerON (Niedersachsen) only has a field "Einsatznummer (Jahr)" with no example. Each is one example, not a standard, so the field stays free text.

Suggestions
Unreadable template

🤖 Generated with Claude Code

Each row of the format suggestions shows its label beside the template:
Bayern, Baden-Württemberg, Leitstellen-Schnittstelle UCRI. Picking a row
fills in the template alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

DeepDiver1975 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

The format suggestions now name where each is used: Bayern, Baden-Württemberg, Leitstellen-Schnittstelle UCRI. Picking a row fills in the template alone.

Labelled suggestions

🤖 Generated with Claude Code

@DeepDiver1975
DeepDiver1975 merged commit 4588de7 into main Oct 27, 2026
17 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/462-einsatznummer-format branch October 27, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(incident-data): configurable Einsatznummer format, pre-filled on new incidents

1 participant