-- ============================================================
-- SIMULAÇÃO AgenciaPsi — gerado por npm run simulate
-- Data: 11/03/2026, 13:48:50
-- ============================================================

-- Desabilita triggers para permitir inserts de simulação
SET session_replication_role = replica;

BEGIN;

-- ─── 1. Pacientes ───────────────────────────────────────────────────────────

INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('7910bd11-fdd3-4719-8d31-7352e33b0871', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Isabela Carvalho', 'isabela.carvalho82@hotmail.com', '(51) 93447-7268', '36694226368', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('c23586a1-7f89-437b-9b15-0894c6f4e766', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Ana Souza', 'ana.souza58@gmail.com', '(11) 91789-2404', '76394836115', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('56410d42-c489-47ef-a324-6177d0d54b6c', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Helena Santos', 'helena.santos3@gmail.com', '(11) 92531-4591', '98615983257', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('d7faec09-1ac0-47c6-bb75-ac3872188c66', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Daniel Carvalho', 'daniel.carvalho86@outlook.com', '(11) 95077-3606', '58936177264', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('7d407456-ff3b-44ff-b8a6-f555987206a1', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Mariana Rocha', 'mariana.rocha79@gmail.com', '(21) 92159-7795', '14818998161', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('86fcfccb-6230-42fa-a111-987d707fd4be', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Fernanda Silva', 'fernanda.silva87@hotmail.com', '(21) 97345-9576', '15668565266', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('f408f949-c5cd-46c1-aa98-446eb378c653', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Juliana Almeida', 'juliana.almeida64@outlook.com', '(71) 95914-2804', '54146327124', 'clinic', 'Ativo');
INSERT INTO patients (id, tenant_id, owner_id, responsible_member_id, nome_completo, email_principal, telefone, cpf, patient_scope, status)
  VALUES ('82b39d67-aac3-4117-b740-cdbec1d61ffc', 'bbbbbbbb-0002-0002-0002-000000000002', 'aaaaaaaa-0002-0002-0002-000000000002',
    (SELECT id FROM tenant_members WHERE user_id = 'aaaaaaaa-0002-0002-0002-000000000002' AND tenant_id = 'bbbbbbbb-0002-0002-0002-000000000002' LIMIT 1),
    'Karen Nunes', 'karen.nunes25@gmail.com', '(31) 90712-9951', '78969125499', 'clinic', 'Ativo');

-- ─── 2. Configurações de agenda ─────────────────────────────────────────────

INSERT INTO agenda_configuracoes (owner_id, tenant_id, session_duration_min, session_break_min, pausas_semanais, online_ativo, setup_clinica_concluido)
  VALUES ('aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002',
    50, 10, '[{"weekday":1,"start":"12:00","end":"13:00","label":"Almoço"},{"weekday":2,"start":"12:00","end":"13:00","label":"Almoço"},{"weekday":3,"start":"12:00","end":"13:00","label":"Almoço"},{"weekday":4,"start":"12:00","end":"13:00","label":"Almoço"},{"weekday":5,"start":"12:00","end":"13:00","label":"Almoço"}]'::jsonb, true, true)
  ON CONFLICT (owner_id) DO NOTHING;

-- ─── 3. Regras semanais ─────────────────────────────────────────────────────

INSERT INTO agenda_regras_semanais (id, owner_id, tenant_id, dia_semana, hora_inicio, hora_fim, ativo)
  VALUES ('815e4214-e3c6-4934-9a85-458d03ccb801', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 1, '08:00', '18:00', true);
INSERT INTO agenda_regras_semanais (id, owner_id, tenant_id, dia_semana, hora_inicio, hora_fim, ativo)
  VALUES ('9ab48292-3170-475f-b66b-7adf50477ae5', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 2, '08:00', '18:00', true);
INSERT INTO agenda_regras_semanais (id, owner_id, tenant_id, dia_semana, hora_inicio, hora_fim, ativo)
  VALUES ('b9d6ec37-b290-4cd1-b82a-7e13c2cecdff', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 3, '08:00', '18:00', true);
INSERT INTO agenda_regras_semanais (id, owner_id, tenant_id, dia_semana, hora_inicio, hora_fim, ativo)
  VALUES ('a9d2c596-8e9c-4f7b-b3d0-7078080f63be', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 4, '08:00', '18:00', true);
INSERT INTO agenda_regras_semanais (id, owner_id, tenant_id, dia_semana, hora_inicio, hora_fim, ativo)
  VALUES ('1ad0afcd-e59d-41d4-9e07-c53ec210e23e', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 5, '08:00', '18:00', true);

-- ─── 4. Eventos avulsos (passado) ──────────────────────────────────────────

INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, titulo)
  VALUES ('19a93b33-68be-4916-9069-48587ba5b11f', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'faltou', '2026-02-23T13:00:00', '2026-02-23T13:50:00', 'online', 'Sessão avulsa');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, titulo)
  VALUES ('30d76055-1a5d-409a-b716-5e27aa109b0f', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'sessao', 'agendado', '2026-02-16T13:00:00', '2026-02-16T13:50:00', 'presencial', 'Sessão avulsa');

-- ─── 5. Séries de recorrência ───────────────────────────────────────────────

INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('f94e562a-dee3-4b6c-9a63-62f54173f7e5', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'weekly', ARRAY[1]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '09:00', '09:50', 'online');
INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('84614add-030b-4110-8542-fbb2af844648', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'weekly', ARRAY[2]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '10:00', '10:50', 'presencial');
INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('9e493b9e-06a5-4adc-b5df-3124bbf56869', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'weekly', ARRAY[4]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '11:00', '11:50', 'presencial');
INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('f4d992a3-8ca6-4930-b39c-1f9454bc4df1', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'biweekly', ARRAY[1]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '14:00', '14:50', 'online');
INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('b5c62afc-75c2-4dd3-a35a-037d7e1d4609', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'custom_weekdays', ARRAY[1,3]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '15:00', '15:50', 'online');
INSERT INTO recurrence_rules (id, owner_id, tenant_id, patient_id, type, weekdays, interval, start_date, end_date, status, start_time, end_time, modalidade)
  VALUES ('6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '86fcfccb-6230-42fa-a111-987d707fd4be',
    'weekly', ARRAY[3]::smallint[], 1, '2026-02-09', '2026-06-09',
    'ativo', '16:00', '16:50', 'online');

-- ─── 6. Exceções de recorrência ────────────────────────────────────────────

INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('036ec898-d994-4892-9f6d-d0367d941e7f', '9e493b9e-06a5-4adc-b5df-3124bbf56869', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-19', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('153bbd3a-d6f8-4199-bd1b-f744ad400e50', '9e493b9e-06a5-4adc-b5df-3124bbf56869', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-03-05', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('8e4af6a8-beba-4cae-86cf-be8bbc02f8a9', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-23', 'reschedule_session', '2026-02-27');
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('a568ceac-0be6-4ec6-b4c8-1d666ff27fd5', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-09', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('37a01ea8-65d1-4810-b8d6-869100251f47', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-16', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('50c4b11e-a4ca-4f1f-ac09-05da87db3cd9', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-18', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('3721079d-4ee3-46e5-a873-a33fce0e8080', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-25', 'patient_missed', NULL);
INSERT INTO recurrence_exceptions (id, recurrence_id, tenant_id, original_date, type, new_date)
  VALUES ('0e99db44-019d-40b5-a67e-cd55b4a096c2', '6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', 'bbbbbbbb-0002-0002-0002-000000000002', '2026-02-25', 'reschedule_session', '2026-02-26');

-- ─── 7. Sessões reais (passado — realizado/faltou) ────────────────────────

INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('aa3d5832-a462-4380-8d4c-390aff127952', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'realizado', '2026-02-09T09:00:00', '2026-02-09T09:50:00', 'online', 'f94e562a-dee3-4b6c-9a63-62f54173f7e5', '2026-02-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('32fc2417-ab45-4091-be6d-8b66b9231fc7', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'realizado', '2026-02-16T09:00:00', '2026-02-16T09:50:00', 'online', 'f94e562a-dee3-4b6c-9a63-62f54173f7e5', '2026-02-16');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('42bd5e8b-4bc3-4fa2-abad-5cc8c520d44d', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'realizado', '2026-02-23T09:00:00', '2026-02-23T09:50:00', 'online', 'f94e562a-dee3-4b6c-9a63-62f54173f7e5', '2026-02-23');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('7f180aac-b117-4237-a725-18333b3e6791', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'realizado', '2026-03-02T09:00:00', '2026-03-02T09:50:00', 'online', 'f94e562a-dee3-4b6c-9a63-62f54173f7e5', '2026-03-02');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('3122bb93-3cea-4cfc-a3a3-ce66be7ccb0d', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7910bd11-fdd3-4719-8d31-7352e33b0871',
    'sessao', 'realizado', '2026-03-09T09:00:00', '2026-03-09T09:50:00', 'online', 'f94e562a-dee3-4b6c-9a63-62f54173f7e5', '2026-03-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('bb8536db-35c5-47f4-88d6-c8bab4bfad8e', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'sessao', 'realizado', '2026-02-10T10:00:00', '2026-02-10T10:50:00', 'presencial', '84614add-030b-4110-8542-fbb2af844648', '2026-02-10');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('e10632b8-2a40-4fb6-a318-7e95db39b216', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'sessao', 'realizado', '2026-02-17T10:00:00', '2026-02-17T10:50:00', 'presencial', '84614add-030b-4110-8542-fbb2af844648', '2026-02-17');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('c8d815ea-9445-4c33-8777-9a4d0af7977e', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'sessao', 'realizado', '2026-02-24T10:00:00', '2026-02-24T10:50:00', 'presencial', '84614add-030b-4110-8542-fbb2af844648', '2026-02-24');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('0041d195-5203-4e83-9b18-c60b5ececa40', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'sessao', 'realizado', '2026-03-03T10:00:00', '2026-03-03T10:50:00', 'presencial', '84614add-030b-4110-8542-fbb2af844648', '2026-03-03');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('25672cbd-939d-4f64-bf3a-807cb206b0aa', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'c23586a1-7f89-437b-9b15-0894c6f4e766',
    'sessao', 'realizado', '2026-03-10T10:00:00', '2026-03-10T10:50:00', 'presencial', '84614add-030b-4110-8542-fbb2af844648', '2026-03-10');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('94eeb1cb-2bc3-49c9-8394-1cda9ff51638', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'sessao', 'realizado', '2026-02-12T11:00:00', '2026-02-12T11:50:00', 'presencial', '9e493b9e-06a5-4adc-b5df-3124bbf56869', '2026-02-12');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('a008de79-810b-4b6f-ad1f-313053955c09', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'sessao', 'realizado', '2026-02-19T11:00:00', '2026-02-19T11:50:00', 'presencial', '9e493b9e-06a5-4adc-b5df-3124bbf56869', '2026-02-19');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('db00a8cc-44a8-4c23-a577-0eb75e750f18', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'sessao', 'realizado', '2026-02-26T11:00:00', '2026-02-26T11:50:00', 'presencial', '9e493b9e-06a5-4adc-b5df-3124bbf56869', '2026-02-26');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('12efaf45-57a9-4c91-8020-d3bf6fbca1be', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '56410d42-c489-47ef-a324-6177d0d54b6c',
    'sessao', 'realizado', '2026-03-05T11:00:00', '2026-03-05T11:50:00', 'presencial', '9e493b9e-06a5-4adc-b5df-3124bbf56869', '2026-03-05');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('0a5fd25c-d8c6-4f07-b88a-49db13881e09', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'sessao', 'realizado', '2026-02-09T14:00:00', '2026-02-09T14:50:00', 'online', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', '2026-02-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('64d0e09a-dd16-46cb-90dd-2973bae26327', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'sessao', 'faltou', '2026-02-16T14:00:00', '2026-02-16T14:50:00', 'online', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', '2026-02-16');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('49b90ec6-3136-446d-a6f0-c0a3ae06f4f8', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'sessao', 'realizado', '2026-02-23T14:00:00', '2026-02-23T14:50:00', 'online', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', '2026-02-23');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('f981e635-d536-409c-b6c6-ff6d9276394a', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'sessao', 'realizado', '2026-03-02T14:00:00', '2026-03-02T14:50:00', 'online', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', '2026-03-02');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('c609091f-0414-4bb6-99a5-0db40cf18148', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'd7faec09-1ac0-47c6-bb75-ac3872188c66',
    'sessao', 'realizado', '2026-03-09T14:00:00', '2026-03-09T14:50:00', 'online', 'f4d992a3-8ca6-4930-b39c-1f9454bc4df1', '2026-03-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('7cdc08f3-8ae0-42f9-a324-4f751782ff2a', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-02-09T15:00:00', '2026-02-09T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('90c2a326-d173-4ad2-b716-86db878d035e', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-02-11T15:00:00', '2026-02-11T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-11');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('1bd0b8ff-e058-4fdc-905e-87f958a9b9cd', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-02-16T15:00:00', '2026-02-16T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-16');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('049aac05-cfc2-4107-8e07-2178174a4c91', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'faltou', '2026-02-18T15:00:00', '2026-02-18T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-18');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('f045c147-758e-4cc8-b4fd-633488e263e2', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-02-23T15:00:00', '2026-02-23T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-23');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('b097f0ac-67fd-4c6e-8cab-6417772a24ff', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-02-25T15:00:00', '2026-02-25T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-02-25');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('c0256c42-c125-4d17-ac8d-e210b50ca56f', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-03-02T15:00:00', '2026-03-02T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-03-02');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('d43bd403-ac9a-4e3d-a00d-91b2fdaa8b84', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'realizado', '2026-03-04T15:00:00', '2026-03-04T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-03-04');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('8515afad-90a0-4a7f-936a-9b6977759bf6', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '7d407456-ff3b-44ff-b8a6-f555987206a1',
    'sessao', 'faltou', '2026-03-09T15:00:00', '2026-03-09T15:50:00', 'online', 'b5c62afc-75c2-4dd3-a35a-037d7e1d4609', '2026-03-09');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('a8f0bdb6-9502-49e5-8c2b-a00822113847', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '86fcfccb-6230-42fa-a111-987d707fd4be',
    'sessao', 'realizado', '2026-02-11T16:00:00', '2026-02-11T16:50:00', 'online', '6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', '2026-02-11');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('041a0295-4986-43ba-9ef1-49eb962a64e1', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '86fcfccb-6230-42fa-a111-987d707fd4be',
    'sessao', 'faltou', '2026-02-18T16:00:00', '2026-02-18T16:50:00', 'online', '6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', '2026-02-18');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('074d85af-d24e-4de6-8c90-0073f1411a0b', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '86fcfccb-6230-42fa-a111-987d707fd4be',
    'sessao', 'faltou', '2026-02-25T16:00:00', '2026-02-25T16:50:00', 'online', '6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', '2026-02-25');
INSERT INTO agenda_eventos (id, owner_id, tenant_id, patient_id, tipo, status, inicio_em, fim_em, modalidade, recurrence_id, recurrence_date)
  VALUES ('a07e5625-6c44-4c05-9607-e60cea9ab226', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', '86fcfccb-6230-42fa-a111-987d707fd4be',
    'sessao', 'realizado', '2026-03-04T16:00:00', '2026-03-04T16:50:00', 'online', '6cd1c566-eee0-4bf4-b68b-c5d9ad24714c', '2026-03-04');

-- ─── 8. Agendador Público — solicitações pendentes ─────────────────────────

INSERT INTO agendador_solicitacoes (id, owner_id, tenant_id, paciente_nome, paciente_sobrenome, paciente_email, paciente_celular, tipo, modalidade, data_solicitada, hora_solicitada, status)
  VALUES ('891b1bd8-05a6-4aac-8346-8aa99d889ebf', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'Marcos', 'Costa', 'marcos.costa12@yahoo.com.br', '(51) 91799-2922',
    'primeira', 'presencial', '2026-03-24', '09:00', 'recusado');
INSERT INTO agendador_solicitacoes (id, owner_id, tenant_id, paciente_nome, paciente_sobrenome, paciente_email, paciente_celular, tipo, modalidade, data_solicitada, hora_solicitada, status)
  VALUES ('e80d1e72-dbdd-48c3-be6f-117d2f5f4267', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'Carla', 'Carvalho', 'carla.carvalho82@hotmail.com', '(91) 92340-8703',
    'reagendar', 'presencial', '2026-03-23', '09:00', 'pendente');
INSERT INTO agendador_solicitacoes (id, owner_id, tenant_id, paciente_nome, paciente_sobrenome, paciente_email, paciente_celular, tipo, modalidade, data_solicitada, hora_solicitada, status)
  VALUES ('db89a451-74ab-4b43-ad16-91b69172fff5', 'aaaaaaaa-0002-0002-0002-000000000002', 'bbbbbbbb-0002-0002-0002-000000000002', 'Sérgio', 'Martins', 'sergio.martins82@gmail.com', '(11) 93735-0761',
    'reagendar', 'presencial', '2026-03-16', '08:00', 'pendente');

COMMIT;

-- Restaura comportamento normal dos triggers
SET session_replication_role = DEFAULT;

-- ─── Fim do seed ────────────────────────────────────────────────────────────