// User Roles
export const ROLES = {
  DD: 'DD',
  DD_ZM: 'DD-ZM',
  RBM: 'RBM',
  ZBH: 'ZBH',
  DD_LEAD: 'DD Lead',
  DD_HEAD: 'DD Head',
  NBH: 'NBH',
  DD_ADMIN: 'DD Admin',
  LEGAL_ADMIN: 'Legal Admin',
  SUPER_ADMIN: 'Super Admin',
  DD_AM: 'DD AM',
  ASM: 'ASM',
  FINANCE: 'Finance',
  DEALER: 'Dealer',
  ARCHITECTURE: 'ARCHITECTURE',
  FDD: 'FDD',
  CCO: 'CCO',
  CEO: 'CEO',
  SPARES_MANAGER: 'Spares Manager',
  SERVICE_MANAGER: 'Service Manager',
  ACCOUNTS_MANAGER: 'Accounts Manager',
  SALES_MANAGER: 'Sales Manager',
  WARRANTY_MANAGER: 'Warranty Manager',
  MARKETING_MANAGER: 'Marketing Manager',
  HR_MANAGER: 'HR Manager',
  IT_MANAGER: 'IT Manager',
  LOGISTICS_MANAGER: 'Logistics Manager',
  QUALITY_MANAGER: 'Quality Manager',
  APPAREL_MANAGER: 'Apparel Manager',
  DMS_MANAGER: 'DMS Manager'
} as const;

// Regions
export const REGIONS = {
  EAST: 'East',
  WEST: 'West',
  NORTH: 'North',
  SOUTH: 'South',
  CENTRAL: 'Central'
} as const;

// Application Stages
export const APPLICATION_STAGES = {
  DD: 'DD',
  DD_ZM: 'DD-ZM',
  RBM: 'RBM',
  ZBH: 'ZBH',
  DD_LEAD: 'DD Lead',
  DD_HEAD: 'DD Head',
  NBH: 'NBH',
  LEGAL: 'Legal',
  ARCHITECTURE: 'Architecture Team',
  FINANCE: 'Finance',
  FDD: 'FDD',
  LOI: 'LOI',
  LOA: 'LOA',
  EOR: 'EOR',
  ARCHITECTURE_WORK: 'Architecture Work',
  STATUTORY_WORK: 'Statutory Work',
  LEVEL_1_APPROVED: 'Level 1 Approved',
  LEVEL_2_APPROVED: 'Level 2 Approved',
  LEVEL_2_RECOMMENDED: 'Level 2 Recommended',
  LEVEL_3_APPROVED: 'Level 3 Approved',
  APPROVED: 'Approved',
  REJECTED: 'Rejected'
} as const;

// Application Status
export const APPLICATION_STATUS = {
  PENDING: 'Pending',
  SUBMITTED: 'Submitted',
  QUESTIONNAIRE_PENDING: 'Questionnaire Pending',
  QUESTIONNAIRE_COMPLETED: 'Questionnaire Completed',
  SHORTLISTED: 'Shortlisted',
  IN_REVIEW: 'In Review',
  APPROVED: 'Approved',
  REJECTED: 'Rejected',
  LEVEL_1_PENDING: 'Level 1 Interview Pending',
  LEVEL_1_APPROVED: 'Level 1 Approved',
  LEVEL_2_PENDING: 'Level 2 Interview Pending',
  LEVEL_2_APPROVED: 'Level 2 Approved',
  LEVEL_2_RECOMMENDED: 'Level 2 Recommended',
  LEVEL_3_PENDING: 'Level 3 Interview Pending',
  LEVEL_3_APPROVED: 'Level 3 Approved',
  FDD_VERIFICATION: 'FDD Verification',
  SECURITY_DETAILS: 'Security Deposit',
  PAYMENT_PENDING: 'Payment Pending',
  LOI_IN_PROGRESS: 'LOI In Progress',
  LOI_ISSUED: 'LOI Issued',
  DEALER_CODE_GENERATION: 'Dealer Code Generation',
  ARCHITECTURE_TEAM_ASSIGNED: 'Architecture Team Assigned',
  ARCHITECTURE_DOCUMENT_UPLOAD: 'Architecture Document Upload',
  ARCHITECTURE_TEAM_COMPLETION: 'Architecture Team Completion',
  STATUTORY_GST: 'Statutory GST',
  STATUTORY_PAN: 'Statutory PAN',
  STATUTORY_NODAL: 'Statutory Nodal',
  STATUTORY_CHECK: 'Statutory Check',
  STATUTORY_PARTNERSHIP: 'Statutory Partnership',
  STATUTORY_FIRM_REG: 'Statutory Firm Reg',
  STATUTORY_VIRTUAL_CODE: 'Statutory Virtual Code',
  STATUTORY_DOMAIN: 'Statutory Domain',
  STATUTORY_MSD: 'Statutory MSD',
  STATUTORY_LOI_ACK: 'Statutory LOI Ack',
  EOR_IN_PROGRESS: 'EOR In Progress',
  LOA_PENDING: 'LOA Pending',
  ARCHITECTURE_WORK: 'Architecture Work',
  STATUTORY_WORK: 'Statutory Work',
  LOA_ISSUED: 'LOA Issued',
  LOA_REJECTED: 'LOA Rejected',
  EOR_COMPLETE: 'EOR Complete',
  INAUGURATION: 'Inauguration',
  ONBOARDED: 'Onboarded',
  DISQUALIFIED: 'Disqualified',
  LOI_REJECTED: 'LOI Rejected',
  RETURNED_TO_FDD: 'Returned to FDD'
} as const;

