-- ============================================================
-- PT_TAT WAITLIST WHATSAPP TEMPLATES (WATI)
-- ============================================================

-- New communication categories for waitlist flows (no-op if already added by 17_master_seed_data_entrainment.sql)
ALTER TYPE communication_category_enum ADD VALUE IF NOT EXISTS 'waitlisted';
ALTER TYPE communication_category_enum ADD VALUE IF NOT EXISTS 'waitlist_denied';
ALTER TYPE communication_category_enum ADD VALUE IF NOT EXISTS 'waitlist_release';

-- New communication template access keys for waitlist flows (no-op if already added)
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'REGISTRATION_WAITINGLIST_WATI_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'OFFLINE_REGISTRATION_WAITINGLIST_WATI_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'ONLINE_PAYMENT_DONE_BUT_WAITING_LIST_WATI_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_RELEASE_PAYMENT_WATI_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_DENY_WATI_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_PAID_DENY_WATI_SEEKER';

-- Waitlist email access keys (placement emails are new; release/deny email keys may already exist)
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'REGISTRATION_WAITINGLIST_EMAIL_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'OFFLINE_REGISTRATION_WAITINGLIST_EMAIL_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'ONLINE_PAYMENT_DONE_BUT_WAITING_LIST_EMAIL_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_RELEASE_PAYMENT_EMAIL_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_DENIED_EMAIL_SEEKER';
ALTER TYPE communication_template_access_key_enum ADD VALUE IF NOT EXISTS 'WAITLIST_DENIED_PAID_EMAIL_SEEKER';
