-- Seed data for the Simple CRM schema, from section 12 of the blueprint. Load after simple-crm.sql. -- The spec gives dates relative to T, the day the seed is loaded. This file fixes T = 2026-10-14, -- the date in the spec's own Today-screen example ("Digest sent for Oct 14: 2 overdue, 0 due today, 1 deal"), which this data reproduces for Sam Okafor. -- The spec gives no ids, so the ids here are readable slugs. -- Seven people. Dana Ruiz and Ana Lima are admins. INSERT INTO people (id, name, email, is_admin, active) VALUES ('p_dana', 'Dana Ruiz', 'dana@northwind.example', TRUE, TRUE), ('p_ana', 'Ana Lima', 'ana@northwind.example', TRUE, TRUE), ('p_maya', 'Maya Chen', 'maya@northwind.example', FALSE, TRUE), ('p_sam', 'Sam Okafor', 'sam@northwind.example', FALSE, TRUE), ('p_ben', 'Ben Cho', 'ben@northwind.example', FALSE, TRUE), ('p_jo', 'Jo Park', 'jo@northwind.example', FALSE, TRUE), ('p_lee', 'Lee Park', 'lee@northwind.example', FALSE, TRUE); -- Seven companies with their domains and owners. INSERT INTO companies (id, name, domain, owner_id) VALUES ('co_bluebird', 'Bluebird', 'bluebird.example', 'p_sam'), ('co_acme', 'Acme', 'acme.example', 'p_maya'), ('co_ridgeway', 'Ridgeway', 'ridgeway.example', 'p_lee'), ('co_olsen', 'Olsen & Co', 'olsen.example', 'p_dana'), ('co_harbor', 'Harbor', 'harbor.example', 'p_sam'), ('co_kestrel', 'Kestrel', 'kestrel.example', 'p_jo'), ('co_pinelabs', 'Pine Labs', 'pinelabs.example', 'p_lee'); -- Fourteen contacts. Emails are first name at the company domain; Zoe Carter is zoe@carter.example. -- Ruth Adams is archived and has no follow-up date. INSERT INTO contacts (id, name, email, title, company_id, owner_id, next_follow_up, archived) VALUES ('c_grace', 'Grace Kim', 'grace@harbor.example', 'Director of IT', 'co_harbor', 'p_sam', '2026-10-08', FALSE), ('c_priya', 'Priya Shah', 'priya@bluebird.example', 'Head of Operations', 'co_bluebird', 'p_sam', '2026-10-11', FALSE), ('c_hana', 'Hana Sato', 'hana@pinelabs.example', 'Operations lead', 'co_pinelabs', 'p_lee', '2026-10-12', FALSE), ('c_rosa', 'Rosa Diaz', 'rosa@acme.example', 'VP Finance', 'co_acme', 'p_maya', '2026-10-13', FALSE), ('c_kim', 'Kim Olsen', 'kim@olsen.example', 'Founder', 'co_olsen', 'p_dana', '2026-10-14', FALSE), ('c_nina', 'Nina Patel', 'nina@ridgeway.example', 'COO', 'co_ridgeway', 'p_lee', '2026-10-14', FALSE), ('c_leo', 'Leo Martins', 'leo@kestrel.example', 'CEO', 'co_kestrel', 'p_jo', '2026-10-15', FALSE), ('c_owen', 'Owen Hart', 'owen@acme.example', 'Procurement manager', 'co_acme', 'p_maya', '2026-10-16', FALSE), ('c_tom', 'Tom Becker', 'tom@bluebird.example', 'CTO', 'co_bluebird', 'p_sam', '2026-10-18', FALSE), ('c_ivan', 'Ivan Petrov', 'ivan@pinelabs.example', 'Head of Sales', 'co_pinelabs', 'p_lee', '2026-10-19', FALSE), ('c_zoe', 'Zoe Carter', 'zoe@carter.example', 'Independent consultant', NULL, 'p_maya', '2026-10-21', FALSE), ('c_marcus', 'Marcus Lee', 'marcus@olsen.example', 'Office manager', 'co_olsen', 'p_dana', '2026-10-23', FALSE), ('c_felix', 'Felix Wong', 'felix@ridgeway.example', 'Engineering manager', 'co_ridgeway', 'p_lee', '2026-10-28', FALSE), ('c_ruth', 'Ruth Adams', 'ruth@kestrel.example', 'Former buyer', 'co_kestrel', 'p_jo', NULL, TRUE); -- Twelve deals: nine open, two won, one lost. company_id is copied from the contact's company. INSERT INTO deals (id, title, contact_id, company_id, owner_id, value_cents, stage, expected_close, closed_on, lost_reason) VALUES ('d_acme_expansion', 'Acme expansion', 'c_owen', 'co_acme', 'p_maya', 1250000, 'lead', '2026-11-23', NULL, NULL), ('d_kestrel_starter', 'Kestrel starter', 'c_leo', 'co_kestrel', 'p_jo', 320000, 'lead', '2026-11-13', NULL, NULL), ('d_bluebird_seats', 'Bluebird add-on seats', 'c_tom', 'co_bluebird', 'p_sam', 450000, 'demo', '2026-11-08', NULL, NULL), ('d_acme_pilot', 'Acme pilot', 'c_rosa', 'co_acme', 'p_maya', 600000, 'demo', '2026-10-12', NULL, NULL), ('d_pinelabs_team', 'Pine Labs team plan', 'c_hana', 'co_pinelabs', 'p_lee', 740000, 'demo', '2026-11-01', NULL, NULL), ('d_bluebird_annual', 'Bluebird annual plan', 'c_priya', 'co_bluebird', 'p_sam', 1800000, 'proposal', '2026-10-24', NULL, NULL), ('d_ridgeway_onboarding', 'Ridgeway onboarding', 'c_nina', 'co_ridgeway', 'p_lee', 980000, 'proposal', '2026-10-28', NULL, NULL), ('d_olsen_rollout', 'Olsen & Co rollout', 'c_kim', 'co_olsen', 'p_dana', 3200000, 'negotiation', '2026-10-19', NULL, NULL), ('d_harbor_renewal', 'Harbor renewal', 'c_grace', 'co_harbor', 'p_sam', 1500000, 'negotiation', '2026-10-17', NULL, NULL), ('d_pinelabs_pilot', 'Pine Labs pilot', 'c_ivan', 'co_pinelabs', 'p_lee', 500000, 'won', '2026-10-12', '2026-10-12', NULL), ('d_harbor_first', 'Harbor first order', 'c_grace', 'co_harbor', 'p_sam', 800000, 'won', '2026-09-24', '2026-09-24', NULL), ('d_ridgeway_consulting', 'Ridgeway consulting', 'c_felix', 'co_ridgeway', 'p_lee', 250000, 'lost', '2026-10-06', '2026-10-06', 'Chose to build in-house');