-- Seed data for the Quote Builder schema, from section 14 of the blueprint. Load after quote-builder.sql. -- Today (T) is fixed to Tue 13 Oct 2026, clock 12:00 UTC (the company time zone is UTC in v1). Money in cents, percentages in basis points. INSERT INTO people (id, name, email, role, active) VALUES ('person-dana', 'Dana Ruiz', 'dana@northwind.example', 'manager', TRUE), ('person-ana', 'Ana Lima', 'ana@northwind.example', 'manager', TRUE), ('person-jo', 'Jo Park', 'jo@northwind.example', 'rep', TRUE), ('person-lee', 'Lee Park', 'lee@northwind.example', 'rep', TRUE), ('person-maya', 'Maya Chen', 'maya@northwind.example', 'rep', TRUE); INSERT INTO settings (id, company_name, company_address, company_email, approval_threshold_bp, validity_days, default_tax_rate_bp, default_payment_terms_days, next_quote_number, next_invoice_number) VALUES (1, 'Northwind', '18 Mill Road, Portland, OR 97205', 'sales@northwind.example', 1500, 30, 800, 30, 1045, 2002); INSERT INTO clients (id, name, contact_name, contact_email, address, payment_terms_days, tax_rate_bp, created_at) VALUES ('client-bluebird', 'Bluebird Health', 'Priya Shah', 'priya@bluebird.example', NULL, 30, 800, '2026-08-14 09:00:00'), ('client-acme', 'Acme Logistics', 'Tom Reyes', 'tom@acme.example', NULL, 30, 800, '2026-08-14 09:00:00'), ('client-ridgeway', 'Ridgeway Partners', 'Hannah Kim', 'hannah@ridgeway.example', NULL, 45, 800, '2026-08-14 09:00:00'), ('client-olsen', 'Olsen & Co', 'Erik Olsen', 'erik@olsen.example', NULL, 15, 800, '2026-08-14 09:00:00'), ('client-harbor', 'Harbor Foods', 'Grace Liu', 'grace@harborfoods.example', NULL, 30, 800, '2026-08-14 09:00:00'), ('client-kestrel', 'Kestrel Schools', 'Mark Bell', 'mark@kestrel.example', NULL, 30, 0, '2026-08-14 09:00:00'), ('client-pine', 'Pine Labs', 'Noor Haddad', 'noor@pinelabs.example', NULL, 30, 800, '2026-08-14 09:00:00'); INSERT INTO products (id, sku, name, description, unit, unit_price_cents, active) VALUES ('product-seat', 'SEAT', 'Team seat', NULL, 'per seat / year', 15000, TRUE), ('product-onb', 'ONB', 'Onboarding package', NULL, 'each', 240000, TRUE), ('product-mig', 'MIG', 'Data migration', NULL, 'each', 120000, TRUE), ('product-trn', 'TRN', 'Training session (2 hours, remote)', NULL, 'per session', 40000, TRUE), ('product-sup', 'SUP', 'Premium support', NULL, 'per year', 180000, TRUE), ('product-int', 'INT', 'Integration work', NULL, 'per hour', 17500, TRUE), ('product-api', 'API', 'API access add-on', NULL, 'per year', 60000, TRUE), ('product-old', 'OLD', 'Legacy setup fee', NULL, 'each', 50000, FALSE); INSERT INTO templates (id, name, description, created_by, updated_at) VALUES ('template-starter', 'Starter package', NULL, NULL, '2026-08-14 09:00:00'), ('template-growth', 'Growth package', NULL, NULL, '2026-08-14 09:00:00'), ('template-enterprise', 'Enterprise rollout', NULL, NULL, '2026-08-14 09:00:00'); INSERT INTO template_lines (id, template_id, position, product_id, qty, discount_bp) VALUES ('template-starter-line-1', 'template-starter', 1, 'product-seat', 10, 0), ('template-starter-line-2', 'template-starter', 2, 'product-onb', 1, 0), ('template-starter-line-3', 'template-starter', 3, 'product-trn', 1, 0), ('template-growth-line-1', 'template-growth', 1, 'product-seat', 25, 0), ('template-growth-line-2', 'template-growth', 2, 'product-onb', 1, 0), ('template-growth-line-3', 'template-growth', 3, 'product-mig', 1, 0), ('template-growth-line-4', 'template-growth', 4, 'product-trn', 2, 0), ('template-enterprise-line-1', 'template-enterprise', 1, 'product-seat', 100, 0), ('template-enterprise-line-2', 'template-enterprise', 2, 'product-onb', 1, 0), ('template-enterprise-line-3', 'template-enterprise', 3, 'product-mig', 1, 0), ('template-enterprise-line-4', 'template-enterprise', 4, 'product-trn', 4, 0), ('template-enterprise-line-5', 'template-enterprise', 5, 'product-sup', 1, 0), ('template-enterprise-line-6', 'template-enterprise', 6, 'product-int', 20, 0); -- The 9 quotes. Totals follow section 6 and match the totals in section 14. valid_until = creation day + 30 (validity_days). INSERT INTO quotes (id, number, owner_id, client_id, title, status, valid_until, tax_rate_bp, quote_discount_bp, payment_terms_days, notes, list_cents, discount_cents, tax_cents, total_cents, public_token, sent_at, first_viewed_at, last_viewed_at, view_count, accepted_at, accepted_by_name, declined_at, decline_reason, expired_at, expiry_reminder_for, duplicated_from_id, invoice_id, created_at, updated_at) VALUES ('quote-1036', 1036, 'person-lee', 'client-olsen', NULL, 'accepted', '2026-10-15', 800, 0, 15, NULL, 430000, 0, 34400, 464400, 'seed-placeholder-token-q1036', '2026-09-15 10:00:00', '2026-09-15 14:00:00', '2026-09-15 14:00:00', 1, '2026-09-15 14:10:00', 'Erik Olsen', NULL, NULL, NULL, NULL, NULL, 'invoice-2001', '2026-09-15 09:00:00', '2026-09-15 15:00:00'), ('quote-1037', 1037, 'person-maya', 'client-harbor', NULL, 'declined', '2026-10-28', 800, 500, 30, NULL, 690000, 34500, 52440, 707940, 'seed-placeholder-token-q1037', '2026-09-28 10:00:00', '2026-09-28 14:00:00', '2026-09-28 14:00:00', 1, NULL, NULL, '2026-09-28 14:10:00', 'We went with a cheaper option for this year.', NULL, NULL, NULL, NULL, '2026-09-28 09:00:00', '2026-09-28 14:10:00'), ('quote-1038', 1038, 'person-jo', 'client-pine', NULL, 'expired', '2026-10-08', 800, 0, 30, NULL, 265000, 0, 21200, 286200, 'seed-placeholder-token-q1038', '2026-09-08 10:00:00', NULL, NULL, 0, NULL, NULL, NULL, NULL, '2026-10-09 00:05:00', NULL, NULL, NULL, '2026-09-08 09:00:00', '2026-10-09 00:05:00'), ('quote-1039', 1039, 'person-jo', 'client-acme', NULL, 'accepted', '2026-11-10', 800, 500, 30, NULL, 1020000, 108000, 72960, 984960, 'seed-placeholder-token-q1039', '2026-10-11 10:00:00', '2026-10-11 14:00:00', '2026-10-11 14:00:00', 1, '2026-10-11 14:10:00', 'Tom Reyes', NULL, NULL, NULL, NULL, NULL, NULL, '2026-10-11 09:00:00', '2026-10-11 14:10:00'), ('quote-1040', 1040, 'person-lee', 'client-ridgeway', NULL, 'pending_approval', '2026-11-07', 800, 0, 45, NULL, 1740000, 300000, 115200, 1555200, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-10-08 09:00:00', '2026-10-13 07:00:00'), ('quote-1041', 1041, 'person-jo', 'client-bluebird', NULL, 'viewed', '2026-10-15', 800, 0, 30, NULL, 1070000, 75000, 79600, 1074600, 'seed-placeholder-token-q1041', '2026-09-15 10:00:00', '2026-09-15 14:00:00', '2026-10-12 14:15:00', 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-09-15 09:00:00', '2026-09-15 14:00:00'), ('quote-1042', 1042, 'person-jo', 'client-kestrel', NULL, 'sent', '2026-11-10', 0, 0, 30, NULL, 815000, 0, 0, 815000, 'seed-placeholder-token-q1042', '2026-10-11 10:00:00', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-10-11 09:00:00', '2026-10-11 10:00:00'), ('quote-1043', 1043, 'person-maya', 'client-pine', NULL, 'approved', '2026-11-11', 800, 0, 30, NULL, 1020000, 162000, 68640, 926640, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-10-12 09:00:00', '2026-10-12 14:00:00'), ('quote-1044', 1044, 'person-jo', 'client-acme', NULL, 'draft', '2026-11-12', 800, 0, 30, NULL, 140000, 0, 11200, 151200, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-10-13 09:00:00', '2026-10-13 09:00:00'); INSERT INTO quote_lines (id, quote_id, position, product_id, name, description, unit, unit_price_cents, qty, discount_bp) VALUES ('quote-1036-line-1', 'quote-1036', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 10, 0), ('quote-1036-line-2', 'quote-1036', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1036-line-3', 'quote-1036', 3, 'product-trn', 'Training session (2 hours, remote)', NULL, 'per session', 40000, 1, 0), ('quote-1037-line-1', 'quote-1037', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 30, 0), ('quote-1037-line-2', 'quote-1037', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1038-line-1', 'quote-1038', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 15, 0), ('quote-1038-line-2', 'quote-1038', 2, 'product-trn', 'Training session (2 hours, remote)', NULL, 'per session', 40000, 1, 0), ('quote-1039-line-1', 'quote-1039', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 40, 1000), ('quote-1039-line-2', 'quote-1039', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1039-line-3', 'quote-1039', 3, 'product-sup', 'Premium support', NULL, 'per year', 180000, 1, 0), ('quote-1040-line-1', 'quote-1040', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 100, 2000), ('quote-1040-line-2', 'quote-1040', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1041-line-1', 'quote-1041', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 50, 1000), ('quote-1041-line-2', 'quote-1041', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1041-line-3', 'quote-1041', 3, 'product-trn', 'Training session (2 hours, remote)', NULL, 'per session', 40000, 2, 0), ('quote-1042-line-1', 'quote-1042', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 25, 0), ('quote-1042-line-2', 'quote-1042', 2, 'product-onb', 'Onboarding package', NULL, 'each', 240000, 1, 0), ('quote-1042-line-3', 'quote-1042', 3, 'product-mig', 'Data migration', NULL, 'each', 120000, 1, 0), ('quote-1042-line-4', 'quote-1042', 4, 'product-trn', 'Training session (2 hours, remote)', NULL, 'per session', 40000, 2, 0), ('quote-1043-line-1', 'quote-1043', 1, 'product-seat', 'Team seat', NULL, 'per seat / year', 15000, 60, 1800), ('quote-1043-line-2', 'quote-1043', 2, 'product-mig', 'Data migration', NULL, 'each', 120000, 1, 0), ('quote-1044-line-1', 'quote-1044', 1, 'product-api', 'API access add-on', NULL, 'per year', 60000, 1, 0), ('quote-1044-line-2', 'quote-1044', 2, 'product-trn', 'Training session (2 hours, remote)', NULL, 'per session', 40000, 2, 0); INSERT INTO approvals (id, quote_id, requested_by, requested_at, discount_bp, total_cents, status, decided_by, decided_at, comment) VALUES ('approval-1040', 'quote-1040', 'person-lee', '2026-10-13 07:00:00', 1724, 1555200, 'pending', NULL, NULL, NULL), ('approval-1043', 'quote-1043', 'person-maya', '2026-10-12 10:00:00', 1588, 926640, 'approved', 'person-dana', '2026-10-12 14:00:00', 'OK for a 60-seat commitment.'); INSERT INTO invoices (id, number, quote_id, client_id, issued_on, due_on, bill_to_name, bill_to_contact_name, bill_to_email, bill_to_address, list_cents, discount_cents, tax_cents, total_cents, created_by, created_at) VALUES ('invoice-2001', 2001, 'quote-1036', 'client-olsen', '2026-09-15', '2026-09-30', 'Olsen & Co', 'Erik Olsen', 'erik@olsen.example', NULL, 430000, 0, 34400, 464400, 'person-lee', '2026-09-15 15:00:00'); INSERT INTO invoice_lines (id, invoice_id, position, name, description, unit, unit_price_cents, qty, discount_bp) VALUES ('invoice-2001-line-1', 'invoice-2001', 1, 'Team seat', NULL, 'per seat / year', 15000, 10, 0), ('invoice-2001-line-2', 'invoice-2001', 2, 'Onboarding package', NULL, 'each', 240000, 1, 0), ('invoice-2001-line-3', 'invoice-2001', 3, 'Training session (2 hours, remote)', NULL, 'per session', 40000, 1, 0); -- History each quote's status implies (R14). INSERT INTO events (id, quote_id, actor_kind, actor_id, type, data, created_at) VALUES ('quote-1036-event-1', 'quote-1036', 'person', 'person-lee', 'created', NULL, '2026-09-15 09:00:00'), ('quote-1036-event-2', 'quote-1036', 'person', 'person-lee', 'sent', NULL, '2026-09-15 10:00:00'), ('quote-1036-event-3', 'quote-1036', 'client', NULL, 'viewed', NULL, '2026-09-15 14:00:00'), ('quote-1036-event-4', 'quote-1036', 'client', NULL, 'accepted', NULL, '2026-09-15 14:10:00'), ('quote-1036-event-5', 'quote-1036', 'person', 'person-lee', 'invoiced', NULL, '2026-09-15 15:00:00'), ('quote-1037-event-1', 'quote-1037', 'person', 'person-maya', 'created', NULL, '2026-09-28 09:00:00'), ('quote-1037-event-2', 'quote-1037', 'person', 'person-maya', 'sent', NULL, '2026-09-28 10:00:00'), ('quote-1037-event-3', 'quote-1037', 'client', NULL, 'viewed', NULL, '2026-09-28 14:00:00'), ('quote-1037-event-4', 'quote-1037', 'client', NULL, 'declined', NULL, '2026-09-28 14:10:00'), ('quote-1038-event-1', 'quote-1038', 'person', 'person-jo', 'created', NULL, '2026-09-08 09:00:00'), ('quote-1038-event-2', 'quote-1038', 'person', 'person-jo', 'sent', NULL, '2026-09-08 10:00:00'), ('quote-1038-event-3', 'quote-1038', 'system', NULL, 'expired', NULL, '2026-10-09 00:05:00'), ('quote-1039-event-1', 'quote-1039', 'person', 'person-jo', 'created', NULL, '2026-10-11 09:00:00'), ('quote-1039-event-2', 'quote-1039', 'person', 'person-jo', 'sent', NULL, '2026-10-11 10:00:00'), ('quote-1039-event-3', 'quote-1039', 'client', NULL, 'viewed', NULL, '2026-10-11 14:00:00'), ('quote-1039-event-4', 'quote-1039', 'client', NULL, 'accepted', NULL, '2026-10-11 14:10:00'), ('quote-1040-event-1', 'quote-1040', 'person', 'person-lee', 'created', NULL, '2026-10-08 09:00:00'), ('quote-1040-event-2', 'quote-1040', 'person', 'person-lee', 'approval_requested', NULL, '2026-10-13 07:00:00'), ('quote-1041-event-1', 'quote-1041', 'person', 'person-jo', 'created', NULL, '2026-09-15 09:00:00'), ('quote-1041-event-2', 'quote-1041', 'person', 'person-jo', 'sent', NULL, '2026-09-15 10:00:00'), ('quote-1041-event-3', 'quote-1041', 'client', NULL, 'viewed', NULL, '2026-09-15 14:00:00'), ('quote-1042-event-1', 'quote-1042', 'person', 'person-jo', 'created', NULL, '2026-10-11 09:00:00'), ('quote-1042-event-2', 'quote-1042', 'person', 'person-jo', 'sent', NULL, '2026-10-11 10:00:00'), ('quote-1043-event-1', 'quote-1043', 'person', 'person-maya', 'created', NULL, '2026-10-12 09:00:00'), ('quote-1043-event-2', 'quote-1043', 'person', 'person-maya', 'approval_requested', NULL, '2026-10-12 10:00:00'), ('quote-1043-event-3', 'quote-1043', 'person', 'person-dana', 'approved', NULL, '2026-10-12 14:00:00'), ('quote-1044-event-1', 'quote-1044', 'person', 'person-jo', 'created', NULL, '2026-10-13 09:00:00');