Deadlines/new: rule + Typ can be saved with contradicting legal events #18

Closed
opened 2026-05-08 16:28:58 +00:00 by mAi · 0 comments
Collaborator

Symptom

Surfaced via dogfood on mai/feynman/fristenrechner 2026-05-08 18:26 (m → maria → feynman). Saved deadline 0f452834-a045-453a-a588-2a419fe017e3 on project C-UPC-0002, due 2026-05-11:

  • Regel: rev.rejoin — Duplik
  • Typ (optional): upc_statement_of_defence — Klageerwiderung

Two different legal events on the same row.

Root cause

source: "manual" — the row was created via /projects/{id}/deadlines/new. That form lets the user pick rule_id and event_type_id independently with no consistency check on save. There is no junction or shared key to validate against — paliad.deadline_rules.concept_id references paliad.deadline_concepts.slug ("rejoinder", "klageerwiderung", …) while paliad.event_types.slug uses a different namespace ("upc_statement_of_defence", "upc_rejoinder", …) with no mapping table between them.

The Fristenrechner save path (/api/projects/{id}/deadlines/bulk) does NOT send event_type_id — only manual creation hits this contradiction.

Why this isn't a quick fix

Aligning Typ to Rule on save would need either:

  1. A new junction paliad.concept_event_types mapping each concept to its canonical event_type(s), populated via migration. Real data work — not trivial because some concepts have multiple natural event-types (e.g. "appeal" maps to UPC + DE + EPA appeal event-types).
  2. Forcing one-or-the-other (the user picks Rule OR Typ; whichever is empty gets disabled). This is the proper Item A "rule-vs-event collapse" m specced for the Determinator redesign.

Option 2 is the right shape per m's 2026-05-08 18:14 batch ("the Rules in the selection of the Event ... can only be an alternative to either chose by rule OR chose by event"). It's cheaper to do once at the Determinator-redesign moment than to retro-fit the existing manual form.

Acceptance

Within Item A's scope (rule-vs-event collapse on the Determinator):

  • One picker at a time on /projects/{id}/deadlines/new — Rule OR Typ, never both.
  • When a Rule is selected, Typ is suppressed (greyed or hidden).
  • When a Typ is selected, Rule is suppressed.
  • Existing rows with mismatched (rule, typ) get a one-time UI warning (yellow banner: "Diese Frist hat eine Regel UND einen Typ, die sich nicht entsprechen — neu anlegen?"). No silent data migration; m's gate.

Context

t-paliad-157 / m/paliad#15 dogfood thread. Folds into the Determinator redesign once Slice 3 (incoming-event picker) lands.

## Symptom Surfaced via dogfood on `mai/feynman/fristenrechner` 2026-05-08 18:26 (m → maria → feynman). Saved deadline `0f452834-a045-453a-a588-2a419fe017e3` on project `C-UPC-0002`, due 2026-05-11: - **Regel**: `rev.rejoin` — Duplik - **Typ (optional)**: `upc_statement_of_defence` — Klageerwiderung Two different legal events on the same row. ## Root cause `source: "manual"` — the row was created via `/projects/{id}/deadlines/new`. That form lets the user pick `rule_id` and `event_type_id` independently with no consistency check on save. There is no junction or shared key to validate against — `paliad.deadline_rules.concept_id` references `paliad.deadline_concepts.slug` ("rejoinder", "klageerwiderung", …) while `paliad.event_types.slug` uses a different namespace ("upc_statement_of_defence", "upc_rejoinder", …) with no mapping table between them. The Fristenrechner save path (`/api/projects/{id}/deadlines/bulk`) does NOT send `event_type_id` — only manual creation hits this contradiction. ## Why this isn't a quick fix Aligning Typ to Rule on save would need either: 1. A new junction `paliad.concept_event_types` mapping each concept to its canonical event_type(s), populated via migration. Real data work — not trivial because some concepts have multiple natural event-types (e.g. "appeal" maps to UPC + DE + EPA appeal event-types). 2. Forcing one-or-the-other (the user picks Rule OR Typ; whichever is empty gets disabled). This is the proper Item A "rule-vs-event collapse" m specced for the Determinator redesign. Option 2 is the right shape per m's 2026-05-08 18:14 batch ("the Rules in the selection of the Event ... can only be an alternative to either chose by rule OR chose by event"). It's cheaper to do once at the Determinator-redesign moment than to retro-fit the existing manual form. ## Acceptance Within Item A's scope (rule-vs-event collapse on the Determinator): - One picker at a time on `/projects/{id}/deadlines/new` — Rule OR Typ, never both. - When a Rule is selected, Typ is suppressed (greyed or hidden). - When a Typ is selected, Rule is suppressed. - Existing rows with mismatched (rule, typ) get a one-time UI warning (yellow banner: "Diese Frist hat eine Regel UND einen Typ, die sich nicht entsprechen — neu anlegen?"). No silent data migration; m's gate. ## Context t-paliad-157 / m/paliad#15 dogfood thread. Folds into the Determinator redesign once Slice 3 (incoming-event picker) lands.
m closed this issue 2026-05-08 20:01:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#18
No description provided.