/**
 * Allowed email template triggers — keep aligned with backend
 * Dealer_Onboarding_Backend/src/constants/allowed-email-template-codes.ts and seed-master-emails.
 */
export const ALLOWED_EMAIL_TEMPLATE_CODES = [
  'APPLICANT_SHORTLISTED',
  'CONSTITUTIONAL_CHANGE_SUBMITTED',
  'CONSTITUTIONAL_CHANGE_UPDATE',
  'DEALER_CODE_READY',
  'GENERIC_NOTIFICATION',
  'INTERVIEW_SCHEDULED',
  'LOA_ISSUED',
  'LOI_ISSUED',
  'NON_OPPORTUNITY',
  'ONBOARDING_STATUS_UPDATE',
  'OPPORTUNITY',
  'QUESTIONNAIRE_REMINDER',
  'QUESTIONNAIRE_SUBMITTED',
  'RELOCATION_RECEIVED',
  'RELOCATION_SUBMITTED',
  'RELOCATION_UPDATE',
  'RESIGNATION_APPROVED',
  'RESIGNATION_RECEIVED',
  'RESIGNATION_SUBMITTED',
  'RESIGNATION_UPDATE',
  'SLA_BREACH_WARNING',
  'TERMINATION_SCN_ISSUED',
  'TERMINATION_UPDATE',
  'USER_ASSIGNED',
  'WORKNOTE_NOTIFICATION'
] as const;

const ALLOWED_SET = new Set<string>(ALLOWED_EMAIL_TEMPLATE_CODES);

export function isAllowedEmailTemplateCode(code: string): boolean {
  return ALLOWED_SET.has(code.trim().toUpperCase());
}
