-- Seed data for the Training Manual schema, from section 14 of the blueprint. Load after training-manual.sql. -- Today is Thursday, October 15, 2026 (America/New_York). Dates without a time use 12:00 UTC. -- Step reads, quiz attempts, signatures, policy versions, events and the outbox are left out; the JSON seedNote says why. INSERT INTO settings (id, company_name, time_zone, due_soon_days, verification_default_days, email_domain) VALUES (1, 'Harbor Coffee Roasters', 'America/New_York', 2, 180, 'harborcoffee.example'); -- start_date is a placeholder (2026-01-01) for everyone except Eli, who started Monday Oct 12. INSERT INTO people (id, name, email, is_admin, manager_id, start_date, active) VALUES ('p_ana', 'Ana Ruiz', 'ana@harborcoffee.example', TRUE, NULL, '2026-01-01', TRUE), ('p_ben', 'Ben Ortiz', 'ben@harborcoffee.example', FALSE, 'p_ana', '2026-01-01', TRUE), ('p_cara', 'Cara Lin', 'cara@harborcoffee.example', FALSE, 'p_ben', '2026-01-01', TRUE), ('p_dev', 'Dev Shah', 'dev@harborcoffee.example', FALSE, 'p_ben', '2026-01-01', TRUE), ('p_eli', 'Eli Moss', 'eli@harborcoffee.example', FALSE, 'p_ben', '2026-10-12', TRUE), ('p_fay', 'Fay Kim', 'fay@harborcoffee.example', FALSE, 'p_ana', '2026-01-01', TRUE); INSERT INTO roles (id, name) VALUES ('r_barista', 'Barista'), ('r_shift_lead', 'Shift lead'), ('r_roaster', 'Roaster'); INSERT INTO person_roles (person_id, role_id) VALUES ('p_cara', 'r_barista'), ('p_dev', 'r_barista'), ('p_eli', 'r_barista'), ('p_ben', 'r_shift_lead'), ('p_fay', 'r_roaster'); -- verify_every_days is the 180-day default where the spec gives no interval. verified_at is empty where the spec says only within the last 60 days. INSERT INTO subjects (id, title, kind, owner_id, status, assign_to_all, open_to_everyone, due_days, verify_every_days, verified_at, verified_by, version, pass_mark) VALUES ('s_espresso', 'Espresso basics', 'process', 'p_ana', 'published', FALSE, FALSE, 14, 180, NULL, NULL, NULL, 80), ('s_opening', 'Opening checklist', 'process', 'p_ben', 'published', FALSE, FALSE, 7, 180, '2026-04-10 12:00:00', NULL, NULL, NULL), ('s_food', 'Food safety policy', 'policy', 'p_ana', 'published', TRUE, FALSE, 14, 180, NULL, NULL, 2, NULL), ('s_cash', 'Cash handling policy', 'policy', 'p_ana', 'published', FALSE, FALSE, 7, 180, NULL, NULL, 3, NULL), ('s_roasting', 'Roasting safety', 'process', 'p_fay', 'published', FALSE, FALSE, 14, 180, '2026-09-25 12:00:00', NULL, NULL, NULL); -- body and created_at are placeholders: the spec gives step titles only. INSERT INTO steps (id, subject_id, position, title, body, created_at, deleted_at) VALUES ('st_esp_1', 's_espresso', 1, 'The machine', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_esp_2', 's_espresso', 2, 'Dialling in the grinder', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_esp_3', 's_espresso', 3, 'Dosing and tamping', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_esp_4', 's_espresso', 4, 'Pulling a shot', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_esp_5', 's_espresso', 5, 'Steaming milk', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_esp_6', 's_espresso', 6, 'Cleaning down', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_open_1', 's_opening', 1, 'Unlock and disarm', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_open_2', 's_opening', 2, 'Power up the machines', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_open_3', 's_opening', 3, 'Stock the bar', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_open_4', 's_opening', 4, 'Open the till', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_food_1', 's_food', 1, 'Handwashing', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_food_2', 's_food', 2, 'Allergens', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_food_3', 's_food', 3, 'Temperatures and storage', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_cash_1', 's_cash', 1, 'Counting the till', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_cash_2', 's_cash', 2, 'Refunds and discrepancies', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_roast_1', 's_roasting', 1, 'Before you start', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_roast_2', 's_roasting', 2, 'Fire safety', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL), ('st_roast_3', 's_roasting', 3, 'Cleaning the grinder and roaster', 'Seed placeholder: the spec leaves the step text to the builder.', '2026-01-01 12:00:00', NULL); INSERT INTO questions (id, subject_id, position, text, correct_option) VALUES ('q_esp_1', 's_espresso', 1, 'How much coffee goes into a double basket?', 2), ('q_esp_2', 's_espresso', 2, 'How long should a double shot take?', 2), ('q_esp_3', 's_espresso', 3, 'A shot runs too fast. What do you change?', 1), ('q_esp_4', 's_espresso', 4, 'What temperature should steamed milk reach?', 2), ('q_esp_5', 's_espresso', 5, 'When do you purge the steam wand?', 1); INSERT INTO question_options (question_id, position, text) VALUES ('q_esp_1', 1, '7 g'), ('q_esp_1', 2, '18 g'), ('q_esp_1', 3, '25 g'), ('q_esp_2', 1, '10 to 15 seconds'), ('q_esp_2', 2, '25 to 30 seconds'), ('q_esp_2', 3, '45 to 50 seconds'), ('q_esp_3', 1, 'Grind finer'), ('q_esp_3', 2, 'Grind coarser'), ('q_esp_3', 3, 'Tamp more lightly'), ('q_esp_4', 1, 'About 40 °C'), ('q_esp_4', 2, 'About 60 to 65 °C'), ('q_esp_4', 3, 'About 85 °C'), ('q_esp_5', 1, 'Before and after every jug'), ('q_esp_5', 2, 'Only at closing'), ('q_esp_5', 3, 'Never'); -- Food safety policy has no role assignment: it uses assign_to_all. INSERT INTO role_assignments (subject_id, role_id) VALUES ('s_espresso', 'r_barista'), ('s_opening', 'r_barista'), ('s_opening', 'r_shift_lead'), ('s_cash', 'r_shift_lead'), ('s_roasting', 'r_roaster'); -- assigned_at is a placeholder (2026-09-01 12:00 UTC) for the Opening checklist (Cara, Dev, Ben), Cash handling (Ben) and Roasting safety (Fay); -- their due_on follows R1 from it, except Cash handling, moved to Oct 21 by version 3 (published Oct 14, requires_resign, 7 days). INSERT INTO person_assignments (subject_id, person_id, assigned_at, due_on) VALUES ('s_espresso', 'p_cara', '2026-10-08 12:00:00', '2026-10-22'), ('s_espresso', 'p_dev', '2026-10-08 12:00:00', '2026-10-22'), ('s_espresso', 'p_eli', '2026-10-12 12:00:00', '2026-10-26'), ('s_opening', 'p_cara', '2026-09-01 12:00:00', '2026-09-08'), ('s_opening', 'p_dev', '2026-09-01 12:00:00', '2026-09-08'), ('s_opening', 'p_ben', '2026-09-01 12:00:00', '2026-09-08'), ('s_opening', 'p_eli', '2026-10-12 12:00:00', '2026-10-19'), ('s_food', 'p_ana', '2026-09-01 12:00:00', '2026-09-15'), ('s_food', 'p_ben', '2026-09-01 12:00:00', '2026-09-15'), ('s_food', 'p_cara', '2026-09-01 12:00:00', '2026-09-15'), ('s_food', 'p_dev', '2026-09-01 12:00:00', '2026-09-15'), ('s_food', 'p_fay', '2026-09-01 12:00:00', '2026-09-15'), ('s_food', 'p_eli', '2026-10-12 12:00:00', '2026-10-26'), ('s_cash', 'p_ben', '2026-09-01 12:00:00', '2026-10-21'), ('s_roasting', 'p_fay', '2026-09-01 12:00:00', '2026-09-15');