chore: seminarhof customer project

This commit is contained in:
e2e
2026-07-11 08:11:01 +02:00
commit f0853ebe73
188 changed files with 20784 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
-- Booking lifecycle milestones.
--
-- The status enum is reshaped to a lean "bucket": enquiry | reserved |
-- confirmed | ended | cancelled. The contract + deposit progression that
-- runs inside `reserved` (over ~1 year) is tracked as the columns below plus the
-- deposit row on the invoice table — NOT as extra statuses. A daily cron reads
-- these columns; nothing here runs a long-lived workflow.
ALTER TABLE booking ADD COLUMN contract_sent_at TEXT; -- ISO; day-0 anchor + R1 idempotency guard
ALTER TABLE booking ADD COLUMN contract_response TEXT CHECK (contract_response IN ('approved', 'declined')); -- null = pending
ALTER TABLE booking ADD COLUMN contract_response_at TEXT; -- ISO
ALTER TABLE booking ADD COLUMN deposit_reminder_sent_at TEXT; -- ISO; R2 idempotency guard
ALTER TABLE booking ADD COLUMN flagged_at TEXT; -- ISO; set when admin review is needed
ALTER TABLE booking ADD COLUMN flag_reason TEXT CHECK (flag_reason IN ('deposit_overdue', 'short_window', 'contract_declined'));
-- Collapse the two retired statuses onto the new bucket (for any non-reset DB).
UPDATE booking SET status = 'reserved' WHERE status = 'form_received';
UPDATE booking SET status = 'confirmed' WHERE status = 'deposit_paid';