<?php

namespace Config;

use CodeIgniter\Config\BaseConfig;

/**
 * Toggleable application modules for the admin panel.
 * Keys must match Navigation config module keys where applicable.
 */
class ModuleRegistry extends BaseConfig
{
    /**
     * @var array<string, array{
     *     label: string,
     *     description: string,
     *     icon: string,
     *     prefixes: list<string>,
     *     is_core?: bool
     * }>
     */
    public array $registry = [
        'hrm' => [
            'label'       => 'HRM',
            'description' => 'Employees, departments, leave, attendance, payroll, assets, documents, and scheduling.',
            'icon'        => 'fa-id-badge',
            'prefixes'    => ['hrm', 'employees', 'departments', 'leave', 'holidays', 'attendance', 'payroll', 'assets', 'documents', 'scheduling'],
        ],
        'sale' => [
            'label'       => 'Sales & CRM',
            'description' => 'Leads, opportunities, quotations, orders, invoices, and customer management.',
            'icon'        => 'fa-chart-line',
            'prefixes'    => ['sale'],
        ],
        'contracts' => [
            'label'       => 'Contracts',
            'description' => 'Customer contracts, sites, renewals, and expiry tracking.',
            'icon'        => 'fa-file-contract',
            'prefixes'    => ['contracts'],
        ],
        'procurement' => [
            'label'       => 'Procurement',
            'description' => 'Suppliers, purchase requests, RFQs, purchase orders, and vendor bills.',
            'icon'        => 'fa-cart-shopping',
            'prefixes'    => ['procurement'],
        ],
        'inventory' => [
            'label'       => 'Inventory',
            'description' => 'Products, warehouses, stock movements, and asset inventory.',
            'icon'        => 'fa-boxes-stacked',
            'prefixes'    => ['inventory'],
        ],
        'accounting' => [
            'label'       => 'Accounting',
            'description' => 'General ledger, receivables, payables, banking, and financial reports.',
            'icon'        => 'fa-calculator',
            'prefixes'    => ['accounting'],
        ],
        'operations' => [
            'label'       => 'Operations',
            'description' => 'Work orders, tasks, approvals, field service, and quality control.',
            'icon'        => 'fa-clipboard-list',
            'prefixes'    => ['operations'],
        ],
        'transport' => [
            'label'       => 'Transport',
            'description' => 'Fleet, routes, scheduling, and AI transport planning.',
            'icon'        => 'fa-truck',
            'prefixes'    => ['transport'],
        ],
        'reports' => [
            'label'       => 'Reports',
            'description' => 'Cross-module reports for attendance, payroll, sales, inventory, and more.',
            'icon'        => 'fa-chart-pie',
            'prefixes'    => ['reports'],
        ],
        'messages' => [
            'label'       => 'Messaging',
            'description' => 'Internal messaging and group communication.',
            'icon'        => 'fa-comments',
            'prefixes'    => ['messages'],
        ],
        'administration' => [
            'label'       => 'Administration',
            'description' => 'System settings, users, roles, and permissions. Always enabled.',
            'icon'        => 'fa-gear',
            'prefixes'    => ['settings', 'users', 'roles', 'permissions'],
            'is_core'     => true,
        ],
    ];
}
