8ee339b235
Slot materialization (ARCHITECTURE §5.2): for each non-published instance, plan the seats planSlots() computes and upsert them on (service_instance_id, role_id, slot_index). onConflictDoNothing makes it idempotent; published weeks are skipped (owned by the publish flow). - src/domain/slots.ts: pure planSlots()/planSlotsForRole(); headcount fills slotIndex 1..N, call_time = start + offset (null if no offset). - src/domain/slots.test.ts: 5 tests (Audio headcount 2 -> 2 slots with correct call_time, clamp to 1, null offset, multi-role flatten). - src/db/slots.ts: materializeSlotsForInstance() + materializeSlots(). - src/app/api/dev/cron/slots/route.ts: GET drives the daily job. No schema change (slots unique index predates this unit; position_skills stays deferred to D5). Verified: draft instance + Audio headcount 2 -> 4 seats (Audio x2 + Livestream + Slides), Audio call_time 09:30 EST; re-run creates 0 rows. Seed restored to canonical 4 instances / 12 slots after testing.