P1: 8 anchor/trigger rows (Zustellung des Urteils / Veröffentlichung der
Erteilung) were mislabeled event_type='filing'+primary_party='both' and leaked
into the /submissions/new draftable-submission picker. Migration 164 re-kinds
them to event_type='decision'+primary_party='court', aligning them with the 16
sibling court-act rows the model already has; the picker's event_type='filing'
filter then excludes them. Defensive guard added to loadSubmissionCatalog
(primary_party IS DISTINCT FROM 'court') as belt-and-braces against future drift.
Safety: the only event_type coupling for these rows is ruleAnchorKind
(projection_service.go) — they now anchor as appointments (correct, sibling-
consistent); deadline computation keys off is_court_set not event_type, and the
child sequence guard parentHasAnchoredActual UNIONs both anchor tables, so no
chain breaks. Verified: catalog 113->105, 8 court acts gone, 48 'both' party
submissions (incl. UPC appeal briefs) retained.
P2: the grouped picker table already renders a correct colspan group-header row
(a911a2d); the defect was contrast — the band used --color-bg-subtle, the SAME
token as the thead, so groups read as undelimited floating text. New
--color-bg-group-header token (cool/deeper in light, raised-cream in dark) +
heavier top divider + neutral left accent + darker label make each proceeding a
distinct section. Live deployed bundle confirmed current (not stale).
65 lines
3.8 KiB
SQL
65 lines
3.8 KiB
SQL
-- 164_rekind_court_act_rules — t-paliad-365 (P1), diagnosis t-paliad-363.
|
|
--
|
|
-- Re-kind 8 anchor/trigger rows in paliad.deadline_rules_unified that are
|
|
-- MISLABELED event_type='filing' + primary_party='both'. They are COURT /
|
|
-- registry acts — the service of a lower-court judgment ("Zustellung … Urteil"
|
|
-- / "Zustellung … Entscheidung") or the publication of grant ("Veröffentlichung
|
|
-- der Erteilung") — that START a deadline chain. They are NOT party
|
|
-- submissions, yet they surfaced in the global /submissions/new picker, whose
|
|
-- catalog query filters event_type='filing' (loadSubmissionCatalog,
|
|
-- internal/handlers/submissions.go). m noticed "Service of OLG Judgment"
|
|
-- (de.inf.bgh.urteil_olg) listed as draftable.
|
|
--
|
|
-- The model already carries a correct court-act tier: 16 sibling rows with
|
|
-- event_type='decision' + primary_party='court' (de.inf.olg.urteil_olg,
|
|
-- upc.inf.cfi.decision, …). This migration aligns the 8 mislabeled rows with
|
|
-- that tier. The picker filter (event_type='filing') then excludes them
|
|
-- automatically — no handler change is required for the core fix (a defensive
|
|
-- primary_party guard is added in submissions.go as belt-and-braces).
|
|
--
|
|
-- m's fork LOCKED to data-correction (t-paliad-363 §P1, fork i).
|
|
--
|
|
-- submission_code is KEPT (the 16 sibling decision rows keep theirs as stable
|
|
-- anchor identifiers; the deadline chain links via parent_id (uuid FK), which
|
|
-- this migration does not touch — so anchoring is unaffected).
|
|
--
|
|
-- ── SAFETY (grep of the deadline engine, t-paliad-365 Step 1) ──────────────
|
|
-- The ONLY code coupled to event_type for these rows is ruleAnchorKind
|
|
-- (projection_service.go:1825): event_type IN ('hearing','decision','order')
|
|
-- → the rule anchors as a paliad.appointments row; everything else anchors as
|
|
-- a paliad.deadlines row. After this migration, clicking "Datum setzen" on one
|
|
-- of these 8 court/trigger events records it as an APPOINTMENT (milestone)
|
|
-- instead of a deadline — which is the semantically correct, sibling-consistent
|
|
-- behaviour.
|
|
-- * Deadline COMPUTATION is NOT affected: the forward projection
|
|
-- (computeProjections) keys off the is_court_set boolean, never event_type.
|
|
-- * Child chains are NOT broken: the sequence guard parentHasAnchoredActual
|
|
-- (projection_service.go:1803) UNIONs paliad.deadlines AND
|
|
-- paliad.appointments, so a child (e.g. Revisionsfrist) still finds its
|
|
-- re-kinded parent's anchor regardless of which table it lands in.
|
|
-- * Existing data: exactly 1 paliad.deadlines row is already anchored to one
|
|
-- of these 8 rules (0 appointments) as of 2026-06-01. It stays valid and
|
|
-- is still found by the dual-table guard. The only cosmetic effect is that
|
|
-- a future RE-anchor of that same event would write an appointment beside
|
|
-- the old deadline; benign, and only if re-anchored.
|
|
-- Verdict: re-kinding does not break deadline computation. Surfaced to head.
|
|
--
|
|
-- ADDITIVE / data-only. No schema changes. Reversible (see .down.sql).
|
|
-- Idempotent: scoped to the mislabeled state (event_type='filing').
|
|
|
|
UPDATE paliad.deadline_rules_unified
|
|
SET event_type = 'decision',
|
|
primary_party = 'court',
|
|
updated_at = now()
|
|
WHERE submission_code IN (
|
|
'de.inf.bgh.urteil_olg', -- Zustellung OLG-Urteil
|
|
'de.inf.olg.urteil_lg', -- Zustellung LG-Urteil
|
|
'de.null.bgh.urteil_bpatg', -- Zustellung BPatG-Urteil
|
|
'dpma.appeal.bgh.entsch_bpatg', -- Zustellung BPatG-Entscheidung
|
|
'dpma.appeal.bpatg.entscheidung',-- Zustellung DPMA-Entscheidung
|
|
'epa.opp.boa.entsch', -- Zustellung der Beschwerdeentscheidung
|
|
'dpma.opp.dpma.publish', -- Veröffentlichung der Erteilung (DPMA)
|
|
'epa.opp.opd.grant' -- Veröffentlichung der Erteilung (EPA)
|
|
)
|
|
AND event_type = 'filing';
|