-- ============================================================================= -- Convivo — Phase 3 (Redesign): seed data for the multi-event model -- -- Ports the mockup's people/schedule into the new model: -- contacts (PK = email) / events / registrations / sponsors / slots / -- sessions / session_speakers / preferences / connections / checkins / -- feedback / leaderboard / points_log. -- -- The QR token is the Auth password (QR + email login, no email sent). -- Staff is merged into admin: Bruno, Rita, and the APPE Admin have is_admin. -- ============================================================================= -- ----------------------------------------------------------------------------- -- AUTH USERS (QR token = password). 12 attendees + 1 admin. -- NOTE: confirmation_token is set to '' (not NULL) because GoTrue's password -- grant cannot scan a NULL confirmation_token on manually-inserted users. -- ----------------------------------------------------------------------------- insert into auth.users (instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, confirmation_token, recovery_token, email_change_token_new, email_change, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_sent_at, last_sign_in_at) values ('00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111', 'authenticated', 'authenticated', 'ana.silva@nubank.com', crypt('CVV-ANA-4821', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ana Silva"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '22222222-2222-2222-2222-222222222222', 'authenticated', 'authenticated', 'bruno.costa@acme.com', crypt('CVV-BRU-1177', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Bruno Costa"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '33333333-3333-3333-3333-333333333333', 'authenticated', 'authenticated', 'rita.lopes@globant.com', crypt('CVV-RIT-9034', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Rita Lopes"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '44444444-4444-4444-4444-444444444444', 'authenticated', 'authenticated', 'tomas.ribeiro@dataprev.com', crypt('CVV-TOM-5566', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Tomás Ribeiro"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '55555555-5555-5555-5555-555555555555', 'authenticated', 'authenticated', 'sofia.almeida@loop.com', crypt('CVV-SOF-2299', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sofia Almeida"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '66666666-6666-6666-6666-666666666666', 'authenticated', 'authenticated', 'marco.chen@deepmind.com', crypt('CVV-MRC-7712', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marco Chen"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '77777777-7777-7777-7777-777777777777', 'authenticated', 'authenticated', 'julia.santos@ifood.com', crypt('CVV-JUL-3345', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Julia Santos"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '88888888-8888-8888-8888-888888888888', 'authenticated', 'authenticated', 'pedro.nunes@microsoft.com', crypt('CVV-PED-8801', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Pedro Nunes"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', '99999999-9999-9999-9999-999999999999', 'authenticated', 'authenticated', 'carla.mendes@quintoessencial.com', crypt('CVV-CAR-6623', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Carla Mendes"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'authenticated', 'authenticated', 'diego.ferreira@stone.com', crypt('CVV-DIE-4458', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Diego Ferreira"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'authenticated', 'authenticated', 'marina.costa@olx.com', crypt('CVV-MNA-2210', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marina Costa"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', 'cccccccc-cccc-cccc-cccc-cccccccccccc', 'authenticated', 'authenticated', 'lucas.oliveira@usp.br', crypt('CVV-LUC-9987', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lucas Oliveira"}', now(), now(), now(), now()), ('00000000-0000-0000-0000-000000000000', 'dddddddd-dddd-dddd-dddd-dddddddddddd', 'authenticated', 'authenticated', 'admin@appe.at', crypt('CVV-ADM-0001', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"APPE Admin"}', now(), now(), now(), now()) on conflict (id) do nothing; insert into auth.identities (id, provider_id, identity_data, provider, user_id, created_at, updated_at, last_sign_in_at) values ('11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111', '{"sub":"11111111-1111-1111-1111-111111111111","email":"ana.silva@nubank.com"}', 'email', '11111111-1111-1111-1111-111111111111', now(), now(), now()), ('22222222-2222-2222-2222-222222222222', '22222222-2222-2222-2222-222222222222', '{"sub":"22222222-2222-2222-2222-222222222222","email":"bruno.costa@acme.com"}', 'email', '22222222-2222-2222-2222-222222222222', now(), now(), now()), ('33333333-3333-3333-3333-333333333333', '33333333-3333-3333-3333-333333333333', '{"sub":"33333333-3333-3333-3333-333333333333","email":"rita.lopes@globant.com"}', 'email', '33333333-3333-3333-3333-333333333333', now(), now(), now()), ('44444444-4444-4444-4444-444444444444', '44444444-4444-4444-4444-444444444444', '{"sub":"44444444-4444-4444-4444-444444444444","email":"tomas.ribeiro@dataprev.com"}', 'email', '44444444-4444-4444-4444-444444444444', now(), now(), now()), ('55555555-5555-5555-5555-555555555555', '55555555-5555-5555-5555-555555555555', '{"sub":"55555555-5555-5555-5555-555555555555","email":"sofia.almeida@loop.com"}', 'email', '55555555-5555-5555-5555-555555555555', now(), now(), now()), ('66666666-6666-6666-6666-666666666666', '66666666-6666-6666-6666-666666666666', '{"sub":"66666666-6666-6666-6666-666666666666","email":"marco.chen@deepmind.com"}', 'email', '66666666-6666-6666-6666-666666666666', now(), now(), now()), ('77777777-7777-7777-7777-777777777777', '77777777-7777-7777-7777-777777777777', '{"sub":"77777777-7777-7777-7777-777777777777","email":"julia.santos@ifood.com"}', 'email', '77777777-7777-7777-7777-777777777777', now(), now(), now()), ('88888888-8888-8888-8888-888888888888', '88888888-8888-8888-8888-888888888888', '{"sub":"88888888-8888-8888-8888-888888888888","email":"pedro.nunes@microsoft.com"}', 'email', '88888888-8888-8888-8888-888888888888', now(), now(), now()), ('99999999-9999-9999-9999-999999999999', '99999999-9999-9999-9999-999999999999', '{"sub":"99999999-9999-9999-9999-999999999999","email":"carla.mendes@quintoessencial.com"}', 'email', '99999999-9999-9999-9999-999999999999', now(), now(), now()), ('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '{"sub":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","email":"diego.ferreira@stone.com"}', 'email', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', now(), now(), now()), ('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '{"sub":"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb","email":"marina.costa@olx.com"}', 'email', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', now(), now(), now()), ('cccccccc-cccc-cccc-cccc-cccccccccccc', 'cccccccc-cccc-cccc-cccc-cccccccccccc', '{"sub":"cccccccc-cccc-cccc-cccc-cccccccccccc","email":"lucas.oliveira@usp.br"}', 'email', 'cccccccc-cccc-cccc-cccc-cccccccccccc', now(), now(), now()), ('dddddddd-dddd-dddd-dddd-dddddddddddd', 'dddddddd-dddd-dddd-dddd-dddddddddddd', '{"sub":"dddddddd-dddd-dddd-dddd-dddddddddddd","email":"admin@appe.at"}', 'email', 'dddddddd-dddd-dddd-dddd-dddddddddddd', now(), now(), now()) on conflict (id) do nothing; -- ----------------------------------------------------------------------------- -- CONTACTS (PK = email). Mirrors auth.users. -- Staff is merged into admin: Bruno, Rita, and the APPE Admin have is_admin. -- Dr. Elena Vasquez is an external keynote speaker (no registration / auth user). -- NOTE: the QR token lives on the REGISTRATION (per event), not the contact. -- ----------------------------------------------------------------------------- insert into public.contacts (email, full_name, linkedin_url, show_email, show_linkedin, is_admin) values ('ana.silva@nubank.com', 'Ana Silva', 'https://linkedin.com/in/anasilva', true, true, false), ('bruno.costa@acme.com', 'Bruno Costa', 'https://linkedin.com/in/brunocosta', false, true, true), ('rita.lopes@globant.com', 'Rita Lopes', null, false, false, true), ('tomas.ribeiro@dataprev.com','Tomás Ribeiro', null, false, false, false), ('sofia.almeida@loop.com', 'Sofia Almeida', null, false, false, false), ('marco.chen@deepmind.com', 'Marco Chen', null, false, false, false), ('julia.santos@ifood.com', 'Julia Santos', null, false, false, false), ('pedro.nunes@microsoft.com', 'Pedro Nunes', null, false, false, false), ('carla.mendes@quintoessencial.com', 'Carla Mendes', null, false, false, false), ('diego.ferreira@stone.com', 'Diego Ferreira', null, false, false, false), ('marina.costa@olx.com', 'Marina Costa', null, false, false, false), ('lucas.oliveira@usp.br', 'Lucas Oliveira', null, false, false, false), ('admin@appe.at', 'APPE Admin', null, false, false, true), ('elena.vasquez@keynote.com', 'Dr. Elena Vasquez', null, false, false, false) on conflict (email) do nothing; -- ----------------------------------------------------------------------------- -- EVENT (single active event) -- ----------------------------------------------------------------------------- insert into public.events (id, name, start_date, end_date, location, is_active) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'APPE 2026', '2026-10-23', '2026-10-23', 'São Paulo, Brazil', true) on conflict (id) do nothing; -- ----------------------------------------------------------------------------- -- REGISTRATIONS (per event). Points scoped here. The QR token lives here -- (per event, generated by Pretix) and doubles as the auth password. -- Ana is checked in (has check-ins below). -- ----------------------------------------------------------------------------- insert into public.registrations (event_id, contact_email, type, checked_in, points, qr_token) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 'attendee', true, 40, 'CVV-ANA-4821'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'bruno.costa@acme.com', 'staff', false, 140, 'CVV-BRU-1177'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'rita.lopes@globant.com', 'staff', false, 95, 'CVV-RIT-9034'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'tomas.ribeiro@dataprev.com','attendee', false, 88, 'CVV-TOM-5566'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.almeida@loop.com', 'attendee', false, 76, 'CVV-SOF-2299'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marco.chen@deepmind.com', 'attendee', false, 70, 'CVV-MRC-7712'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'julia.santos@ifood.com', 'attendee', false, 64, 'CVV-JUL-3345'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'pedro.nunes@microsoft.com', 'attendee', false, 58, 'CVV-PED-8801'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'carla.mendes@quintoessencial.com', 'attendee', false, 52, 'CVV-CAR-6623'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'diego.ferreira@stone.com', 'attendee', false, 35, 'CVV-DIE-4458'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marina.costa@olx.com', 'attendee', false, 28, 'CVV-MNA-2210'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lucas.oliveira@usp.br', 'attendee', false, 15, 'CVV-LUC-9987'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'admin@appe.at', 'staff', false, 0, 'CVV-ADM-0001') on conflict (event_id, contact_email) do nothing; -- ----------------------------------------------------------------------------- -- SPONSORS (2 paid, 1 unpaid — unpaid is hidden from non-admins via RLS) -- ----------------------------------------------------------------------------- insert into public.sponsors (event_id, type, name, email, phone, paid, amount_eur, contact_email) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'headline', 'Nubank', 'sponsors@nubank.com', '+55 11 4000-0000', true, 50000, 'ana.silva@nubank.com'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'gold', 'Acme Corp', 'events@acme.com', '+55 11 4000-0001', true, 20000, 'bruno.costa@acme.com'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'community','Globant', 'partners@globant.com', '+55 11 4000-0002', false, 0, 'rita.lopes@globant.com') on conflict do nothing; -- ----------------------------------------------------------------------------- -- SLOTS (23 Oct). Slot 1 done, Slot 2 live (simulated clock). -- ----------------------------------------------------------------------------- insert into public.slots (id, event_id, type, name, slot_date, start_time, end_time) values (1, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'keynote', 'Slot 1', '2026-10-23', '09:00:00', '09:45:00'), (2, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 2', '2026-10-23', '10:00:00', '10:45:00'), (3, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 3', '2026-10-23', '11:30:00', '12:15:00'), (4, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lunch_break', 'Slot 4', '2026-10-23', '13:15:00', '14:00:00'), (5, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 5', '2026-10-23', '14:00:00', '14:45:00'), (6, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'close_up', 'Slot 6', '2026-10-23', '15:00:00', '15:45:00') on conflict (id) do nothing; -- ----------------------------------------------------------------------------- -- SESSIONS (18 — 3 per slot) -- ----------------------------------------------------------------------------- insert into public.sessions (id, event_id, slot_id, title, description, room, capacity) values ('10000000-0000-0000-0000-000000000001', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'Opening Keynote: The Next Decade of AI', 'A wide-angle look at where AI is heading over the next ten years — and what it means for product teams.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000002', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'Designing for Trust in AI Products', 'Practical patterns for making AI features transparent, explainable, and safe for your users.', 'Room A', 80), ('10000000-0000-0000-0000-000000000003', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'From Hackathon to Product', 'How a weekend prototype became a product with 40k users — the messy middle included.', 'Room B', 60), ('10000000-0000-0000-0000-000000000004', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'AI in Practice: Lessons from Production', 'Lessons learned shipping LLM features to production: latency, cost, evals, and the surprises.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000005', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'The Introvert''s Guide to Networking', 'Small, low-energy ways to have big conversations at any event. (Yes, this one is for you.)', 'Room A', 80), ('10000000-0000-0000-0000-000000000006', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'Building with Dataverse: Beyond the Basics', 'Go beyond the basics: relationships, security roles, and automations that actually scale.', 'Room B', 60), ('10000000-0000-0000-0000-000000000007', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Scaling Teams at 10x', 'What breaks when you grow 10x in two years, and the rituals that kept us sane.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000008', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Security by Design', 'Baking security into the product from day one instead of bolting it on at the end.', 'Room A', 80), ('10000000-0000-0000-0000-000000000009', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Data Storytelling', 'Turn dashboards into narratives your stakeholders actually remember.', 'Room B', 60), ('10000000-0000-0000-0000-000000000010', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'The Future of Work', 'Hybrid, async, and AI-augmented: where work is going and how to prepare for it.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000011', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'Prototyping with AI', 'From idea to clickable prototype in an afternoon — tools and workflows that work.', 'Room A', 80), ('10000000-0000-0000-0000-000000000012', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'Pricing SaaS in 2026', 'Usage-based, seat-based, or hybrid? What is actually working right now.', 'Room B', 60), ('10000000-0000-0000-0000-000000000013', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Community-Led Growth', 'Building a community that sells for you — case studies and playbooks.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000014', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Accessibility First', 'Why accessible products are better products, and how to start this sprint.', 'Room A', 80), ('10000000-0000-0000-0000-000000000015', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'The Art of the Demo', 'Structure, pacing, and the moments that make a demo land.', 'Room B', 60), ('10000000-0000-0000-0000-000000000016', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Closing Panel: What''s Next', 'Founders, researchers, and builders on what comes next — with audience Q&A.', 'Main Stage', 300), ('10000000-0000-0000-0000-000000000017', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Open Space: Your Ideas', 'You bring the topic, we bring the room. 45 minutes of your ideas.', 'Room A', 80), ('10000000-0000-0000-0000-000000000018', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Lightning Talks', 'Eight speakers, five minutes each. Fast, fun, and unpredictable.', 'Room B', 60) on conflict (id) do nothing; -- ----------------------------------------------------------------------------- -- SESSION SPEAKERS (M:N). Every session has >= 1 speaker. -- ----------------------------------------------------------------------------- insert into public.session_speakers (session_id, contact_email) values ('10000000-0000-0000-0000-000000000001', 'elena.vasquez@keynote.com'), ('10000000-0000-0000-0000-000000000002', 'marco.chen@deepmind.com'), ('10000000-0000-0000-0000-000000000003', 'sofia.almeida@loop.com'), ('10000000-0000-0000-0000-000000000004', 'bruno.costa@acme.com'), ('10000000-0000-0000-0000-000000000005', 'rita.lopes@globant.com'), ('10000000-0000-0000-0000-000000000006', 'tomas.ribeiro@dataprev.com'), ('10000000-0000-0000-0000-000000000007', 'julia.santos@ifood.com'), ('10000000-0000-0000-0000-000000000008', 'pedro.nunes@microsoft.com'), ('10000000-0000-0000-0000-000000000009', 'carla.mendes@quintoessencial.com'), ('10000000-0000-0000-0000-000000000010', 'elena.vasquez@keynote.com'), ('10000000-0000-0000-0000-000000000011', 'diego.ferreira@stone.com'), ('10000000-0000-0000-0000-000000000012', 'marina.costa@olx.com'), ('10000000-0000-0000-0000-000000000013', 'lucas.oliveira@usp.br'), ('10000000-0000-0000-0000-000000000014', 'carla.mendes@quintoessencial.com'), ('10000000-0000-0000-0000-000000000015', 'pedro.nunes@microsoft.com'), ('10000000-0000-0000-0000-000000000016', 'elena.vasquez@keynote.com'), ('10000000-0000-0000-0000-000000000016', 'bruno.costa@acme.com'), ('10000000-0000-0000-0000-000000000016', 'rita.lopes@globant.com'), ('10000000-0000-0000-0000-000000000017', 'ana.silva@nubank.com'), ('10000000-0000-0000-0000-000000000018', 'marco.chen@deepmind.com'), ('10000000-0000-0000-0000-000000000018', 'sofia.almeida@loop.com'), ('10000000-0000-0000-0000-000000000018', 'julia.santos@ifood.com') on conflict (session_id, contact_email) do nothing; -- s2 has a comment from Ana → AI feedback is pending evaluation. update public.sessions set ai_generated_feedback = 'Pending AI Evaluation' where id = '10000000-0000-0000-0000-000000000002'; -- ----------------------------------------------------------------------------- -- ANA'S DEMO STATE (so the app looks alive on first login) -- ----------------------------------------------------------------------------- -- Preferences: one pick per slot (matches the mockup). insert into public.preferences (event_id, contact_email, session_id, slot_id) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000002', 1), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000004', 2), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000009', 3), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000011', 4), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000013', 5), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000016', 6) on conflict (event_id, contact_email, slot_id) do nothing; -- Check-ins: Ana is checked into Slot 1 (s2) and Slot 2 (s4), by staff Bruno. insert into public.checkins (event_id, contact_email, session_id, staff_email) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000002', 'bruno.costa@acme.com'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000004', 'bruno.costa@acme.com') on conflict (event_id, contact_email, session_id) do nothing; -- Connections: accepted with Bruno & Rita; incoming from Sofia; outgoing to Julia. insert into public.connections (id, event_id, from_email, to_email, status, created_at, resolved_at) values ('e0000000-0000-0000-0000-000000000001', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 'bruno.costa@acme.com', 'accepted', now() - interval '2 hours', now() - interval '2 hours'), ('e0000000-0000-0000-0000-000000000002', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'rita.lopes@globant.com', 'ana.silva@nubank.com', 'accepted', now() - interval '90 minutes', now() - interval '90 minutes'), ('e0000000-0000-0000-0000-000000000003', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.almeida@loop.com', 'ana.silva@nubank.com', 'pending', now() - interval '15 minutes', null), ('e0000000-0000-0000-0000-000000000004', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 'julia.santos@ifood.com', 'pending', now() - interval '5 minutes', null) on conflict (id) do nothing; -- Feedback: Ana rated Slot 1 (s2). insert into public.feedback (event_id, contact_email, session_id, rating, comment) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', '10000000-0000-0000-0000-000000000002', 5, 'Great patterns, very practical. Wish it were longer!') on conflict (event_id, contact_email, session_id) do nothing; -- ----------------------------------------------------------------------------- -- LEADERBOARD (mirror of registration points, per event) -- ----------------------------------------------------------------------------- insert into public.leaderboard (event_id, contact_email, full_name, points) select r.event_id, r.contact_email, c.full_name, r.points from public.registrations r join public.contacts c on c.email = r.contact_email on conflict (event_id, contact_email) do update set full_name = excluded.full_name, points = excluded.points, updated_at = now(); -- ----------------------------------------------------------------------------- -- POINTS LOG -- Ana: a coherent breakdown (2 checkins, 2 connections, 1 feedback = 40). -- Everyone else: a single 'admin' seed entry for their starting points. -- ----------------------------------------------------------------------------- insert into public.points_log (event_id, contact_email, delta, category) values ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 10, 'checkin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 10, 'checkin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 5, 'connection'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 5, 'connection'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 10, 'feedback'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'bruno.costa@acme.com', 140, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'rita.lopes@globant.com', 95, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'tomas.ribeiro@dataprev.com', 88, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.almeida@loop.com', 76, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marco.chen@deepmind.com', 70, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'julia.santos@ifood.com', 64, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'pedro.nunes@microsoft.com', 58, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'carla.mendes@quintoessencial.com', 52, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'diego.ferreira@stone.com', 35, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marina.costa@olx.com', 28, 'admin'), ('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lucas.oliveira@usp.br', 15, 'admin');