/**
 * Maps `Application.overallStatus` → `Application.currentStage` (Postgres enum = APPLICATION_STAGES only).
 * Progress milestones like "Shortlist" / "LOI Issue" live in ApplicationProgress, not on this column.
 */
export const OVERALL_STATUS_TO_DB_CURRENT_STAGE: Record<
    string,
    (typeof APPLICATION_STAGES)[keyof typeof APPLICATION_STAGES]
> = {
    [APPLICATION_STATUS.PENDING]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.SUBMITTED]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.QUESTIONNAIRE_PENDING]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.QUESTIONNAIRE_COMPLETED]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.SHORTLISTED]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.IN_REVIEW]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.APPROVED]: APPLICATION_STAGES.APPROVED,
    [APPLICATION_STATUS.REJECTED]: APPLICATION_STAGES.REJECTED,
    [APPLICATION_STATUS.LEVEL_1_PENDING]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.LEVEL_1_APPROVED]: APPLICATION_STAGES.LEVEL_1_APPROVED,
    [APPLICATION_STATUS.LEVEL_2_PENDING]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.LEVEL_2_APPROVED]: APPLICATION_STAGES.LEVEL_2_APPROVED,
    [APPLICATION_STATUS.LEVEL_2_RECOMMENDED]: APPLICATION_STAGES.LEVEL_2_RECOMMENDED,
    [APPLICATION_STATUS.LEVEL_3_PENDING]: APPLICATION_STAGES.DD,
    [APPLICATION_STATUS.LEVEL_3_APPROVED]: APPLICATION_STAGES.LEVEL_3_APPROVED,
    [APPLICATION_STATUS.FDD_VERIFICATION]: APPLICATION_STAGES.FDD,
    [APPLICATION_STATUS.SECURITY_DETAILS]: APPLICATION_STAGES.LOI,
    /** Legacy `overallStatus` before rename; remove after DB migrated */
    'Security Details': APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.PAYMENT_PENDING]: APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.LOI_IN_PROGRESS]: APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.LOI_ISSUED]: APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.DEALER_CODE_GENERATION]: APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.ARCHITECTURE_TEAM_ASSIGNED]: APPLICATION_STAGES.ARCHITECTURE_WORK,
    [APPLICATION_STATUS.ARCHITECTURE_DOCUMENT_UPLOAD]: APPLICATION_STAGES.ARCHITECTURE_WORK,
    [APPLICATION_STATUS.ARCHITECTURE_TEAM_COMPLETION]: APPLICATION_STAGES.ARCHITECTURE_WORK,
    [APPLICATION_STATUS.STATUTORY_GST]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_PAN]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_NODAL]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_CHECK]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_PARTNERSHIP]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_FIRM_REG]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_VIRTUAL_CODE]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_DOMAIN]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_MSD]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.STATUTORY_LOI_ACK]: APPLICATION_STAGES.LOI,
    [APPLICATION_STATUS.EOR_IN_PROGRESS]: APPLICATION_STAGES.EOR,
    [APPLICATION_STATUS.LOA_PENDING]: APPLICATION_STAGES.LOA,
    [APPLICATION_STATUS.ARCHITECTURE_WORK]: APPLICATION_STAGES.ARCHITECTURE_WORK,
    [APPLICATION_STATUS.STATUTORY_WORK]: APPLICATION_STAGES.STATUTORY_WORK,
    [APPLICATION_STATUS.LOA_ISSUED]: APPLICATION_STAGES.LOA,
    [APPLICATION_STATUS.LOA_REJECTED]: APPLICATION_STAGES.LOA,
    [APPLICATION_STATUS.EOR_COMPLETE]: APPLICATION_STAGES.EOR,
    [APPLICATION_STATUS.INAUGURATION]: APPLICATION_STAGES.APPROVED,
    [APPLICATION_STATUS.ONBOARDED]: APPLICATION_STAGES.APPROVED,
    [APPLICATION_STATUS.DISQUALIFIED]: APPLICATION_STAGES.REJECTED,
    [APPLICATION_STATUS.LOI_REJECTED]: APPLICATION_STAGES.REJECTED,
    [APPLICATION_STATUS.RETURNED_TO_FDD]: APPLICATION_STAGES.FDD,
};

