INSERT INTO public.user_roles (user_id, role)
VALUES ('2fc54cff-ffa5-4384-8f97-b4a81ac65f15', 'staff')
ON CONFLICT (user_id, role) DO NOTHING;

INSERT INTO public.profiles (id, full_name, email)
VALUES ('2fc54cff-ffa5-4384-8f97-b4a81ac65f15', 'Studio Staff Two', 'studio.staff2@example.com')
ON CONFLICT (id) DO UPDATE SET full_name = EXCLUDED.full_name, email = EXCLUDED.email;

INSERT INTO public.user_module_access (user_id, module, can_view, can_edit)
SELECT '2fc54cff-ffa5-4384-8f97-b4a81ac65f15', m.module, m.v, m.e
FROM (VALUES
  ('dashboard', true, false),
  ('customers', true, true),
  ('invoices', true, true),
  ('bookings', true, true),
  ('payments', true, true),
  ('rooms', true, false),
  ('services', true, false),
  ('projects', false, false),
  ('studios', false, false),
  ('products', false, false),
  ('vendors', false, false),
  ('bills', false, false),
  ('expenses', false, false),
  ('cash-bank', false, false),
  ('accounting', false, false),
  ('reports', false, false),
  ('owners', false, false),
  ('profit-distribution', false, false),
  ('employees', false, false),
  ('attendance', false, false),
  ('leave', false, false),
  ('payroll', false, false),
  ('users', false, false),
  ('settings', false, false),
  ('sms', false, false),
  ('audit-log', false, false)
) AS m(module, v, e)
ON CONFLICT (user_id, module) DO UPDATE SET can_view = EXCLUDED.can_view, can_edit = EXCLUDED.can_edit;