<?php

return [
    'name' => 'DemoLogin',

    /*
    |--------------------------------------------------------------------------
    | Demo gate
    |--------------------------------------------------------------------------
    | Passwordless quick-login is DANGEROUS in production. Every route 404s
    | unless this is explicitly true (env DEMO_LOGIN=true). Keep it false on
    | any real deployment.
    */
    'enabled' => env('DEMO_LOGIN', false),

    /*
    |--------------------------------------------------------------------------
    | Role cards per VERTICAL  (future-proofing)
    |--------------------------------------------------------------------------
    | The /demo page lists every SaaS project (config saasswitcher.projects) and,
    | for each, shows the role cards of that project's vertical
    | (saasswitcher.projects.<key>.vertical). So a NEW project automatically
    | appears here once it is added to SaasSwitcher with a `vertical` — no change
    | needed in this module. To support a brand-new vertical, just add a key below.
    |
    | Each card:
    |   key   -> URL token (unique within the vertical)
    |   label -> button text
    |   role  -> the Spatie role BASE name; suffixed with the business id at
    |            runtime (e.g. 'Doctor' -> 'Doctor#8'). Must be a role that the
    |            project DB carries (the clinic/vet DefaultRolesSeeders create
    |            these; Admin/Cashier are UltimatePOS defaults).
    |   icon  -> Font Awesome class      color -> accent
    |
    | An optional `permissions` array on a card lets the demo CREATE that role
    | with those permissions on first use (only permissions that exist in the
    | project DB are granted). Roles without it rely on the clinic/vet/ERP
    | seeders. ERP permission names (product.*, purchase.*) are shared across
    | every project; clinic uses `clinic.*`, vet uses `vet_clinic.*`.
    */

    // Reusable ERP/inventory permission set for the Warehouse / Storekeeper role.
    'warehouse_permissions' => [
        'product.view', 'purchase.view', 'purchase.create', 'purchase.update',
        'view_own_purchase', 'access_all_locations',
    ],

    'role_sets' => [

        'clinic' => [
            ['key' => 'admin',      'label' => 'Admin',          'role' => 'Admin',          'icon' => 'fa-user-shield',   'color' => '#6366f1', 'desc' => 'Full access — every feature'],
            ['key' => 'doctor',     'label' => 'Doctor',         'role' => 'Doctor',         'icon' => 'fa-user-doctor',   'color' => '#0ea5e9', 'desc' => 'Consultations, prescriptions, AI'],
            ['key' => 'nurse',      'label' => 'Nurse',          'role' => 'Nurse',          'icon' => 'fa-user-nurse',    'color' => '#14b8a6', 'desc' => 'Vitals, vaccinations, exams'],
            ['key' => 'reception',  'label' => 'Reception',      'role' => 'Receptionist',   'icon' => 'fa-headset',       'color' => '#22c55e', 'desc' => 'Booking, patients, contacts'],
            ['key' => 'pharmacist', 'label' => 'Pharmacist',     'role' => 'Pharmacist',     'icon' => 'fa-prescription-bottle-medical', 'color' => '#ec4899', 'desc' => 'Dispensing & medicines',
                'permissions' => ['clinic.access_module', 'clinic.manage_medicines', 'clinic.manage_prescriptions', 'clinic.dispense_prescriptions', 'clinic.view_appointments', 'product.view']],
            ['key' => 'manager',    'label' => 'Branch Manager', 'role' => 'Branch Manager', 'icon' => 'fa-user-tie',      'color' => '#f59e0b', 'desc' => 'Oversight, approvals, reports'],
            ['key' => 'accounting', 'label' => 'Accounting',     'role' => 'Accounting',     'icon' => 'fa-calculator',    'color' => '#a855f7', 'desc' => 'Billing & financial reports'],
            ['key' => 'warehouse',  'label' => 'Warehouse',      'role' => 'Warehouse',      'icon' => 'fa-warehouse',     'color' => '#0d9488', 'desc' => 'Stock, transfers, purchases', 'permissions' => '@warehouse'],
            ['key' => 'assistant',  'label' => 'Assistant',      'role' => 'Assistant',      'icon' => 'fa-hands-holding-medical', 'color' => '#64748b', 'desc' => 'Front-line support'],
        ],

        'vet' => [
            ['key' => 'admin',      'label' => 'Admin',          'role' => 'Admin',          'icon' => 'fa-user-shield',   'color' => '#6366f1', 'desc' => 'Full access — every feature'],
            ['key' => 'vet',        'label' => 'Veterinarian',   'role' => 'Doctor',         'icon' => 'fa-user-doctor',   'color' => '#0ea5e9', 'desc' => 'Consultations, prescriptions'],
            ['key' => 'nurse',      'label' => 'Vet Nurse',      'role' => 'Nurse',          'icon' => 'fa-user-nurse',    'color' => '#14b8a6', 'desc' => 'Vitals, admissions'],
            ['key' => 'reception',  'label' => 'Reception',      'role' => 'Receptionist',   'icon' => 'fa-headset',       'color' => '#22c55e', 'desc' => 'Booking, pet owners'],
            ['key' => 'pharmacist', 'label' => 'Pharmacist',     'role' => 'Pharmacist',     'icon' => 'fa-prescription-bottle-medical', 'color' => '#ec4899', 'desc' => 'Dispensing & medicines',
                'permissions' => ['vet_clinic.access_module', 'vet_clinic.manage_medicines', 'vet_clinic.manage_prescriptions', 'vet_clinic.dispense_prescriptions', 'vet_clinic.view_appointments', 'product.view']],
            ['key' => 'manager',    'label' => 'Branch Manager', 'role' => 'Branch Manager', 'icon' => 'fa-user-tie',      'color' => '#f59e0b', 'desc' => 'Oversight, approvals'],
            ['key' => 'accounting', 'label' => 'Accounting',     'role' => 'Accounting',     'icon' => 'fa-calculator',    'color' => '#a855f7', 'desc' => 'Billing & reports'],
            ['key' => 'warehouse',  'label' => 'Warehouse',      'role' => 'Warehouse',      'icon' => 'fa-warehouse',     'color' => '#0d9488', 'desc' => 'Stock, transfers, purchases', 'permissions' => '@warehouse'],
        ],

        // Vehicle Repair Center (project key `vrc`). vrc.* permissions exist after
        // VrcPermissionSeeder runs; cards with a `permissions` array create their
        // role on first use. Admin/Cashier are UltimatePOS defaults.
        'vrc' => [
            ['key' => 'admin',      'label' => 'Admin',           'role' => 'Admin',           'icon' => 'fa-user-shield',        'color' => '#6366f1', 'desc' => 'Full access — every feature'],
            ['key' => 'advisor',    'label' => 'Service Advisor', 'role' => 'Service Advisor', 'icon' => 'fa-headset',            'color' => '#0ea5e9', 'desc' => 'Repair orders, estimates, appointments',
                'permissions' => ['vrc.access', 'vrc.dashboard.view', 'vrc.vehicle.view', 'vrc.vehicle.manage', 'vrc.service.view', 'vrc.appointment.view', 'vrc.appointment.manage', 'vrc.bay.manage', 'vrc.repair_order.view', 'vrc.repair_order.create', 'vrc.repair_order.manage', 'vrc.estimate.view', 'vrc.estimate.manage', 'vrc.estimate.approve', 'vrc.inspection.view', 'vrc.insurance.view', 'product.view']],
            ['key' => 'technician', 'label' => 'Technician',      'role' => 'Technician',      'icon' => 'fa-screwdriver-wrench', 'color' => '#f59e0b', 'desc' => 'Assigned jobs, labor, inspections',
                'permissions' => ['vrc.access', 'vrc.dashboard.view', 'vrc.repair_order.view', 'vrc.inspection.view', 'vrc.inspection.manage', 'vrc.technician.view']],
            ['key' => 'parts',      'label' => 'Parts / Store',   'role' => 'Parts',           'icon' => 'fa-warehouse',          'color' => '#0d9488', 'desc' => 'Parts lookup, stock, purchases',
                'permissions' => ['vrc.access', 'vrc.repair_order.view', 'product.view', 'purchase.view', 'purchase.create', 'purchase.update', 'view_own_purchase', 'access_all_locations']],
            ['key' => 'manager',    'label' => 'Branch Manager',  'role' => 'Branch Manager',  'icon' => 'fa-user-tie',           'color' => '#a855f7', 'desc' => 'Oversight, approvals, reports',
                'permissions' => ['vrc.access', 'vrc.dashboard.view', 'vrc.repair_order.view', 'vrc.repair_order.manage', 'vrc.estimate.view', 'vrc.estimate.approve', 'vrc.technician.view', 'vrc.reports.view', 'vrc.reminder.manage', 'vrc.settings.access', 'product.view']],
            ['key' => 'cashier',    'label' => 'Cashier',         'role' => 'Cashier',         'icon' => 'fa-cash-register',      'color' => '#22c55e', 'desc' => 'POS, invoicing & payments'],
        ],

        'erp' => [
            ['key' => 'admin',     'label' => 'Admin',     'role' => 'Admin',     'icon' => 'fa-user-shield',   'color' => '#6366f1', 'desc' => 'Full access — every feature'],
            ['key' => 'cashier',   'label' => 'Cashier',   'role' => 'Cashier',   'icon' => 'fa-cash-register', 'color' => '#22c55e', 'desc' => 'POS & sales'],
            ['key' => 'warehouse', 'label' => 'Warehouse', 'role' => 'Warehouse', 'icon' => 'fa-warehouse',     'color' => '#0d9488', 'desc' => 'Stock, transfers, purchases', 'permissions' => '@warehouse'],
        ],
    ],

    // Used when a project has no vertical / an unknown one.
    'default_vertical' => 'erp',
];