// Termination Stages
export const TERMINATION_STAGES = {
  SUBMITTED: 'Submitted',
  RBM_REVIEW: 'RBM + DD-ZM Review',
  ZBH_REVIEW: 'ZBH Review',
  DD_LEAD_REVIEW: 'DD Lead Review',
  LEGAL_VERIFICATION: 'Legal Verification',
  DD_HEAD_REVIEW: 'DD Head Review',
  NBH_EVALUATION: 'NBH Evaluation',
  SCN_ISSUED: 'Show Cause Notice (SCN)',
  PERSONAL_HEARING: 'Evaluation of Dealer SCN Response',
  NBH_FINAL_APPROVAL: 'NBH Final Approval',
  CCO_APPROVAL: 'CCO Approval',
  CEO_APPROVAL: 'CEO Final Approval',
  LEGAL_LETTER: 'Legal - Termination Letter',
  TERMINATED: 'Terminated',
  REJECTED: 'Rejected'
} as const;

// Resignation Stages
export const RESIGNATION_STAGES = {
  ASM: 'ASM',
  RBM: 'RBM + DD-ZM Review',
  ZBH: 'ZBH',
  DD_LEAD: 'DD Lead',
  DD_HEAD: 'DD Head',
  NBH: 'NBH',
  DD_ADMIN: 'DD Admin',
  /** Post DD Admin — workflow paused until an authorized user runs Push to F&F (no automatic F&F). */
  AWAITING_FNF: 'Awaiting F&F',
  LEGAL: 'Legal',
  SPARES_CLEARANCE: 'Spares Clearance',
  SERVICE_CLEARANCE: 'Service Clearance',
  ACCOUNTS_CLEARANCE: 'Accounts Clearance',
  FINANCE: 'Finance',
  FNF_INITIATED: 'F&F Initiated',
  COMPLETED: 'Completed',
  REJECTED: 'Rejected'
} as const;

// Resignation Types
export const RESIGNATION_TYPES = {
  VOLUNTARY: 'Voluntary',
  RETIREMENT: 'Retirement',
  HEALTH_ISSUES: 'Health Issues',
  BUSINESS_CLOSURE: 'Business Closure',
  OTHER: 'Other'
} as const;

// Constitutional Change Types (Aligned with frontend and SRS scenarios)
export const CONSTITUTIONAL_CHANGE_TYPES = {
  PROPRIETORSHIP: 'Proprietorship',
  PARTNERSHIP: 'Partnership',
  LLP: 'LLP',
  PRIVATE_LIMITED: 'Private Limited'
} as const;

/** Legal-structure targets shown in dealer / internal forms; `value` must match DB ENUM on `changeType`. */
export const CONSTITUTIONAL_STRUCTURE_TARGET_OPTIONS = [
  { value: CONSTITUTIONAL_CHANGE_TYPES.PROPRIETORSHIP, label: 'Proprietorship' },
  { value: CONSTITUTIONAL_CHANGE_TYPES.PARTNERSHIP, label: 'Partnership' },
  { value: CONSTITUTIONAL_CHANGE_TYPES.LLP, label: 'LLP (Limited Liability Partnership)' },
  { value: CONSTITUTIONAL_CHANGE_TYPES.PRIVATE_LIMITED, label: 'Private Limited' }
] as const;

