feat(builder): B5 — share + promote-to-project wizard (t-paliad-350)
Litigation Builder slice B5 (m/paliad#153 PRD §2.4 + §2.5 + §5.4 + §10).
Backend (internal/services/scenario_builder_service.go):
- ListSharedWithMe — scenarios shared read-only with the caller (the
"Geteilt mit mir" bucket).
- PromoteScenario — transactional promote-to-project (PRD §10, no partial
promotions). One Postgres tx: INSERT paliad.projects ('case',
origin_scenario_id, proceeding_type_id + scenario_flags from the primary
triplet) → creator team lead + wizard-selected colleagues → parties →
deadlines (filed→completed, planned→pending with computed/actual date,
skipped→none) → flip scenario to 'promoted' + promoted_project_id. The
primary top-level proceeding + its spawned descendants form the one case
file; additional standalone proceedings are reported via
ProceedingsSkipped and stay in the scenario. Planned dates come from the
injected FristenrechnerService.Calculate; court-set/undated planned
events are skipped + counted.
- NewScenarioBuilderService gains a *FristenrechnerService dep (wired in
cmd/server/main.go; nil in tests that don't promote).
Handlers/routes:
- GET /api/builder/scenarios/shared, POST /api/builder/scenarios/{id}/promote.
Frontend:
- builder-shares.ts — share modal (HLC user picker + current-shares list +
revoke).
- builder-promote.ts — 3-step wizard (Bestätigen → Parteien ergänzen →
Akte-Metadaten) → POST /promote → navigate to /projects/{id}.
- builder.ts — bucketed side panel (Aktiv / Geteilt mit mir / Als Projekt
angelegt / Archiviert), read-only chrome (watermark + locked affordances)
for shared/promoted scenarios, wired share + promote buttons, deep-link
auto-load now covers shared scenarios.
- procedures.tsx — enabled buttons, bucket containers, readonly watermark slot.
- global.css — modal scaffold, share UI, promote wizard, buckets, readonly
state. i18n.ts + i18n-keys.ts — DE+EN keys.
Tests: TestScenarioBuilderPromote (live-DB) pins the transactional cascade
+ readonly-after-promote + re-promote rejection. go build/vet/test + bun
build clean. Verified end-to-end via Playwright: Journey E (share → 2nd
user read-only watermark + locked canvas, incl. deep-link) and Journey D
(promote wizard 3 steps → project created with party → navigate → scenario
flipped to promoted).