<?php

namespace App\Support\Authorization;

enum PermissionName: string
{
    case DASHBOARD_VIEW = 'dashboard.view';
    case SEARCH_USE = 'search.use';
    case BUSINESS_SETTINGS_VIEW = 'business.settings.view';
    case BUSINESS_SETTINGS_UPDATE = 'business.settings.update';
    case SYSTEM_SETTINGS_MANAGE = 'system.settings.manage';
    case BRANCHES_VIEW = 'branches.view';
    case BRANCHES_CREATE = 'branches.create';
    case BRANCHES_UPDATE = 'branches.update';
    case USERS_VIEW = 'users.view';
    case USERS_CREATE = 'users.create';
    case USERS_UPDATE = 'users.update';
    case ROLES_VIEW = 'roles.view';
    case ROLES_CREATE = 'roles.create';
    case ROLES_UPDATE = 'roles.update';
    case ROLES_DELETE = 'roles.delete';
    case ROLES_ASSIGN = 'roles.assign';
    case ROLES_ASSIGN_SYSTEM = 'roles.assign-system';
    case ROLES_ASSIGN_SUPER_ADMIN = 'roles.assign-super-admin';
    case AUDIT_VIEW = 'audit.view';
    case CUSTOMERS_MANAGE = 'customers.manage';
    case CUSTOMERS_VIEW = 'customers.view';
    case CUSTOMERS_CREATE = 'customers.create';
    case CUSTOMERS_UPDATE = 'customers.update';
    case CUSTOMERS_DOCUMENTS = 'customers.documents';
    case CUSTOMERS_GUARANTORS = 'customers.guarantors';
    case CUSTOMERS_WATCHLIST = 'customers.watchlist';
    case CREDIT_SCORE_VIEW = 'credit-score.view';
    case CREDIT_SCORE_HISTORY = 'credit-score.history';
    case CREDIT_SCORE_RECALCULATE = 'credit-score.recalculate';
    case LOAN_PRODUCTS_VIEW = 'loan-products.view';
    case LOAN_PRODUCTS_MANAGE = 'loan-products.manage';
    case COLLATERAL_VIEW = 'collateral.view';
    case COLLATERAL_MANAGE = 'collateral.manage';
    case COLLATERAL_CUSTODY = 'collateral.custody';
    case COLLATERAL_DOCUMENTS = 'collateral.documents';
    case LOANS_VIEW = 'loans.view';
    case LOANS_CREATE = 'loans.create';
    case LOANS_UPDATE = 'loans.update';
    case LOANS_CONTRACT = 'loans.contract';
    case LOANS_DOCUMENTS = 'loans.documents';
    case LOANS_INSTALLMENTS_EXCUSE = 'loans.installments.excuse';
    case LOANS_APPROVE = 'loans.approve';
    case LOANS_MANAGER_APPROVE = 'loans.manager-approve';
    case LOANS_AUTO_APPROVE = 'loans.auto-approve';
    case LOANS_DISBURSE = 'loans.disburse';
    case LOANS_TOP_UP_VIEW = 'loans.top-up.view';
    case LOANS_TOP_UP_CREATE = 'loans.top-up.create';
    case LOANS_TOP_UP_EXECUTE = 'loans.top-up.execute';
    case LOANS_TOP_UP_OVERRIDE = 'loans.top-up.override';
    case LOANS_ADJUSTMENTS_VIEW = 'loans.adjustments.view';
    case LOANS_SETTLEMENT_EXECUTE = 'loans.settlement.execute';
    case LOANS_SETTLEMENT_ADJUST = 'loans.settlement.adjust';
    case LOANS_RESTRUCTURE_CREATE = 'loans.restructure.create';
    case LOANS_RESTRUCTURE_APPROVE = 'loans.restructure.approve';
    case LOANS_WRITEOFF_VIEW = 'loans.writeoff.view';
    case LOANS_WRITEOFF_REQUEST = 'loans.writeoff.request';
    case LOANS_WRITEOFF_APPROVE = 'loans.writeoff.approve';
    case LOANS_WRITEOFF_RECOVER = 'loans.writeoff.recover';
    case PAYMENTS_RECEIVE = 'payments.receive';
    case PAYMENTS_REMOTE_SUBMIT = 'payments.remote.submit';
    case PAYMENTS_REMOTE_VERIFY = 'payments.remote.verify';
    case NOTIFICATIONS_VIEW = 'notifications.view';
    case NOTIFICATIONS_RETRY = 'notifications.retry';
    case NOTIFICATIONS_MANAGE = 'notifications.manage';
    case ARREARS_VIEW = 'arrears.view';
    case ARREARS_FOLLOW_UP = 'arrears.follow-up';
    case ACCOUNTS_VIEW = 'accounts.view';
    case ACCOUNTS_MANAGE = 'accounts.manage';
    case ACCOUNTS_CAPITAL = 'accounts.capital';
    case ACCOUNTS_TRANSFER = 'accounts.transfer';
    case ACCOUNTING_VIEW = 'accounting.view';
    case FIXED_ASSETS_VIEW = 'fixed-assets.view';
    case FIXED_ASSETS_MANAGE = 'fixed-assets.manage';
    case FIXED_ASSETS_DEPRECIATE = 'fixed-assets.depreciate';
    case FIXED_ASSETS_MAINTENANCE = 'fixed-assets.maintenance';
    case FIXED_ASSETS_REPORTS_VIEW = 'fixed-assets.reports.view';
    case FIXED_ASSETS_REPORTS_EXPORT = 'fixed-assets.reports.export';
    case EXPENSES_MANAGE = 'expenses.manage';
    case EXPENSES_VIEW = 'expenses.view';
    case EXPENSES_CREATE = 'expenses.create';
    case EXPENSES_APPROVE = 'expenses.approve';
    case EXPENSES_CATEGORIES_MANAGE = 'expenses.categories.manage';
    case EXPENSES_RECURRING_MANAGE = 'expenses.recurring.manage';
    case REPORTS_VIEW = 'reports.view';
    case REPORTS_EXPORT = 'reports.export';
    case COLLECTIONS_MANAGE = 'collections.manage';
    case PAYROLL_MANAGE = 'payroll.manage';
    case PAYROLL_VIEW = 'payroll.view';
    case PAYROLL_COMPENSATION_MANAGE = 'payroll.compensation.manage';
    case PAYROLL_PERIODS_CREATE = 'payroll.periods.create';
    case PAYROLL_APPROVE = 'payroll.approve';
    case PAYROLL_PAY = 'payroll.pay';
    case CASH_CLOSING_VIEW = 'cash-closing.view';
    case CASH_RECONCILIATION_PERFORM = 'cash-reconciliation.perform';
    case DAILY_CLOSING_PREPARE = 'daily-closing.prepare';
    case DAILY_CLOSING_CONFIRM = 'daily-closing.confirm';
    case TASKS_VIEW = 'tasks.view';
    case TASKS_MANAGE = 'tasks.manage';
    case TASKS_CREATE = 'tasks.create';
    case TASKS_UPDATE = 'tasks.update';
    case TASKS_ASSIGN = 'tasks.assign';
    case TASKS_UPDATE_STATUS = 'tasks.update-status';
    case CALENDAR_VIEW = 'calendar.view';
    case APPOINTMENTS_MANAGE = 'appointments.manage';
    case APPOINTMENTS_CREATE = 'appointments.create';
    case APPOINTMENTS_UPDATE = 'appointments.update';
    case APPOINTMENTS_MANAGE_STATUS = 'appointments.manage-status';
    case MANAGEMENT_ALERTS_VIEW = 'management-alerts.view';
    case MANAGEMENT_ALERTS_MANAGE = 'management-alerts.manage';
    case MANAGEMENT_ALERTS_ACKNOWLEDGE = 'management-alerts.acknowledge';
    case MANAGEMENT_ALERTS_RESOLVE = 'management-alerts.resolve';
    case MANAGEMENT_ALERTS_SETTINGS = 'management-alerts.settings';

    /** @return array<int, string> */
    public static function values(): array
    {
        return array_map(static fn (self $permission): string => $permission->value, self::cases());
    }
}