// Constitutional Change Stages (Aligned with SRS v2.0)
export const CONSTITUTIONAL_STAGES = {
  SUBMITTED: 'Submitted',
  ASM_REVIEW: 'ASM Review',
  ZM_RBM_REVIEW: 'ZM/RBM Review',
  ZBH_REVIEW: 'ZBH Review',
  LEAD_REVIEW: 'DD Lead Review',
  HEAD_REVIEW: 'DD Head Review',
  NBH_APPROVAL: 'NBH Approval',
  LEGAL_REVIEW: 'Legal Review',
  COMPLETED: 'Completed',
  REJECTED: 'Rejected',
  /** SRS §12.2.3 — administrative cancellation (distinct from rejection of proposal). */
  REVOKED: 'Revoked'
} as const;

// Relocation Types
export const RELOCATION_TYPES = {
  WITHIN_CITY: 'Within City',
  INTERCITY: 'Intercity',
  INTERSTATE: 'Interstate'
} as const;

// Relocation Stages
export const RELOCATION_STAGES = {
  ASM_REVIEW: 'ASM Review',
  RBM_REVIEW: 'RBM Review',
  DD_ZM_REVIEW: 'DD ZM Review',
  ZBH_REVIEW: 'ZBH Review',
  DD_LEAD_REVIEW: 'DD Lead Review',
  NBH_APPROVAL: 'NBH Approval',
  LEGAL_CLEARANCE: 'Legal Clearance',
  COMPLETED: 'Completed',
  REJECTED: 'Rejected'
} as const;

// Outlet Types
export const OUTLET_TYPES = {
  DEALERSHIP: 'Dealership',
  STUDIO: 'Studio'
} as const;

// Outlet Status
export const OUTLET_STATUS = {
  ACTIVE: 'Active',
  PENDING_RESIGNATION: 'Pending Resignation',
  CLOSED: 'Closed'
} as const;

// Business Types
export const BUSINESS_TYPES = {
  DEALERSHIP: 'Dealership',
  STUDIO: 'Studio'
} as const;

// Payment Types
export const PAYMENT_TYPES = {
  SECURITY_DEPOSIT: 'Security Deposit',
  LICENSE_FEE: 'License Fee',
  SETUP_FEE: 'Setup Fee',
  OTHER: 'Other'
} as const;

// Payment Status
export const PAYMENT_STATUS = {
  PENDING: 'Pending',
  PAID: 'Paid',
  OVERDUE: 'Overdue',
  WAIVED: 'Waived'
} as const;

// F&F Status
export const FNF_STATUS = {
  INITIATED: 'Initiated',
  DD_CLEARANCE: 'DD Clearance',
  LEGAL_CLEARANCE: 'Legal Clearance',
  FINANCE_APPROVAL: 'Finance Approval',
  COMPLETED: 'Completed'
} as const;

// F&F Departments (Full list of 16 functional units as per Royal Enfield standards)
export const FNF_DEPARTMENTS = [
    'Warranty Department',
    'Accessories Department',
    'Sales Department',
    'RTO Department',
    'Service Department',
    'Parts Department',
    'Finance Department',
    'Insurance Department',
    'Inventory Department',
    'Marketing Department',
    'HR Department',
    'IT Department',
    'Legal Department',
    'Quality Department',
    'Logistics Department',
    'Customer Relations Department'
];

