-- t-paliad-317 (m/paliad#141): Composer Slice E — specialist bases.
--
-- Two firm-agnostic bases for proceeding-family-specific styling:
--
--   lg-duesseldorf — DE LG (de.inf.lg) conservative German legal style.
--                    Times New Roman 11pt; black headings.
--   upc-formal     — UPC court of first instance (upc.inf.cfi) formal
--                    style. Calibri 11pt body; UPC-blue (1F3864) headings;
--                    Cambria italic for blockquotes.
--
-- The .docx body for each is a minimal Composer-mode skeleton with
-- the 10 default section anchors and an empty rels envelope. The
-- styles.xml declares the {prefix}-Body / -Heading1/2/3 / -ListBullet
-- / -ListNumber / -Quote paragraph styles + a "Hyperlink" character
-- style (matches the MD walker's emitted r:id="rIdComposerN" link
-- runs from Slice D).
--
-- Generator: scripts/gen-submission-base/main.go (each preset hard-
-- codes the typography). The .docx files are uploaded to Gitea at
-- 6 - material/Templates/Word/Paliad/Composer/{slug}.docx as mAi.
--
-- The mig is additive only: ON CONFLICT (slug) DO NOTHING keeps a
-- re-run safe and existing rows untouched.

INSERT INTO paliad.submission_bases
    (slug, firm, proceeding_family, label_de, label_en,
     description_de, description_en,
     gitea_path, section_spec, is_default_for)
VALUES
    ('lg-duesseldorf', NULL, 'de.inf.lg',
     'LG-Düsseldorf-Stil', 'LG-Düsseldorf style',
     'Konservativer DE-LG-Stil: Times New Roman 11pt, schlichte Überschriften.',
     'Conservative DE LG style: Times New Roman 11pt, plain headings.',
     '6 - material/Templates/Word/Paliad/Composer/lg-duesseldorf.docx',
     jsonb_build_object(
         'version', 1,
         'stylemap', jsonb_build_object(
             'paragraph',      'LG-Body',
             'heading_1',      'LG-Heading1',
             'heading_2',      'LG-Heading2',
             'heading_3',      'LG-Heading3',
             'list_bullet',    'LG-ListBullet',
             'list_numbered',  'LG-ListNumber',
             'blockquote',     'LG-Quote'
         ),
         'defaults', jsonb_build_array(
             jsonb_build_object('section_key','letterhead',     'kind','prose',    'order_index', 1, 'label_de','Briefkopf',             'label_en','Letterhead',
                                'included',true,
                                'seed_md_de', E'Schriftsatz von {{firm.name}}\n\n{{user.display_name}}',
                                'seed_md_en', E'Submission by {{firm.name}}\n\n{{user.display_name}}'),
             jsonb_build_object('section_key','caption',        'kind','prose',    'order_index', 2, 'label_de','Rubrum',                'label_en','Caption',
                                'included',true,
                                'seed_md_de', E'In der Sache\n\n**{{parties.claimant.0.name}}**\n— Klägerin —\n\ngegen\n\n**{{parties.defendant.0.name}}**\n— Beklagte —\n\nAktenzeichen: {{project.case_number}}\n{{project.court}}',
                                'seed_md_en', E'In the matter\n\n**{{parties.claimant.0.name}}**\n— Claimant —\n\nv.\n\n**{{parties.defendant.0.name}}**\n— Defendant —\n\nCase number: {{project.case_number}}\n{{project.court}}'),
             jsonb_build_object('section_key','introduction',   'kind','prose',    'order_index', 3, 'label_de','Einleitung',            'label_en','Introduction',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','requests',       'kind','requests', 'order_index', 4, 'label_de','Anträge',               'label_en','Requests',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','facts',          'kind','prose',    'order_index', 5, 'label_de','Sachverhalt',           'label_en','Facts',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','legal_argument', 'kind','prose',    'order_index', 6, 'label_de','Rechtliche Würdigung',  'label_en','Legal argument',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','evidence',       'kind','evidence', 'order_index', 7, 'label_de','Beweisangebote',        'label_en','Evidence offering',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','exhibits',       'kind','prose',    'order_index', 8, 'label_de','Anlagen',               'label_en','Exhibits',
                                'included',false, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','closing',        'kind','prose',    'order_index', 9, 'label_de','Schlussformel',         'label_en','Closing',
                                'included',true,
                                'seed_md_de', E'Mit freundlichen Grüßen',
                                'seed_md_en', E'Yours sincerely,'),
             jsonb_build_object('section_key','signature',      'kind','prose',    'order_index',10, 'label_de','Unterschrift',          'label_en','Signature',
                                'included',true,
                                'seed_md_de', E'{{user.display_name}}',
                                'seed_md_en', E'{{user.display_name}}')
         )
     ),
     '{}'::text[]
    ),
    ('upc-formal', NULL, 'upc.inf.cfi',
     'UPC-Verfahren', 'UPC formal',
     'UPC-Verfahrensstil: Calibri 11pt, UPC-blaue Überschriften, Cambria-Zitate.',
     'UPC court style: Calibri 11pt, UPC-blue headings, Cambria quotes.',
     '6 - material/Templates/Word/Paliad/Composer/upc-formal.docx',
     jsonb_build_object(
         'version', 1,
         'stylemap', jsonb_build_object(
             'paragraph',      'UPC-Body',
             'heading_1',      'UPC-Heading1',
             'heading_2',      'UPC-Heading2',
             'heading_3',      'UPC-Heading3',
             'list_bullet',    'UPC-ListBullet',
             'list_numbered',  'UPC-ListNumber',
             'blockquote',     'UPC-Quote'
         ),
         'defaults', jsonb_build_array(
             jsonb_build_object('section_key','letterhead',     'kind','prose',    'order_index', 1, 'label_de','Briefkopf',             'label_en','Letterhead',
                                'included',true,
                                'seed_md_de', E'Schriftsatz von {{firm.name}}\n\n{{user.display_name}}',
                                'seed_md_en', E'Submission by {{firm.name}}\n\n{{user.display_name}}'),
             jsonb_build_object('section_key','caption',        'kind','prose',    'order_index', 2, 'label_de','Rubrum',                'label_en','Caption',
                                'included',true,
                                'seed_md_de', E'# In the matter\n\n**{{parties.claimant.0.name}}**\nrepresented by {{parties.claimant.0.representative}}\n— Claimant —\n\nv.\n\n**{{parties.defendant.0.name}}**\nrepresented by {{parties.defendant.0.representative}}\n— Defendant —\n\nUPC-Aktenzeichen: {{project.case_number}}\nStreitpatent: {{project.patent_number_upc}}',
                                'seed_md_en', E'# In the matter\n\n**{{parties.claimant.0.name}}**\nrepresented by {{parties.claimant.0.representative}}\n— Claimant —\n\nv.\n\n**{{parties.defendant.0.name}}**\nrepresented by {{parties.defendant.0.representative}}\n— Defendant —\n\nUPC case number: {{project.case_number}}\nPatent in suit: {{project.patent_number_upc}}'),
             jsonb_build_object('section_key','introduction',   'kind','prose',    'order_index', 3, 'label_de','Einleitung',            'label_en','Introduction',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','requests',       'kind','requests', 'order_index', 4, 'label_de','Anträge',               'label_en','Requests',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','facts',          'kind','prose',    'order_index', 5, 'label_de','Sachverhalt',           'label_en','Facts',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','legal_argument', 'kind','prose',    'order_index', 6, 'label_de','Rechtliche Würdigung',  'label_en','Legal argument',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','evidence',       'kind','evidence', 'order_index', 7, 'label_de','Beweisangebote',        'label_en','Evidence offering',
                                'included',true, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','exhibits',       'kind','prose',    'order_index', 8, 'label_de','Anlagen',               'label_en','Exhibits',
                                'included',false, 'seed_md_de', '', 'seed_md_en', ''),
             jsonb_build_object('section_key','closing',        'kind','prose',    'order_index', 9, 'label_de','Schlussformel',         'label_en','Closing',
                                'included',true,
                                'seed_md_de', E'Mit freundlichen Grüßen',
                                'seed_md_en', E'Yours sincerely,'),
             jsonb_build_object('section_key','signature',      'kind','prose',    'order_index',10, 'label_de','Unterschrift',          'label_en','Signature',
                                'included',true,
                                'seed_md_de', E'{{user.display_name}}',
                                'seed_md_en', E'{{user.display_name}}')
         )
     ),
     '{}'::text[]
    )
ON CONFLICT (slug) DO NOTHING;
