<?php

namespace App\Enums;

enum Permission: string
{
    // Dashboard
    case DASHBOARD_VIEW = 'dashboard.view';
    case DASHBOARD_ATTENDANCE = 'dashboard.attendance';
    case DASHBOARD_REVENUE = 'dashboard.revenue';
    case DASHBOARD_EXPENSE = 'dashboard.expense';
    case DASHBOARD_ORDERS_CHANNEL = 'dashboard.orders_channel';
    case DASHBOARD_ORDERS_PAYMENT = 'dashboard.orders_payment';
    case DASHBOARD_ORDERS_MARKETING = 'dashboard.orders_marketing';
    case DASHBOARD_ORDERS_STATUS = 'dashboard.orders_status';
    case DASHBOARD_CASH = 'dashboard.cash';

    // Analysis
    case ANALYSIS_VIEW = 'analysis.view';
    case ANALYSIS_ATTENDANCE = 'analysis.attendance';
    case ANALYSIS_CASH = 'analysis.cash';
    case ANALYSIS_PRODUCT_STOCK = 'analysis.product_stock';
    case ANALYSIS_REVENUE = 'analysis.revenue';
    case ANALYSIS_EXPENSE = 'analysis.expense';
    case ANALYSIS_BUSY_HOURS = 'analysis.busy_hours';
    case ANALYSIS_PROFIT_ORDERS = 'analysis.profit_orders';
    case ANALYSIS_PROFIT_HPP = 'analysis.profit_hpp';
    case ANALYSIS_PROFIT_GROSS = 'analysis.profit_gross';
    case ANALYSIS_PROFIT_MARGIN = 'analysis.profit_margin';
    case ANALYSIS_TOP_CUSTOMERS = 'analysis.top_customers';
    case ANALYSIS_TOP_PRODUCTS = 'analysis.top_products';
    case ANALYSIS_MARKETING_SALES = 'analysis.marketing_sales';
    case ANALYSIS_RAW_MATERIALS = 'analysis.raw_materials';

    // Employees
    case EMPLOYEES_VIEW = 'employees.view';
    case EMPLOYEES_CREATE = 'employees.create';
    case EMPLOYEES_UPDATE = 'employees.update';
    case EMPLOYEES_DELETE = 'employees.delete';
    case EMPLOYEES_TOGGLE_STATUS = 'employees.toggle_status';
    case EMPLOYEES_RESET_PASSWORD = 'employees.reset_password';

    // Attendances
    case ATTENDANCES_VIEW = 'attendances.view';
    case ATTENDANCES_CREATE = 'attendances.create';
    case ATTENDANCES_DELETE = 'attendances.delete';
    case ATTENDANCES_MANAGE = 'attendances.manage';

    // Leave Requests
    case LEAVE_REQUESTS_VIEW = 'leave_requests.view';
    case LEAVE_REQUESTS_CREATE = 'leave_requests.create';
    case LEAVE_REQUESTS_UPDATE = 'leave_requests.update';
    case LEAVE_REQUESTS_DELETE = 'leave_requests.delete';
    case LEAVE_REQUESTS_VERIFY = 'leave_requests.verify';

    // Categories
    case CATEGORIES_VIEW = 'categories.view';
    case CATEGORIES_CREATE = 'categories.create';
    case CATEGORIES_UPDATE = 'categories.update';
    case CATEGORIES_DELETE = 'categories.delete';

    // Customers
    case CUSTOMERS_VIEW = 'customers.view';
    case CUSTOMERS_CREATE = 'customers.create';
    case CUSTOMERS_UPDATE = 'customers.update';
    case CUSTOMERS_DELETE = 'customers.delete';

    // Products
    case PRODUCTS_VIEW = 'products.view';
    case PRODUCTS_CREATE = 'products.create';
    case PRODUCTS_UPDATE = 'products.update';
    case PRODUCTS_DELETE = 'products.delete';
    case PRODUCTS_TOGGLE_STATUS = 'products.toggle_status';
    case PRODUCTS_TOGGLE_FEATURED = 'products.toggle_featured';
    case PRODUCTS_TRANSFER_STOCK = 'products.transfer_stock';
    case PRODUCTS_VIEW_STOCK_MUTATIONS = 'products.view_stock_mutations';

    // Orders
    case ORDERS_VIEW = 'orders.view';
    case ORDERS_CREATE = 'orders.create';
    case ORDERS_UPDATE = 'orders.update';
    case ORDERS_DELETE = 'orders.delete';
    case ORDERS_SEND = 'orders.send';
    case ORDERS_COMPLETE = 'orders.complete';
    case ORDERS_CANCEL = 'orders.cancel';

