Datamodel: - Move qr_token from contacts to registrations (per event); new migration 20260826000000. lanyard_lookup / create_connection_request / checkin_attendee resolve via registrations + active event. - reset_qr_token -> reset_registration_qr_token (fixes ambiguous 'email' col). - upsert_contact drops the token arg; create_registration generates + syncs it. - Pretix sync writes the token to the registration (keeps it on re-sync). Registration types: - Distinct pill colors; red reserved for Staff (both apps). - Roles capitalized everywhere (Attendee/Speaker/Sponsor/Staff); 'Attendee' hidden only at the Home footer. - Reset-token button moved from Contacts to Registrations (per registration). Sessions (APPE Admin): - Slot types capitalized; material submitted/not-submitted state. - Speaker selection = multi-select search dropdown. - Fix 'a session must have a speaker' on edit (diff-based setSessionSpeakers) and the file-upload bug (speaker save no longer aborts first). APPE Admin: - Sponsors contact lookup = search field (filter + pick). Convivo App: - Other people's QR codes hidden; connection detail sheet shows public info + points. - Connect red dot recalculates immediately on accept/decline/send. - 'My picks today' = 2 rows (current + next); 'tap to change' links to Agenda. Docs updated across backend + frontend.
242 lines
26 KiB
SQL
242 lines
26 KiB
SQL
-- =============================================================================
|
|
-- 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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', '[email protected]', 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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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":"[email protected]"}', '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
|
|
('[email protected]', 'Ana Silva', 'https://linkedin.com/in/anasilva', true, true, false),
|
|
('[email protected]', 'Bruno Costa', 'https://linkedin.com/in/brunocosta', false, true, true),
|
|
('[email protected]', 'Rita Lopes', null, false, false, true),
|
|
('[email protected]','Tomás Ribeiro', null, false, false, false),
|
|
('[email protected]', 'Sofia Almeida', null, false, false, false),
|
|
('[email protected]', 'Marco Chen', null, false, false, false),
|
|
('[email protected]', 'Julia Santos', null, false, false, false),
|
|
('[email protected]', 'Pedro Nunes', null, false, false, false),
|
|
('[email protected]', 'Carla Mendes', null, false, false, false),
|
|
('[email protected]', 'Diego Ferreira', null, false, false, false),
|
|
('[email protected]', 'Marina Costa', null, false, false, false),
|
|
('[email protected]', 'Lucas Oliveira', null, false, false, false),
|
|
('[email protected]', 'APPE Admin', null, false, false, true),
|
|
('[email protected]', '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', '[email protected]', 'attendee', true, 40, 'CVV-ANA-4821'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 140, 'CVV-BRU-1177'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 95, 'CVV-RIT-9034'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]','attendee', false, 88, 'CVV-TOM-5566'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 76, 'CVV-SOF-2299'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 70, 'CVV-MRC-7712'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 64, 'CVV-JUL-3345'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 58, 'CVV-PED-8801'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 52, 'CVV-CAR-6623'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 35, 'CVV-DIE-4458'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 28, 'CVV-MNA-2210'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 15, 'CVV-LUC-9987'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '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', '[email protected]', '+55 11 4000-0000', true, 50000, '[email protected]'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'gold', 'Acme Corp', '[email protected]', '+55 11 4000-0001', true, 20000, '[email protected]'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'community','Globant', '[email protected]', '+55 11 4000-0002', false, 0, '[email protected]')
|
|
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', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000002', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000003', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000004', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000005', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000006', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000007', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000008', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000009', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000010', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000011', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000012', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000013', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000014', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000015', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000017', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000018', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000018', '[email protected]'),
|
|
('10000000-0000-0000-0000-000000000018', '[email protected]')
|
|
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', '[email protected]', '10000000-0000-0000-0000-000000000002', 1),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000004', 2),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000009', 3),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000011', 4),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000013', 5),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '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', '[email protected]', '10000000-0000-0000-0000-000000000002', '[email protected]'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000004', '[email protected]')
|
|
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', '[email protected]', '[email protected]', 'accepted', now() - interval '2 hours', now() - interval '2 hours'),
|
|
('e0000000-0000-0000-0000-000000000002', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'accepted', now() - interval '90 minutes', now() - interval '90 minutes'),
|
|
('e0000000-0000-0000-0000-000000000003', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'pending', now() - interval '15 minutes', null),
|
|
('e0000000-0000-0000-0000-000000000004', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', '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', '[email protected]', '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', '[email protected]', 10, 'checkin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 10, 'checkin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 5, 'connection'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 5, 'connection'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 10, 'feedback'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 140, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 95, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 88, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 76, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 70, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 64, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 58, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 52, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 35, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 28, 'admin'),
|
|
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 15, 'admin');
|