// Audit Actions
export const AUDIT_ACTIONS = {
  // General CRUD
  CREATED: 'CREATED',
  UPDATED: 'UPDATED',
  APPROVED: 'APPROVED',
  REJECTED: 'REJECTED',
  DELETED: 'DELETED',

  // Auth & User Actions
  LOGIN: 'LOGIN',
  LOGOUT: 'LOGOUT',
  REGISTERED: 'REGISTERED',
  PASSWORD_CHANGED: 'PASSWORD_CHANGED',
  PROFILE_UPDATED: 'PROFILE_UPDATED',

  // Application Lifecycle
  STAGE_CHANGED: 'STAGE_CHANGED',
  SHORTLISTED: 'SHORTLISTED',
  DISQUALIFIED: 'DISQUALIFIED',
  QUESTIONNAIRE_SUBMITTED: 'QUESTIONNAIRE_SUBMITTED',
  QUESTIONNAIRE_LINK_SENT: 'QUESTIONNAIRE_LINK_SENT',

  // Documents & Collaboration
  DOCUMENT_UPLOADED: 'DOCUMENT_UPLOADED',
  DOCUMENT_VERIFIED: 'DOCUMENT_VERIFIED',
  DOCUMENT_REJECTED: 'DOCUMENT_REJECTED',
  WORKNOTE_ADDED: 'WORKNOTE_ADDED',
  ATTACHMENT_UPLOADED: 'ATTACHMENT_UPLOADED',
  PARTICIPANT_ADDED: 'PARTICIPANT_ADDED',
  PARTICIPANT_REMOVED: 'PARTICIPANT_REMOVED',

  // Interviews & Assessment
  INTERVIEW_SCHEDULED: 'INTERVIEW_SCHEDULED',
  INTERVIEW_UPDATED: 'INTERVIEW_UPDATED',
  INTERVIEW_COMPLETED: 'INTERVIEW_COMPLETED',
  KT_MATRIX_SUBMITTED: 'KT_MATRIX_SUBMITTED',
  FEEDBACK_SUBMITTED: 'FEEDBACK_SUBMITTED',
  RECOMMENDATION_UPDATED: 'RECOMMENDATION_UPDATED',
  DECISION_MADE: 'DECISION_MADE',

  // FDD
  FDD_ASSIGNED: 'FDD_ASSIGNED',
  FDD_REPORT_UPLOADED: 'FDD_REPORT_UPLOADED',
  FDD_FLAGGED_NON_RESPONSIVE: 'FDD_FLAGGED_NON_RESPONSIVE',

  // LOI & LOA
  LOI_REQUESTED: 'LOI_REQUESTED',
  LOI_APPROVED: 'LOI_APPROVED',
  LOI_REJECTED: 'LOI_REJECTED',
  LOI_GENERATED: 'LOI_GENERATED',
  LOA_REQUESTED: 'LOA_REQUESTED',
  LOA_APPROVED: 'LOA_APPROVED',
  LOA_GENERATED: 'LOA_GENERATED',

  // EOR
  EOR_CHECKLIST_CREATED: 'EOR_CHECKLIST_CREATED',
  EOR_ITEM_UPDATED: 'EOR_ITEM_UPDATED',
  EOR_AUDIT_SUBMITTED: 'EOR_AUDIT_SUBMITTED',

  // Dealer & Finance
  DEALER_CREATED: 'DEALER_CREATED',
  DEALER_UPDATED: 'DEALER_UPDATED',
  DEALER_CODE_GENERATED: 'DEALER_CODE_GENERATED',
  PAYMENT_UPDATED: 'PAYMENT_UPDATED',
  SECURITY_DEPOSIT_UPDATED: 'SECURITY_DEPOSIT_UPDATED',
  FNF_UPDATED: 'FNF_UPDATED',

  // Admin
  USER_CREATED: 'USER_CREATED',
  USER_UPDATED: 'USER_UPDATED',
  USER_STATUS_CHANGED: 'USER_STATUS_CHANGED',
  ROLE_CREATED: 'ROLE_CREATED',
  ROLE_UPDATED: 'ROLE_UPDATED',

  // Resignation & Self-Service
  RESIGNATION_SUBMITTED: 'RESIGNATION_SUBMITTED',
  RESIGNATION_APPROVED: 'RESIGNATION_APPROVED',
  RESIGNATION_REJECTED: 'RESIGNATION_REJECTED',
  RESIGNATION_REVOKED: 'RESIGNATION_REVOKED',
  RESIGNATION_SENT_BACK: 'RESIGNATION_SENT_BACK',
  RESIGNATION_LETTER_DISPATCHED: 'RESIGNATION_LETTER_DISPATCHED',
  TERMINATION_REVOKED: 'TERMINATION_REVOKED',
  TERMINATION_SENT_BACK: 'TERMINATION_SENT_BACK',
  RELOCATION_SENT_BACK: 'RELOCATION_SENT_BACK',
  RELOCATION_REVOKED: 'RELOCATION_REVOKED',
  CONSTITUTIONAL_SENT_BACK: 'CONSTITUTIONAL_SENT_BACK',
  CONSTITUTIONAL_REVOKED: 'CONSTITUTIONAL_REVOKED',
  EMAIL_SENT: 'EMAIL_SENT',
  REMINDER_SENT: 'REMINDER_SENT'
} as const;

