Merge: t-paliad-131 Phase B3 — DE expansion (PatG §111 fix + BPatG Hinweisbeschluss + ZPO Anzeige)
This commit is contained in:
52
internal/db/migrations/042_de_expansion_b3.down.sql
Normal file
52
internal/db/migrations/042_de_expansion_b3.down.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
-- Reverses 042_de_expansion_b3.
|
||||
|
||||
DELETE FROM paliad.deadline_rules
|
||||
WHERE proceeding_type_id IN (
|
||||
SELECT id FROM paliad.proceeding_types WHERE code IN ('DE_INF','DE_NULL')
|
||||
)
|
||||
AND code IN (
|
||||
'de_inf.anzeige',
|
||||
'de_null.replik_klaeger', 'de_null.hinweisbeschluss',
|
||||
'de_null.stellungnahme', 'de_null.duplik'
|
||||
);
|
||||
|
||||
DELETE FROM paliad.deadline_concepts
|
||||
WHERE slug IN ('preliminary-opinion','response-to-preliminary-opinion','notice-of-defence-intention')
|
||||
AND id NOT IN (SELECT concept_id FROM paliad.deadline_rules WHERE concept_id IS NOT NULL);
|
||||
|
||||
UPDATE paliad.deadline_rules
|
||||
SET duration_value = 1,
|
||||
deadline_notes = NULL,
|
||||
deadline_notes_en = NULL
|
||||
WHERE proceeding_type_id = (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_NULL')
|
||||
AND code = 'de_null.beruf_begr';
|
||||
|
||||
WITH proc AS (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_INF')
|
||||
UPDATE paliad.deadline_rules dr
|
||||
SET sequence_order = CASE dr.code
|
||||
WHEN 'de_inf.klage' THEN 0
|
||||
WHEN 'de_inf.erwidg' THEN 1
|
||||
WHEN 'de_inf.replik' THEN 2
|
||||
WHEN 'de_inf.duplik' THEN 3
|
||||
WHEN 'de_inf.termin' THEN 4
|
||||
WHEN 'de_inf.urteil' THEN 5
|
||||
WHEN 'de_inf.berufung' THEN 6
|
||||
WHEN 'de_inf.beruf_begr' THEN 7
|
||||
ELSE dr.sequence_order
|
||||
END
|
||||
FROM proc p
|
||||
WHERE dr.proceeding_type_id = p.id;
|
||||
|
||||
WITH proc AS (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_NULL')
|
||||
UPDATE paliad.deadline_rules dr
|
||||
SET sequence_order = CASE dr.code
|
||||
WHEN 'de_null.klage' THEN 0
|
||||
WHEN 'de_null.erwidg' THEN 1
|
||||
WHEN 'de_null.termin' THEN 2
|
||||
WHEN 'de_null.urteil' THEN 3
|
||||
WHEN 'de_null.berufung' THEN 4
|
||||
WHEN 'de_null.beruf_begr' THEN 5
|
||||
ELSE dr.sequence_order
|
||||
END
|
||||
FROM proc p
|
||||
WHERE dr.proceeding_type_id = p.id;
|
||||
168
internal/db/migrations/042_de_expansion_b3.up.sql
Normal file
168
internal/db/migrations/042_de_expansion_b3.up.sql
Normal file
@@ -0,0 +1,168 @@
|
||||
-- t-paliad-131 Phase B3: DE proceeding-tree expansion + bug fix.
|
||||
--
|
||||
-- Three concerns:
|
||||
--
|
||||
-- 1. PatG §111(1) bug fix. Current paliad seed has de_null.beruf_begr at
|
||||
-- 1 month. The current text of §111(1) PatG (BGBl. 2022) reads:
|
||||
-- "Die Frist zur Begründung der Berufung beträgt drei Monate.
|
||||
-- Sie beginnt mit der Zustellung des in vollständiger Form
|
||||
-- abgefassten Urteils, spätestens mit Ablauf von fünf Monaten
|
||||
-- nach der Verkündung." Bump to 3 months.
|
||||
--
|
||||
-- 2. DE_NULL Hinweisbeschluss cycle. PatG §83 mandates a qualified
|
||||
-- opinion ("Hinweisbeschluss") issued by the BPatG before the
|
||||
-- main hearing. Parties typically respond within ~3 months
|
||||
-- (court-set per §83(2)). Plus the missing Replik/Duplik exchange
|
||||
-- that is implicit in BPatG practice. All four are court-set so
|
||||
-- they render as IsCourtSet placeholders; the user can fill in
|
||||
-- real dates via the Phase A click-to-edit affordance.
|
||||
--
|
||||
-- 3. DE_INF Anzeige der Verteidigungsbereitschaft (ZPO §276(1) Satz 1).
|
||||
-- Not yet on the timeline. 2 weeks from service of the Klage.
|
||||
--
|
||||
-- Out of scope (deferred to B6): cross-cutting Versäumnisurteil-
|
||||
-- Einspruch (ZPO §339, trigger fires irregularly only when defendant
|
||||
-- defaults), Schriftsatznachreichung (ZPO §296a, court-set after
|
||||
-- Haupttermin), Wiedereinsetzung (PatG §123 / ZPO §233 / EPÜ Art.122).
|
||||
|
||||
-- ============================================================================
|
||||
-- 1. PatG §111(1) duration fix
|
||||
-- ============================================================================
|
||||
|
||||
UPDATE paliad.deadline_rules
|
||||
SET duration_value = 3,
|
||||
deadline_notes = 'Frist zur Berufungsbegründung beträgt 3 Monate (§ 111(1) Satz 1 PatG); spätestens 5 Monate nach Verkündung des Urteils.',
|
||||
deadline_notes_en = 'Period for filing the Statement of Grounds is 3 months (PatG §111(1) sentence 1); at the latest 5 months after pronouncement of the judgment.'
|
||||
WHERE proceeding_type_id = (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_NULL')
|
||||
AND code = 'de_null.beruf_begr';
|
||||
|
||||
-- ============================================================================
|
||||
-- 2. New concepts for the Hinweisbeschluss cycle + Anzeige
|
||||
-- ============================================================================
|
||||
|
||||
INSERT INTO paliad.deadline_concepts (slug, name_de, name_en, description, aliases, party, category, sort_order) VALUES
|
||||
('preliminary-opinion', 'Hinweisbeschluss', 'Preliminary Opinion / Qualified Hint', 'Vom Gericht erteilter qualifizierter Hinweis nach § 83 PatG, der die vorläufige Auffassung zur Patentfähigkeit darlegt — typischerweise einige Monate vor der mündlichen Verhandlung.', ARRAY['Hinweisbeschluss', 'qualifizierter Hinweis', 'Preliminary Opinion', 'qualified hint', 'Section 83 PatG hint'], 'court', 'order', 65),
|
||||
('response-to-preliminary-opinion', 'Stellungnahme zum Hinweisbeschluss', 'Response to Preliminary Opinion', 'Stellungnahme der Parteien zum qualifizierten Hinweis des BPatG (§ 83(2) PatG) — gerichtlich gesetzte Frist, typischerweise ~3 Monate.', ARRAY['Stellungnahme Hinweis', 'response to hint', 'Stellungnahme zum Hinweisbeschluss'], 'both', 'submission', 39),
|
||||
('notice-of-defence-intention', 'Anzeige der Verteidigungsbereitschaft', 'Notice of Intent to Defend', 'Anzeige des Beklagten, dass er sich gegen die Klage verteidigen will (§ 276(1) Satz 1 ZPO) — 2 Wochen ab Zustellung der Klage.', ARRAY['Anzeige Verteidigungsbereitschaft', 'Verteidigungsanzeige', 'Notice of defence intent'], 'defendant', 'submission', 19)
|
||||
ON CONFLICT (slug) DO UPDATE SET
|
||||
name_de = EXCLUDED.name_de,
|
||||
name_en = EXCLUDED.name_en,
|
||||
description = EXCLUDED.description,
|
||||
aliases = EXCLUDED.aliases,
|
||||
party = EXCLUDED.party,
|
||||
sort_order = EXCLUDED.sort_order,
|
||||
updated_at = now();
|
||||
|
||||
-- ============================================================================
|
||||
-- 3. Renumber DE_INF + DE_NULL to leave gaps for new rows
|
||||
-- ============================================================================
|
||||
|
||||
WITH proc AS (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_INF')
|
||||
UPDATE paliad.deadline_rules dr
|
||||
SET sequence_order = CASE dr.code
|
||||
WHEN 'de_inf.klage' THEN 0
|
||||
WHEN 'de_inf.erwidg' THEN 20
|
||||
WHEN 'de_inf.replik' THEN 30
|
||||
WHEN 'de_inf.duplik' THEN 40
|
||||
WHEN 'de_inf.termin' THEN 50
|
||||
WHEN 'de_inf.urteil' THEN 60
|
||||
WHEN 'de_inf.berufung' THEN 70
|
||||
WHEN 'de_inf.beruf_begr' THEN 80
|
||||
ELSE dr.sequence_order
|
||||
END
|
||||
FROM proc p
|
||||
WHERE dr.proceeding_type_id = p.id;
|
||||
|
||||
WITH proc AS (SELECT id FROM paliad.proceeding_types WHERE code = 'DE_NULL')
|
||||
UPDATE paliad.deadline_rules dr
|
||||
SET sequence_order = CASE dr.code
|
||||
WHEN 'de_null.klage' THEN 0
|
||||
WHEN 'de_null.erwidg' THEN 10
|
||||
WHEN 'de_null.termin' THEN 50
|
||||
WHEN 'de_null.urteil' THEN 60
|
||||
WHEN 'de_null.berufung' THEN 70
|
||||
WHEN 'de_null.beruf_begr' THEN 80
|
||||
ELSE dr.sequence_order
|
||||
END
|
||||
FROM proc p
|
||||
WHERE dr.proceeding_type_id = p.id;
|
||||
|
||||
-- ============================================================================
|
||||
-- 4. DE_INF — add Anzeige der Verteidigungsbereitschaft
|
||||
-- ============================================================================
|
||||
|
||||
INSERT INTO paliad.deadline_rules (
|
||||
proceeding_type_id, parent_id, code, name, name_en, primary_party, event_type,
|
||||
is_mandatory, duration_value, duration_unit, timing, rule_code, deadline_notes, deadline_notes_en,
|
||||
sequence_order, condition_flag, concept_id, legal_source, is_spawn, is_active
|
||||
)
|
||||
SELECT
|
||||
pt.id, parent_rule.id,
|
||||
'de_inf.anzeige', 'Anzeige der Verteidigungsbereitschaft', 'Notice of Intent to Defend',
|
||||
'defendant', 'filing', true, 2, 'weeks', 'after', '§ 276 ZPO',
|
||||
'Innerhalb von 2 Wochen nach Zustellung der Klage hat der Beklagte gegenüber dem Gericht anzuzeigen, ob er sich verteidigen will (§ 276(1) Satz 1 ZPO). Versäumnis kann zu Versäumnisurteil führen.',
|
||||
'Within 2 weeks of service of the Klage the defendant must notify the court whether they intend to defend (ZPO §276(1) sentence 1). Failure can result in a default judgment.',
|
||||
10, NULL,
|
||||
(SELECT id FROM paliad.deadline_concepts WHERE slug = 'notice-of-defence-intention'),
|
||||
'DE.ZPO.276.1', false, true
|
||||
FROM paliad.proceeding_types pt
|
||||
JOIN paliad.deadline_rules parent_rule ON parent_rule.proceeding_type_id = pt.id AND parent_rule.code = 'de_inf.klage'
|
||||
WHERE pt.code = 'DE_INF';
|
||||
|
||||
-- ============================================================================
|
||||
-- 5. DE_NULL — add Replik / Hinweisbeschluss / Stellungnahme / Duplik
|
||||
-- ============================================================================
|
||||
|
||||
-- Wave 1: replik_klaeger + hinweisbeschluss (parents = pre-existing erwidg)
|
||||
INSERT INTO paliad.deadline_rules (
|
||||
proceeding_type_id, parent_id, code, name, name_en, primary_party, event_type,
|
||||
is_mandatory, duration_value, duration_unit, timing, rule_code, deadline_notes, deadline_notes_en,
|
||||
sequence_order, condition_flag, concept_id, legal_source, is_spawn, is_active
|
||||
)
|
||||
SELECT
|
||||
pt.id, parent_rule.id, new.code, new.name, new.name_en, new.primary_party, new.event_type,
|
||||
true, new.duration_value, new.duration_unit, 'after', new.rule_code, new.deadline_notes, new.deadline_notes_en,
|
||||
new.sequence_order, NULL,
|
||||
(SELECT id FROM paliad.deadline_concepts WHERE slug = new.concept_slug),
|
||||
new.legal_source, false, true
|
||||
FROM (VALUES
|
||||
('de_null.erwidg', 'de_null.replik_klaeger', 'Replik', 'Reply',
|
||||
'claimant', 'filing', 2, 'months', '§ 83 PatG',
|
||||
'Vom Gericht gesetzte Frist (§ 83(2) PatG); typischerweise ~2 Monate. Nach Eintritt des Datums per Klick anpassbar.',
|
||||
'Court-set deadline (PatG §83(2)); typically ~2 months. Click the date to set the actual court-ordered period.',
|
||||
20, 'reply-to-defence', 'DE.PatG.83.2'),
|
||||
('de_null.erwidg', 'de_null.hinweisbeschluss', 'Hinweisbeschluss', 'Preliminary Opinion (Qualified Hint)',
|
||||
'court', 'order', 0, 'months', '§ 83 PatG',
|
||||
'Qualifizierter Hinweis des BPatG (§ 83(1) PatG), in dem die vorläufige Auffassung zur Patentfähigkeit dargelegt wird. Wird typischerweise einige Monate vor der mündlichen Verhandlung erlassen.',
|
||||
'BPatG qualified opinion (PatG §83(1)) setting out the preliminary view on patentability. Typically issued some months before the main hearing.',
|
||||
30, 'preliminary-opinion', 'DE.PatG.83.1')
|
||||
) AS new(parent_code, code, name, name_en, primary_party, event_type, duration_value, duration_unit, rule_code, deadline_notes, deadline_notes_en, sequence_order, concept_slug, legal_source)
|
||||
JOIN paliad.proceeding_types pt ON pt.code = 'DE_NULL'
|
||||
JOIN paliad.deadline_rules parent_rule ON parent_rule.proceeding_type_id = pt.id AND parent_rule.code = new.parent_code;
|
||||
|
||||
-- Wave 2: stellungnahme (parent=hinweisbeschluss) + duplik (parent=replik_klaeger)
|
||||
INSERT INTO paliad.deadline_rules (
|
||||
proceeding_type_id, parent_id, code, name, name_en, primary_party, event_type,
|
||||
is_mandatory, duration_value, duration_unit, timing, rule_code, deadline_notes, deadline_notes_en,
|
||||
sequence_order, condition_flag, concept_id, legal_source, is_spawn, is_active
|
||||
)
|
||||
SELECT
|
||||
pt.id, parent_rule.id, new.code, new.name, new.name_en, new.primary_party, new.event_type,
|
||||
true, new.duration_value, new.duration_unit, 'after', new.rule_code, new.deadline_notes, new.deadline_notes_en,
|
||||
new.sequence_order, NULL,
|
||||
(SELECT id FROM paliad.deadline_concepts WHERE slug = new.concept_slug),
|
||||
new.legal_source, false, true
|
||||
FROM (VALUES
|
||||
('de_null.hinweisbeschluss', 'de_null.stellungnahme', 'Stellungnahme zum Hinweisbeschluss', 'Response to Preliminary Opinion',
|
||||
'both', 'filing', 0, 'months', '§ 83 PatG',
|
||||
'Stellungnahme der Parteien zum qualifizierten Hinweis (§ 83(2) PatG) — vom Gericht gesetzte Frist, typischerweise ~3 Monate.',
|
||||
'Parties'' response to the qualified hint (PatG §83(2)) — court-set deadline, typically ~3 months.',
|
||||
35, 'response-to-preliminary-opinion', 'DE.PatG.83.2'),
|
||||
('de_null.replik_klaeger', 'de_null.duplik', 'Duplik', 'Rejoinder',
|
||||
'defendant', 'filing', 1, 'months', '§ 83 PatG',
|
||||
'Vom Gericht gesetzte Frist (§ 83(2) PatG); typischerweise ~1 Monat. Nach Eintritt des Datums per Klick anpassbar.',
|
||||
'Court-set deadline (PatG §83(2)); typically ~1 month. Click the date to set the actual court-ordered period.',
|
||||
40, 'rejoinder', 'DE.PatG.83.2')
|
||||
) AS new(parent_code, code, name, name_en, primary_party, event_type, duration_value, duration_unit, rule_code, deadline_notes, deadline_notes_en, sequence_order, concept_slug, legal_source)
|
||||
JOIN paliad.proceeding_types pt ON pt.code = 'DE_NULL'
|
||||
JOIN paliad.deadline_rules parent_rule ON parent_rule.proceeding_type_id = pt.id AND parent_rule.code = new.parent_code;
|
||||
Reference in New Issue
Block a user