-- seed.sql
-- Dev seed data for MovieDice
-- Note: In dev, these UUIDs simulate Supabase Auth UIDs from signInAnonymously()

-- =============================================================================
-- Users
-- =============================================================================
INSERT INTO public.users (id, display_name, avatar_color, last_active_at, created_at) VALUES
  ('a1b2c3d4-0000-4000-8000-000000000001', 'Alice',  '#FF6B6B', now(), now()),
  ('a1b2c3d4-0000-4000-8000-000000000002', 'Bob',    '#4ECDC4', now(), now()),
  ('a1b2c3d4-0000-4000-8000-000000000003', 'Carol',  '#45B7D1', now(), now());

-- =============================================================================
-- Groups
-- =============================================================================
INSERT INTO public.groups (id, name, invite_code, created_by, created_at) VALUES
  ('b1b2c3d4-0000-4000-8000-000000000001', 'Friday Night Movies', 'WOLF-MOON',   'a1b2c3d4-0000-4000-8000-000000000001', now()),
  ('b1b2c3d4-0000-4000-8000-000000000002', 'Sci-Fi Club',         'STAR-GATE',   'a1b2c3d4-0000-4000-8000-000000000002', now());

-- =============================================================================
-- Group Members
-- =============================================================================
INSERT INTO public.group_members (group_id, user_id, role, joined_at) VALUES
  -- Friday Night Movies: Alice (admin), Bob, Carol
  ('b1b2c3d4-0000-4000-8000-000000000001', 'a1b2c3d4-0000-4000-8000-000000000001', 'admin',  now()),
  ('b1b2c3d4-0000-4000-8000-000000000001', 'a1b2c3d4-0000-4000-8000-000000000002', 'member', now()),
  ('b1b2c3d4-0000-4000-8000-000000000001', 'a1b2c3d4-0000-4000-8000-000000000003', 'member', now()),
  -- Sci-Fi Club: Bob (admin), Carol
  ('b1b2c3d4-0000-4000-8000-000000000002', 'a1b2c3d4-0000-4000-8000-000000000002', 'admin',  now()),
  ('b1b2c3d4-0000-4000-8000-000000000002', 'a1b2c3d4-0000-4000-8000-000000000003', 'member', now());

-- =============================================================================
-- Movies
-- =============================================================================
INSERT INTO public.movies (group_id, tmdb_id, title, year, poster_path, genres, trailer_url, added_by, watched, watched_at, added_at) VALUES
  -- Friday Night Movies
  ('b1b2c3d4-0000-4000-8000-000000000001', 550,    'Fight Club',              1999, '/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg', ARRAY['Drama','Thriller'],               'https://www.youtube.com/watch?v=SUXWAEX2jlg', 'a1b2c3d4-0000-4000-8000-000000000001', false, NULL, now()),
  ('b1b2c3d4-0000-4000-8000-000000000001', 680,    'Pulp Fiction',            1994, '/d5iIlFn5s0ImszYzBPb8JPIfbXD.jpg', ARRAY['Crime','Thriller'],                'https://www.youtube.com/watch?v=s7EdQ4FqbhY', 'a1b2c3d4-0000-4000-8000-000000000002', true,  now(), now()),
  ('b1b2c3d4-0000-4000-8000-000000000001', 278,    'The Shawshank Redemption', 1994, '/9cjIGRHodCM9HSovJIslGwXBOaR.jpg', ARRAY['Drama','Crime'],                   NULL,                                           'a1b2c3d4-0000-4000-8000-000000000003', false, NULL, now()),
  -- Sci-Fi Club
  ('b1b2c3d4-0000-4000-8000-000000000002', 603,    'The Matrix',              1999, '/f89U3ADr1oiB1s9GkdPOEpXUk5H.jpg', ARRAY['Action','Science Fiction'],        'https://www.youtube.com/watch?v=vKQi3bBA1y8', 'a1b2c3d4-0000-4000-8000-000000000002', false, NULL, now()),
  ('b1b2c3d4-0000-4000-8000-000000000002', 157336, 'Interstellar',            2014, '/gEU2QniE6E77NI6lCU6MxlNBvIx.jpg', ARRAY['Adventure','Drama','Science Fiction'], 'https://www.youtube.com/watch?v=zSWdZVtXT7E', 'a1b2c3d4-0000-4000-8000-000000000003', false, NULL, now());

-- =============================================================================
-- Landing Reel Posters (sample set of 5)
-- =============================================================================
INSERT INTO public.landing_reel_posters (tmdb_id, poster_path, title, refreshed_at) VALUES
  (550,    '/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg', 'Fight Club',              now()),
  (680,    '/d5iIlFn5s0ImszYzBPb8JPIfbXD.jpg', 'Pulp Fiction',            now()),
  (278,    '/9cjIGRHodCM9HSovJIslGwXBOaR.jpg', 'The Shawshank Redemption', now()),
  (603,    '/f89U3ADr1oiB1s9GkdPOEpXUk5H.jpg', 'The Matrix',              now()),
  (157336, '/gEU2QniE6E77NI6lCU6MxlNBvIx.jpg', 'Interstellar',            now());