// System / Configuration audit modules — written to `system_audit_logs`,
// kept separate from per-application audit so config changes can be filtered
// without scanning the much larger application audit volume.
export const SYSTEM_AUDIT_MODULES = {
    QUESTIONNAIRE: 'QUESTIONNAIRE',
    INTERVIEW_CONFIG: 'INTERVIEW_CONFIG',
    SYSTEM_CONFIG: 'SYSTEM_CONFIG',
    SLA_CONFIG: 'SLA_CONFIG',
    EMAIL_TEMPLATE: 'EMAIL_TEMPLATE',
    MASTER_HIERARCHY: 'MASTER_HIERARCHY',
    ROLE_ASSIGNMENT: 'ROLE_ASSIGNMENT',
    USER_ADMIN: 'USER_ADMIN',
    DEALER_MAPPING: 'DEALER_MAPPING'
} as const;

export const SYSTEM_AUDIT_ACTIONS = {
    CREATED: 'CREATED',
    UPDATED: 'UPDATED',
    DELETED: 'DELETED',
    ACTIVATED: 'ACTIVATED',
    DEACTIVATED: 'DEACTIVATED',
    INITIALIZED: 'INITIALIZED',
    SUBMITTED: 'SUBMITTED',
    ASSIGNED: 'ASSIGNED',
    UNASSIGNED: 'UNASSIGNED',
    REORDERED: 'REORDERED'
} as const;

// Document Types
export const DOCUMENT_TYPES = {
  GST_CERTIFICATE: 'GST Certificate',
  PAN_CARD: 'PAN Card',
  AADHAAR: 'Aadhaar',
  PARTNERSHIP_DEED: 'Partnership Deed',
  LLP_AGREEMENT: 'LLP Agreement',
  INCORPORATION_CERTIFICATE: 'Certificate of Incorporation',
  MOA: 'MOA',
  AOA: 'AOA',
  BOARD_RESOLUTION: 'Board Resolution',
  PROPERTY_DOCUMENTS: 'Property Documents',
  BANK_STATEMENT: 'Bank Statement',
  NODAL_AGREEMENT: 'Nodal Agreement',
  CANCELLED_CHECK: 'Cancelled Check',
  FIRM_REGISTRATION: 'Firm Registration',
  RENTAL_AGREEMENT: 'Rental Agreement',
  VIRTUAL_CODE: 'Virtual Code Confirmation',
  DOMAIN_ID: 'Domain ID Setup',
  MSD_CONFIG: 'MSD Configuration',
  LOI_ACK: 'LOI Acknowledgement',
  FDD_REPORT: 'FDD Final Audit Report',
  FDD_ASSIGNMENT: 'FDD Agency Assignment Letter',
  KT_MATRIX: 'Kepner Tregoe (KT) Matrix',
  INTERVIEW_EVALUATION: 'Interview Evaluation Sheet',
  AI_RECOMMENDATION: 'AI Recommendation Summary',
  SITE_READINESS: 'Site Readiness Report',
  CIBIL_REPORT: 'CIBIL Report',
  CITY_MAP: 'Proposed Site City Map',
  LOA_ACCEPTANCE: 'LOA Acceptance Copy',
  ARCHITECTURE_ASSIGNMENT: 'Architecture Assignment Document',
  ARCHITECTURE_BLUEPRINT: 'Architecture Blueprint',
  SITE_PLAN: 'Site Plan',
  ARCHITECTURE_COMPLETION: 'Architecture Completion Certificate',
  STATUTORY_AUDIT: 'Statutory Approval Certificate',
  BANK_GUARANTEE: 'Bank Guarantee Document',
  SECURITY_DEPOSIT_RECEIPT: 'Security Deposit Receipt',
  SECURITY_DEPOSIT: 'Security Deposit Receipt',
  FIRST_FILL: 'First Fill Receipt',
  RELOCATION_PROPERTY_DOCS: 'Property documents for new location',
  RELOCATION_LEASE_AGREEMENT: 'Lease/Rental agreement for new location',
  RELOCATION_NOC_LANDLORD: 'NOC from current landlord',
  RELOCATION_MUNICIPAL_APPROVALS: 'Municipal approvals',
  RELOCATION_FIRE_SAFETY: 'Fire safety certificate',
  RELOCATION_POLLUTION_CLEARANCE: 'Pollution clearance',
  RELOCATION_LAYOUT_PLAN: 'Layout/Floor plan of new location',
  RELOCATION_PHOTOS: 'Photos of new location',
  RELOCATION_LOCALITY_MAP: 'Locality map',
  RELOCATION_BUILDING_PLAN: 'Building plan approval',
  RELOCATION_ELECTRICITY_DOCS: 'Electricity connection documents',
  RELOCATION_WATER_DOCS: 'Water supply documents',
  INCOME_TAX_RETURNS: 'Income Tax Returns (ITR)',
  BUSINESS_VALUATION_REPORT: 'Business Valuation Report',
  OTHER: 'Other'
} as const;

