/**
 * Granular Permission Constants
 * Categorized by Action, View/Access, and Application Stage
 */

export const PERMISSION_CATEGORIES = {
    ACTION: 'ACTION',
    VIEW: 'VIEW',
    STAGE: 'STAGE'
} as const;

export const PERMISSIONS = {
    // Action Permissions
    ACTION_APPROVE: 'action:approve',
    ACTION_REJECT: 'action:reject',
    ACTION_UPLOAD_DOCS: 'action:upload_docs',
    ACTION_REQUEST_CHANGES: 'action:request_changes',
    ACTION_FORWARD: 'action:forward',
    ACTION_REASSIGN: 'action:reassign',
    ACTION_SCHEDULE_INTERVIEW: 'action:schedule_interview',
    ACTION_ADD_COMMENTS: 'action:add_comments',
    ACTION_RANK_APPLICANTS: 'action:rank_applicants',
    ACTION_FINAL_APPROVAL: 'action:final_approval',

    // View/Access Permissions
    VIEW_DETAILS: 'view:view_details',
    VIEW_FINANCIAL: 'view:view_financial',
    VIEW_DISCUSSIONS: 'view:view_discussions',
    VIEW_PROGRESS: 'view:view_progress',
    VIEW_AUDIT: 'view:view_audit',
    VIEW_DOCUMENTS: 'view:view_documents',
    VIEW_PERSONAL: 'view:view_personal',
    VIEW_BUSINESS: 'view:view_business',
    VIEW_REPORTS: 'view:view_reports',
    VIEW_HISTORY: 'view:view_history',

    // Application Stage Access
    STAGE_INITIAL_REVIEW: 'stage:initial_review',
    STAGE_FIELD_VERIFICATION: 'stage:field_verification',
    STAGE_LEVEL1_INTERVIEW: 'stage:level1_interview',
    STAGE_LEVEL2_INTERVIEW: 'stage:level2_interview',
    STAGE_RANKING: 'stage:ranking',
    STAGE_LEGAL_REVIEW: 'stage:legal_review',
    STAGE_FINANCIAL_REVIEW: 'stage:financial_review',
    STAGE_FINAL_APPROVAL: 'stage:final_approval',
    STAGE_PAYMENT: 'stage:payment',
    STAGE_ONBOARDING: 'stage:onboarding'
} as const;

export type PermissionCode = typeof PERMISSIONS[keyof typeof PERMISSIONS];
