From e2d75c391d40017bfdc5bf9a069c4bc160831fcd Mon Sep 17 00:00:00 2001 From: mAi Date: Tue, 26 May 2026 15:09:12 +0200 Subject: [PATCH] =?UTF-8?q?fix(litigationplanner):=20rename=20upc.apl=20?= =?UTF-8?q?=E2=86=92=20upc.apl.unified=20(HOTFIX,=20t-paliad-299,=20m/pali?= =?UTF-8?q?ad#130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mig 134 was inserting code='upc.apl' (2 segments) into paliad.proceeding_types, which carries paliad_proceeding_code_shape CHECK requiring 3 dot-segments OR '^_archived_'. Every container restart hit the constraint, rolled the migration TXN back, and crash-looped paliad.de. Rename the unified Berufung code to 'upc.apl.unified' (3 segments, satisfies the constraint, preserves design intent). The pre-existing constraint is a useful jurisdiction.category.specific invariant — keep it, fix the new row. Touched only string literals: - mig 134 up.sql + down.sql (insert, lookups, post-checks) - frontend/src/verfahrensablauf.tsx (UPC_TYPES code + i18nKey) - frontend/src/client/verfahrensablauf.ts (APPELLANT_AXIS + APPEAL_TARGET sets) - frontend/src/client/i18n.ts (DE + EN translation rows) - frontend/src/i18n-keys.ts (auto-regen via bun build) - internal/services/lookup_events_test.go (anchor-row assertion) Verified: `grep -rn "'upc\.apl'\|\"upc\.apl\""` returns zero hits. go build, bun run build, go test ./... all green. --- frontend/src/client/i18n.ts | 4 ++-- frontend/src/client/verfahrensablauf.ts | 4 ++-- frontend/src/i18n-keys.ts | 2 +- frontend/src/verfahrensablauf.tsx | 2 +- .../134_berufung_unification.down.sql | 4 ++-- .../134_berufung_unification.up.sql | 20 +++++++++---------- internal/services/lookup_events_test.go | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/frontend/src/client/i18n.ts b/frontend/src/client/i18n.ts index d303031..6647ab1 100644 --- a/frontend/src/client/i18n.ts +++ b/frontend/src/client/i18n.ts @@ -237,7 +237,7 @@ const translations: Record> = { "deadlines.upc.disc.cfi": "Bucheinsicht", "deadlines.upc.apl.cost": "Berufung Kosten", "deadlines.upc.apl.order": "Berufung Anordnungen", - "deadlines.upc.apl": "Berufung", + "deadlines.upc.apl.unified": "Berufung", "deadlines.appeal_target.label": "Worauf richtet sich die Berufung?", "deadlines.appeal_target.endentscheidung": "Endentscheidung", "deadlines.appeal_target.kostenentscheidung": "Kostenentscheidung", @@ -3334,7 +3334,7 @@ const translations: Record> = { "deadlines.upc.dmgs.cfi": "Damages Determination", "deadlines.upc.disc.cfi": "Lay-open Books", "deadlines.upc.apl.cost": "Cost-Decision Appeal", - "deadlines.upc.apl": "Appeal", + "deadlines.upc.apl.unified": "Appeal", "deadlines.appeal_target.label": "Appeal against:", "deadlines.appeal_target.endentscheidung": "Final Decision", "deadlines.appeal_target.kostenentscheidung": "Cost Decision", diff --git a/frontend/src/client/verfahrensablauf.ts b/frontend/src/client/verfahrensablauf.ts index 2054307..30928b1 100644 --- a/frontend/src/client/verfahrensablauf.ts +++ b/frontend/src/client/verfahrensablauf.ts @@ -64,7 +64,7 @@ let sidePrefilledFromProject = false; // Conservative — false negatives just hide a control; false positives // would show an irrelevant control. const APPELLANT_AXIS_PROCEEDINGS = new Set([ - "upc.apl", + "upc.apl.unified", "de.inf.olg", "de.inf.bgh", "de.null.bgh", @@ -78,7 +78,7 @@ const APPELLANT_AXIS_PROCEEDINGS = new Set([ // only the unified upc.apl proceeding; future variants (e.g. de.apl) // can opt in by adding the code here. const APPEAL_TARGET_PROCEEDINGS = new Set([ - "upc.apl", + "upc.apl.unified", ]); // Five canonical appeal-target slugs (lp.AppealTargets — keep ordered diff --git a/frontend/src/i18n-keys.ts b/frontend/src/i18n-keys.ts index 48fd84f..dc2717d 100644 --- a/frontend/src/i18n-keys.ts +++ b/frontend/src/i18n-keys.ts @@ -1517,10 +1517,10 @@ export type I18nKey = | "deadlines.trigger.label" | "deadlines.unavailable" | "deadlines.upc" - | "deadlines.upc.apl" | "deadlines.upc.apl.cost" | "deadlines.upc.apl.merits" | "deadlines.upc.apl.order" + | "deadlines.upc.apl.unified" | "deadlines.upc.ccr.cfi" | "deadlines.upc.disc.cfi" | "deadlines.upc.dmgs.cfi" diff --git a/frontend/src/verfahrensablauf.tsx b/frontend/src/verfahrensablauf.tsx index e3de4f0..9700816 100644 --- a/frontend/src/verfahrensablauf.tsx +++ b/frontend/src/verfahrensablauf.tsx @@ -39,7 +39,7 @@ const UPC_TYPES: ProceedingDef[] = [ { code: "upc.rev.cfi", i18nKey: "deadlines.upc.rev.cfi", name: "Nichtigkeitsklage" }, { code: "upc.ccr.cfi", i18nKey: "deadlines.upc.ccr.cfi", name: "Widerklage auf Nichtigkeit" }, { code: "upc.pi.cfi", i18nKey: "deadlines.upc.pi.cfi", name: "Einstw. Maßnahmen" }, - { code: "upc.apl", i18nKey: "deadlines.upc.apl", name: "Berufung" }, + { code: "upc.apl.unified", i18nKey: "deadlines.upc.apl.unified", name: "Berufung" }, { code: "upc.dmgs.cfi", i18nKey: "deadlines.upc.dmgs.cfi", name: "Schadensbemessung" }, { code: "upc.disc.cfi", i18nKey: "deadlines.upc.disc.cfi", name: "Bucheinsicht" }, ]; diff --git a/internal/db/migrations/134_berufung_unification.down.sql b/internal/db/migrations/134_berufung_unification.down.sql index 23c90e2..c26f6ed 100644 --- a/internal/db/migrations/134_berufung_unification.down.sql +++ b/internal/db/migrations/134_berufung_unification.down.sql @@ -41,10 +41,10 @@ UPDATE paliad.deadline_rules dr WHERE dr.applies_to_target = ARRAY['anordnung']::text[]; -- --------------------------------------------------------------- --- 3. Drop the unified upc.apl row (now orphaned). +-- 3. Drop the unified upc.apl.unified row (now orphaned). -- --------------------------------------------------------------- -DELETE FROM paliad.proceeding_types WHERE code = 'upc.apl'; +DELETE FROM paliad.proceeding_types WHERE code = 'upc.apl.unified'; -- --------------------------------------------------------------- -- 4. Drop the new columns + their CHECK constraints. diff --git a/internal/db/migrations/134_berufung_unification.up.sql b/internal/db/migrations/134_berufung_unification.up.sql index 976776c..b7024fb 100644 --- a/internal/db/migrations/134_berufung_unification.up.sql +++ b/internal/db/migrations/134_berufung_unification.up.sql @@ -86,7 +86,7 @@ INSERT INTO paliad.proceeding_types ( appeal_target ) SELECT - 'upc.apl', + 'upc.apl.unified', 'Berufungsverfahren', 'Appeal', 'Vereinheitlichtes Berufungsverfahren — wählen Sie anschließend, ' @@ -120,10 +120,10 @@ DECLARE BEGIN SELECT id INTO upc_apl_id FROM paliad.proceeding_types - WHERE code = 'upc.apl'; - RAISE NOTICE '[mig 134] new upc.apl proceeding_type_id = %', upc_apl_id; + WHERE code = 'upc.apl.unified'; + RAISE NOTICE '[mig 134] new upc.apl.unified proceeding_type_id = %', upc_apl_id; - RAISE NOTICE '[mig 134] Rules to reassign to upc.apl with applies_to_target:'; + RAISE NOTICE '[mig 134] Rules to reassign to upc.apl.unified with applies_to_target:'; FOR rec IN SELECT dr.id AS rule_id, pt.code AS old_proceeding, @@ -185,10 +185,10 @@ UPDATE paliad.deadline_rules dr AND pt.code = 'upc.apl.order' AND dr.is_active = true; --- 4d. Reassign all 16 rules to the new upc.apl proceeding_type row. +-- 4d. Reassign all 16 rules to the new upc.apl.unified proceeding_type row. UPDATE paliad.deadline_rules dr SET proceeding_type_id = ( - SELECT id FROM paliad.proceeding_types WHERE code = 'upc.apl' + SELECT id FROM paliad.proceeding_types WHERE code = 'upc.apl.unified' ) FROM paliad.proceeding_types pt WHERE pt.id = dr.proceeding_type_id @@ -221,10 +221,10 @@ BEGIN SELECT COUNT(*) INTO unified_count FROM paliad.deadline_rules dr JOIN paliad.proceeding_types pt ON pt.id = dr.proceeding_type_id - WHERE pt.code = 'upc.apl' AND dr.is_active = true; - RAISE NOTICE '[mig 134] post: rules on unified upc.apl = % (expected 16)', unified_count; + WHERE pt.code = 'upc.apl.unified' AND dr.is_active = true; + RAISE NOTICE '[mig 134] post: rules on unified upc.apl.unified = % (expected 16)', unified_count; IF unified_count <> 16 THEN - RAISE EXCEPTION '[mig 134] FAILED — expected 16 rules on upc.apl, got %', unified_count; + RAISE EXCEPTION '[mig 134] FAILED — expected 16 rules on upc.apl.unified, got %', unified_count; END IF; SELECT COUNT(*) INTO archived_count @@ -240,7 +240,7 @@ BEGIN SELECT unnest(applies_to_target) AS target, COUNT(*) AS n FROM paliad.deadline_rules dr JOIN paliad.proceeding_types pt ON pt.id = dr.proceeding_type_id - WHERE pt.code = 'upc.apl' AND dr.is_active = true + WHERE pt.code = 'upc.apl.unified' AND dr.is_active = true GROUP BY unnest(applies_to_target) ORDER BY 1 LOOP diff --git a/internal/services/lookup_events_test.go b/internal/services/lookup_events_test.go index 4a88a4b..5c66aa5 100644 --- a/internal/services/lookup_events_test.go +++ b/internal/services/lookup_events_test.go @@ -137,8 +137,8 @@ func TestLookupEvents(t *testing.T) { t.Errorf("anchor row %s missing endentscheidung target: %v", m.Rule.Name, m.Rule.AppliesToTarget) } - if m.ProceedingType.Code != "upc.apl" { - t.Errorf("anchor row %s came from %s, want upc.apl", + if m.ProceedingType.Code != "upc.apl.unified" { + t.Errorf("anchor row %s came from %s, want upc.apl.unified", m.Rule.Name, m.ProceedingType.Code) } }