export const RESIGNATION_DOCUMENT_TYPES = [
  'Resignation Letter',
  'Dealer Undertaking',
  'Approval Note',
  'Resignation Acceptance Letter',
  'Handover Document',
  'Settlement Supporting Document',
  'PPT Presentation',
  'Other'
] as const;

export const RESIGNATION_DOCUMENT_STAGES = [
  'Initiation',
  'ASM',
  'RBM',
  'ZBH',
  'DD Lead',
  'NBH',
  'DD Admin',
  'Legal',
  'F&F Initiated'
] as const;

export const TERMINATION_DOCUMENT_TYPES = [
  'Presentation',
  'Termination Recommendation',
  'Show Cause Notice',
  'SCN Response',
  'Hearing Record',
  'Approval Note',
  'Termination Letter',
  'Settlement Supporting Document',
  'Other'
] as const;

export const TERMINATION_DOCUMENT_STAGES = [
  'Submitted',
  'RBM + DD-ZM Review',
  'ZBH Review',
  'DD Lead Review',
  'Legal Verification',
  'NBH Evaluation',
  'Show Cause Notice',
  'Personal Hearing',
  'NBH Final Approval',
  'CCO Approval',
  'CEO Final Approval',
  'Legal - Termination Letter'
] as const;

// Request Types
export const REQUEST_TYPES = {
  APPLICATION: 'application',
  RESIGNATION: 'resignation',
  CONSTITUTIONAL: 'constitutional',
  RELOCATION: 'relocation',
  TERMINATION: 'termination',
  FNF: 'fnf'
} as const;

// Standardized Offboarding Actions
export const OFFBOARDING_ACTIONS = {
  APPROVE: 'approve',
  SEND_BACK: 'sendBack',
  REVOKE: 'revoke',
  REJECT: 'reject',
  WITHDRAWAL: 'withdrawal',
  ASSIGN: 'assign',
  PUSH_FNF: 'pushfnf',
  RECONSIDER: 'reconsider',
  ISSUE_SCN: 'issueSCN',
  SCN_RESPONSE: 'scnResponse',
  HOLD: 'hold'
} as const;

// Module List for Document Management
export const MODULE_LIST = ['ONBOARDING', 'RESIGNATION', 'RELOCATION', 'CONSTITUTIONAL_CHANGE', 'TERMINATION'] as const;

// Process Stages per Module (Source of Truth for Checklists)
export const STAGES_MAP = {
  'ONBOARDING': ['General', 'KYC', 'Level 1 Interview', 'Level 2 Interview', 'Level 3 Interview', 'FDD', 'LOI Approval', 'LOA Approval', 'LOI Issue', 'Architecture Team Assigned', 'Architecture Document Upload', 'Architecture Team Completion', 'EOR', 'Inauguration'],
  'RESIGNATION': ['Submission', 'Regional Review', 'RBM + DD-ZM Review', 'ZBH Review', 'Finance Review', 'DDL Review', 'Approved'],
  'RELOCATION': ['Initiated', 'ASM Review', 'RBM Review', 'DD ZM Review', 'ZBH Review', 'DD Lead Review', 'NBH Approval', 'Legal Clearance', 'Completed'],
  'CONSTITUTIONAL_CHANGE': ['Draft', 'Legal Review', 'Approved'],
  'TERMINATION': ['Submitted', 'RBM + DD-ZM Review', 'ZBH Review', 'DD Lead Review', 'Legal Verification', 'NBH Evaluation', 'SCN', 'Personal Hearing', 'Completed']
} as const;