    // Cuttings
    case CUTTINGS_VIEW = 'cuttings.view';
    case CUTTINGS_CREATE = 'cuttings.create';
    case CUTTINGS_UPDATE = 'cuttings.update';
    case CUTTINGS_DELETE = 'cuttings.delete';
    case CUTTINGS_COMPLETE = 'cuttings.complete';

    // Cash
    case CASH_VIEW = 'cash.view';
    case CASH_DEPOSIT = 'cash.deposit';
    case CASH_WITHDRAW = 'cash.withdraw';
    case CASH_UPDATE = 'cash.update';
    case CASH_DELETE = 'cash.delete';

    // Expenses
    case EXPENSES_VIEW = 'expenses.view';
    case EXPENSES_CREATE = 'expenses.create';
    case EXPENSES_UPDATE = 'expenses.update';
    case EXPENSES_DELETE = 'expenses.delete';

    // Activity Logs
    case ACTIVITY_LOGS_VIEW = 'activity_logs.view';

    // Employee Advances
    case EMPLOYEE_ADVANCES_VIEW = 'employee_advances.view';
    case EMPLOYEE_ADVANCES_CREATE = 'employee_advances.create';
    case EMPLOYEE_ADVANCES_UPDATE = 'employee_advances.update';
    case EMPLOYEE_ADVANCES_DELETE = 'employee_advances.delete';
    case EMPLOYEE_ADVANCES_PAY = 'employee_advances.pay';
    case EMPLOYEE_ADVANCES_VIEW_PAYMENTS = 'employee_advances.view_payments';
    case EMPLOYEE_ADVANCES_VERIFY = 'employee_advances.verify';

    // Payroll
    case PAYROLL_VIEW = 'payroll.view';
    case PAYROLL_PAY = 'payroll.pay';
    case PAYROLL_CANCEL = 'payroll.cancel';
    case PAYROLL_ADJUST = 'payroll.adjust';

    // Restocks
    case RESTOCKS_VIEW = 'restocks.view';
    case RESTOCKS_CREATE = 'restocks.create';
    case RESTOCKS_UPDATE = 'restocks.update';
    case RESTOCKS_DELETE = 'restocks.delete';

    // Raw Materials
    case RAW_MATERIALS_VIEW = 'raw_materials.view';
    case RAW_MATERIALS_CREATE = 'raw_materials.create';
    case RAW_MATERIALS_UPDATE = 'raw_materials.update';
    case RAW_MATERIALS_DELETE = 'raw_materials.delete';
    case RAW_MATERIALS_TOGGLE_STATUS = 'raw_materials.toggle_status';

    // Suppliers
    case SUPPLIERS_VIEW = 'suppliers.view';
    case SUPPLIERS_CREATE = 'suppliers.create';
    case SUPPLIERS_UPDATE = 'suppliers.update';
    case SUPPLIERS_DELETE = 'suppliers.delete';

    // Purchases
    case PURCHASES_VIEW = 'purchases.view';
    case PURCHASES_CREATE = 'purchases.create';
    case PURCHASES_UPDATE = 'purchases.update';
    case PURCHASES_DELETE = 'purchases.delete';

    // Stok Opnames
    case STOK_OPNAMES_VIEW = 'stok_opnames.view';
    case STOK_OPNAMES_CREATE = 'stok_opnames.create';
    case STOK_OPNAMES_UPDATE = 'stok_opnames.update';
    case STOK_OPNAMES_DELETE = 'stok_opnames.delete';
    case STOK_OPNAMES_SUBMIT = 'stok_opnames.submit';
    case STOK_OPNAMES_VERIFY = 'stok_opnames.verify';

    // Roles
    case ROLES_VIEW = 'roles.view';
    case ROLES_CREATE = 'roles.create';
    case ROLES_UPDATE = 'roles.update';
    case ROLES_DELETE = 'roles.delete';

    // Settings
    case SETTINGS_VIEW_SYSTEM = 'settings.view_system';
    case SETTINGS_UPDATE_SYSTEM = 'settings.update_system';
    case SETTINGS_VIEW_HOMEPAGE = 'settings.view_homepage';
    case SETTINGS_UPDATE_HOMEPAGE = 'settings.update_homepage';
    case SETTINGS_VIEW_SOCIAL_MEDIA = 'settings.view_social_media';
    case SETTINGS_UPDATE_SOCIAL_MEDIA = 'settings.update_social_media';
    case SETTINGS_VIEW_HR = 'settings.view_hr';
    case SETTINGS_UPDATE_HR = 'settings.update_hr';

    public function label(): string
    {
        return $this->value;
    }
}
