<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;

class Fieldly extends BaseConfig
{
    public array $permissions = [
        'view_dashboard',
        'view_customers','edit_customers',
        'view_jobs','edit_jobs','complete_jobs','assign_jobs',
        'view_quotes','edit_quotes',
        'view_invoices','edit_invoices','record_payments',
        'view_time','edit_time','log_time',
        'view_reports',
        'view_calendar','edit_calendar',
        'view_settings',
        'manage_users','manage_roles',
        'view_global_settings','edit_global_settings',
        'view_activity',
        'manage_files','manage_notes',
    ];

    public array $permissionGroups = [
        'Dashboard'       => ['view_dashboard'],
        'Customers'       => ['view_customers','edit_customers'],
        'Jobs'            => ['view_jobs','edit_jobs','complete_jobs','assign_jobs'],
        'Quotes'          => ['view_quotes','edit_quotes'],
        'Invoices'        => ['view_invoices','edit_invoices','record_payments'],
        'Time'            => ['view_time','edit_time','log_time'],
        'Reports'         => ['view_reports'],
        'Calendar'        => ['view_calendar','edit_calendar'],
        'Settings'        => ['view_settings','manage_users','manage_roles'],
        'Global Settings' => ['view_global_settings','edit_global_settings'],
        'Activity'        => ['view_activity'],
        'Files & Notes'   => ['manage_files','manage_notes'],
    ];

    public int   $numberPadding  = 4;
    public float $defaultTaxRate = 20.0;
    public int   $maxFileSize    = 20971520; // 20MB
    public int   $sessionTimeout = 28800;    // 8 hours

    public array $allowedMimeTypes = [
        'image/jpeg','image/png','image/gif','image/webp',
        'application/pdf',
        'application/msword',
        'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
        'text/plain','text/csv',
    ];
}
