-- Seed data for the Shift Scheduling schema, from section 14 of the blueprint. Load after shift-scheduling.sql. -- Harbor Cafe. The spec's clock: today is Thursday 2026-10-15, 09:00 in America/New_York (13:00 UTC). -- Shift times are local times converted to UTC: every seeded date is in daylight time (UTC-4), so 06:00 local is 10:00 UTC. INSERT INTO settings (id, location_name, time_zone, min_rest_minutes) VALUES (1, 'Harbor Café', 'America/New_York', 600); INSERT INTO positions (id, name) VALUES ('barista', 'Barista'), ('kitchen', 'Kitchen'), ('shift-lead', 'Shift lead'); -- calendar_token values are placeholders: the spec makes each token random. Replace them with random values of 32 or more characters. INSERT INTO people (id, name, email, phone, is_manager, active, wage_cents, max_weekly_minutes, calendar_token) VALUES ('rosa', 'Rosa Diaz', 'rosa@harborcafe.example', NULL, TRUE, TRUE, 2600, 2400, 'placeholder-calendar-token-rosa-0000'), ('ana', 'Ana Lima', 'ana@harborcafe.example', NULL, FALSE, TRUE, 1900, 2400, 'placeholder-calendar-token-ana-00000'), ('ben', 'Ben Cho', 'ben@harborcafe.example', NULL, FALSE, TRUE, 1750, 2100, 'placeholder-calendar-token-ben-00000'), ('jo', 'Jo Park', 'jo@harborcafe.example', NULL, FALSE, TRUE, 1700, 2400, 'placeholder-calendar-token-jo-000000'), ('lee', 'Lee Grant', 'lee@harborcafe.example', NULL, FALSE, TRUE, 1700, 2400, 'placeholder-calendar-token-lee-00000'), ('sam', 'Sam Okafor', 'sam@harborcafe.example', NULL, FALSE, TRUE, 1950, 2400, 'placeholder-calendar-token-sam-00000'), ('kai', 'Kai Brooks', 'kai@harborcafe.example', NULL, FALSE, TRUE, 1850, 2400, 'placeholder-calendar-token-kai-00000'), ('mia', 'Mia Torres', 'mia@harborcafe.example', NULL, FALSE, TRUE, 1850, 2400, 'placeholder-calendar-token-mia-00000'); INSERT INTO person_positions (person_id, position_id) VALUES ('rosa', 'shift-lead'), ('ana', 'barista'), ('ana', 'shift-lead'), ('ben', 'barista'), ('jo', 'barista'), ('lee', 'barista'), ('sam', 'barista'), ('sam', 'kitchen'), ('kai', 'kitchen'), ('mia', 'kitchen'); INSERT INTO availability_entries (id, person_id, weekday, start_time, end_time, note) VALUES ('av-jo-tue', 'jo', 2, '00:00', '24:00', 'classes'); -- Kai's approved time off: no reason, decided by Rosa. created_at is the seed's load time on the spec's clock. INSERT INTO time_off_requests (id, person_id, start_date, end_date, status, reason, decided_by, created_at) VALUES ('to-kai-1024', 'kai', '2026-10-24', '2026-10-25', 'approved', NULL, 'rosa', '2026-10-15 13:00:00'); INSERT INTO templates (id, name, position_id, start_time, end_time) VALUES ('opening', 'Opening', 'barista', '06:00', '14:00'), ('closing', 'Closing', 'barista', '14:00', '22:00'), ('weekend-barista', 'Weekend barista', 'barista', '08:00', '16:00'), ('kitchen', 'Kitchen', 'kitchen', '07:00', '15:00'), ('shift-lead', 'Shift lead', 'shift-lead', '10:00', '18:00'); INSERT INTO template_weekdays (template_id, weekday) VALUES ('opening', 1), ('opening', 2), ('opening', 3), ('opening', 4), ('opening', 5), ('closing', 1), ('closing', 2), ('closing', 3), ('closing', 4), ('closing', 5), ('weekend-barista', 6), ('weekend-barista', 7), ('kitchen', 1), ('kitchen', 2), ('kitchen', 3), ('kitchen', 4), ('kitchen', 5), ('kitchen', 6), ('kitchen', 7), ('shift-lead', 1), ('shift-lead', 2), ('shift-lead', 3), ('shift-lead', 4), ('shift-lead', 5); -- The week of Oct 12 was published by Rosa at 09:00 local on Thursday Oct 8 (13:00 UTC). INSERT INTO weeks (id, week_start, status, published_at, published_by) VALUES ('week-2026-10-12', '2026-10-12', 'published', '2026-10-08 13:00:00', 'rosa'), ('week-2026-10-19', '2026-10-19', 'draft', NULL, NULL); -- 24 eight-hour shifts per week. The two weeks match except Saturday's weekend barista shift: Jo's on Oct 17, open on Oct 24. -- Week of Oct 12 (published) INSERT INTO shifts (id, week_id, position_id, starts_at, ends_at, person_id, note, override_note) VALUES ('s-1012-opening', 'week-2026-10-12', 'barista', '2026-10-12 10:00:00', '2026-10-12 18:00:00', 'ben', NULL, NULL), ('s-1012-closing', 'week-2026-10-12', 'barista', '2026-10-12 18:00:00', '2026-10-13 02:00:00', 'lee', NULL, NULL), ('s-1012-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-12 11:00:00', '2026-10-12 19:00:00', 'mia', NULL, NULL), ('s-1012-shift-lead', 'week-2026-10-12', 'shift-lead', '2026-10-12 14:00:00', '2026-10-12 22:00:00', 'rosa', NULL, NULL), ('s-1013-opening', 'week-2026-10-12', 'barista', '2026-10-13 10:00:00', '2026-10-13 18:00:00', 'ben', NULL, NULL), ('s-1013-closing', 'week-2026-10-12', 'barista', '2026-10-13 18:00:00', '2026-10-14 02:00:00', 'lee', NULL, NULL), ('s-1013-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-13 11:00:00', '2026-10-13 19:00:00', 'mia', NULL, NULL), ('s-1013-shift-lead', 'week-2026-10-12', 'shift-lead', '2026-10-13 14:00:00', '2026-10-13 22:00:00', 'rosa', NULL, NULL), ('s-1014-opening', 'week-2026-10-12', 'barista', '2026-10-14 10:00:00', '2026-10-14 18:00:00', 'ben', NULL, NULL), ('s-1014-closing', 'week-2026-10-12', 'barista', '2026-10-14 18:00:00', '2026-10-15 02:00:00', 'ana', NULL, NULL), ('s-1014-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-14 11:00:00', '2026-10-14 19:00:00', 'kai', NULL, NULL), ('s-1014-shift-lead', 'week-2026-10-12', 'shift-lead', '2026-10-14 14:00:00', '2026-10-14 22:00:00', 'rosa', NULL, NULL), ('s-1015-opening', 'week-2026-10-12', 'barista', '2026-10-15 10:00:00', '2026-10-15 18:00:00', 'ben', NULL, NULL), ('s-1015-closing', 'week-2026-10-12', 'barista', '2026-10-15 18:00:00', '2026-10-16 02:00:00', 'ana', NULL, NULL), ('s-1015-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-15 11:00:00', '2026-10-15 19:00:00', 'kai', NULL, NULL), ('s-1015-shift-lead', 'week-2026-10-12', 'shift-lead', '2026-10-15 14:00:00', '2026-10-15 22:00:00', 'rosa', NULL, NULL), ('s-1016-opening', 'week-2026-10-12', 'barista', '2026-10-16 10:00:00', '2026-10-16 18:00:00', 'jo', NULL, NULL), ('s-1016-closing', 'week-2026-10-12', 'barista', '2026-10-16 18:00:00', '2026-10-17 02:00:00', 'sam', NULL, NULL), ('s-1016-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-16 11:00:00', '2026-10-16 19:00:00', 'mia', NULL, NULL), ('s-1016-shift-lead', 'week-2026-10-12', 'shift-lead', '2026-10-16 14:00:00', '2026-10-16 22:00:00', 'rosa', NULL, NULL), ('s-1017-weekend-barista', 'week-2026-10-12', 'barista', '2026-10-17 12:00:00', '2026-10-17 20:00:00', 'jo', NULL, NULL), ('s-1017-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-17 11:00:00', '2026-10-17 19:00:00', 'mia', NULL, NULL), ('s-1018-weekend-barista', 'week-2026-10-12', 'barista', '2026-10-18 12:00:00', '2026-10-18 20:00:00', 'jo', NULL, NULL), ('s-1018-kitchen', 'week-2026-10-12', 'kitchen', '2026-10-18 11:00:00', '2026-10-18 19:00:00', 'sam', NULL, NULL); -- Week of Oct 19 (draft) INSERT INTO shifts (id, week_id, position_id, starts_at, ends_at, person_id, note, override_note) VALUES ('s-1019-opening', 'week-2026-10-19', 'barista', '2026-10-19 10:00:00', '2026-10-19 18:00:00', 'ben', NULL, NULL), ('s-1019-closing', 'week-2026-10-19', 'barista', '2026-10-19 18:00:00', '2026-10-20 02:00:00', 'lee', NULL, NULL), ('s-1019-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-19 11:00:00', '2026-10-19 19:00:00', 'mia', NULL, NULL), ('s-1019-shift-lead', 'week-2026-10-19', 'shift-lead', '2026-10-19 14:00:00', '2026-10-19 22:00:00', 'rosa', NULL, NULL), ('s-1020-opening', 'week-2026-10-19', 'barista', '2026-10-20 10:00:00', '2026-10-20 18:00:00', 'ben', NULL, NULL), ('s-1020-closing', 'week-2026-10-19', 'barista', '2026-10-20 18:00:00', '2026-10-21 02:00:00', 'lee', NULL, NULL), ('s-1020-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-20 11:00:00', '2026-10-20 19:00:00', 'mia', NULL, NULL), ('s-1020-shift-lead', 'week-2026-10-19', 'shift-lead', '2026-10-20 14:00:00', '2026-10-20 22:00:00', 'rosa', NULL, NULL), ('s-1021-opening', 'week-2026-10-19', 'barista', '2026-10-21 10:00:00', '2026-10-21 18:00:00', 'ben', NULL, NULL), ('s-1021-closing', 'week-2026-10-19', 'barista', '2026-10-21 18:00:00', '2026-10-22 02:00:00', 'ana', NULL, NULL), ('s-1021-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-21 11:00:00', '2026-10-21 19:00:00', 'kai', NULL, NULL), ('s-1021-shift-lead', 'week-2026-10-19', 'shift-lead', '2026-10-21 14:00:00', '2026-10-21 22:00:00', 'rosa', NULL, NULL), ('s-1022-opening', 'week-2026-10-19', 'barista', '2026-10-22 10:00:00', '2026-10-22 18:00:00', 'ben', NULL, NULL), ('s-1022-closing', 'week-2026-10-19', 'barista', '2026-10-22 18:00:00', '2026-10-23 02:00:00', 'ana', NULL, NULL), ('s-1022-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-22 11:00:00', '2026-10-22 19:00:00', 'kai', NULL, NULL), ('s-1022-shift-lead', 'week-2026-10-19', 'shift-lead', '2026-10-22 14:00:00', '2026-10-22 22:00:00', 'rosa', NULL, NULL), ('s-1023-opening', 'week-2026-10-19', 'barista', '2026-10-23 10:00:00', '2026-10-23 18:00:00', 'jo', NULL, NULL), ('s-1023-closing', 'week-2026-10-19', 'barista', '2026-10-23 18:00:00', '2026-10-24 02:00:00', 'sam', NULL, NULL), ('s-1023-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-23 11:00:00', '2026-10-23 19:00:00', 'mia', NULL, NULL), ('s-1023-shift-lead', 'week-2026-10-19', 'shift-lead', '2026-10-23 14:00:00', '2026-10-23 22:00:00', 'rosa', NULL, NULL), ('s-1024-weekend-barista', 'week-2026-10-19', 'barista', '2026-10-24 12:00:00', '2026-10-24 20:00:00', NULL, NULL, NULL), ('s-1024-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-24 11:00:00', '2026-10-24 19:00:00', 'mia', NULL, NULL), ('s-1025-weekend-barista', 'week-2026-10-19', 'barista', '2026-10-25 12:00:00', '2026-10-25 20:00:00', 'jo', NULL, NULL), ('s-1025-kitchen', 'week-2026-10-19', 'kitchen', '2026-10-25 11:00:00', '2026-10-25 19:00:00', 'sam', NULL, NULL); -- Jo has asked Lee to take Saturday Oct 17 as a swap; it waits for Lee. created_at is the seed's load time on the spec's clock. INSERT INTO shift_requests (id, kind, shift_id, requested_by, target_person_id, reason, created_at, status, decided_by, decided_at) VALUES ('req-jo-swap-1017', 'swap', 's-1017-weekend-barista', 'jo', 'lee', NULL, '2026-10-15 13:00:00', 'pending_target', NULL, NULL); -- Loading the seed writes a single "seed loaded" event and no other history. INSERT INTO events (id, at, actor_id, type, shift_id, week_id, data) VALUES ('ev-seed', '2026-10-15 13:00:00', NULL, 'seed loaded', NULL, NULL, NULL);