<?php

return [
    // Version identifier for the current baseline configuration.
    'baseline_version' => '2026-03-05-01',

    // Baseline departments seeded for every dealer (excluding System Administration).
    'departments' => [
        'Admin',
        'Executive',
        'Finance',
        'Inventory',
        'Marketing',
        'Operations',
        'Sales',
    ],

    // Roles that should NOT be created per dealer (platform-only).
    'excluded_roles_for_dealers' => [
        'System Admin',
    ],

    // Map roles to department names.
    'role_department_map' => [
        'Dealer Administration' => 'Admin',
        'Receptionist'          => 'Admin',
        'Managing Director'     => 'Executive',
        'Branch Manager'        => 'Executive',
        'Financial Manager'     => 'Finance',
        'F&I'                   => 'Finance',
        'Buyer'                 => 'Inventory',
        'Stock Controller'      => 'Inventory',
        'Marketing'             => 'Marketing',
        'Driver'                => 'Operations',
        'Cleaner'               => 'Operations',
        'Salesman'              => 'Sales',
        // Platform-level only, but included for completeness.
        'System Admin'          => 'System Administration',
    ],

    // Role priority for department resolution.
    // Higher number = higher priority.
    'role_priority' => [
        'System Admin'          => 120,
        'Dealer Administration' => 110,
        'Managing Director'     => 100,
        'Branch Manager'        => 90,
        'Financial Manager'     => 80,
        'F&I'                   => 70,
        'Buyer'                 => 60,
        'Stock Controller'      => 50,
        'Salesman'              => 40,
        'Receptionist'          => 30,
        'Marketing'             => 20,
        'Driver'                => 10,
        'Cleaner'               => 5,
    ],

    // Departments that are platform-only and must not be assigned to dealer users.
    'platform_only_departments' => [
        'System Administration',
    ],

    // Built-in dealer users (per-dealer baseline users, no System Admin).
    'builtin_users' => [
        ['name' => 'Receptionist Built-in',        'email' => 'receptionist@megatheron.co.za',    'role' => 'Receptionist'],
        ['name' => 'Dealer Administrator Built-in','email' => 'dealeradmin@megatheron.co.za',     'role' => 'Dealer Administration'],
        ['name' => 'Managing Director Built-in',   'email' => 'md@megatheron.co.za',              'role' => 'Managing Director'],
        ['name' => 'Branch Manager Built-in',      'email' => 'branch.manager@megatheron.co.za',  'role' => 'Branch Manager'],
        ['name' => 'F&I Built-in',                 'email' => 'fi@megatheron.co.za',              'role' => 'F&I'],
        ['name' => 'Financial Manager Built-in',   'email' => 'fin.manager@megatheron.co.za',     'role' => 'Financial Manager'],
        ['name' => 'Buyer Built-in',               'email' => 'buyer@megatheron.co.za',           'role' => 'Buyer'],
        ['name' => 'Stock Controller Built-in',    'email' => 'stock.controller@megatheron.co.za','role' => 'Stock Controller'],
        ['name' => 'Marketing Built-in',           'email' => 'marketing@megatheron.co.za',       'role' => 'Marketing'],
        ['name' => 'Driver Built-in',              'email' => 'driver@megatheron.co.za',          'role' => 'Driver'],
        ['name' => 'Cleaner Built-in',             'email' => 'cleaner@megatheron.co.za',         'role' => 'Cleaner'],
        ['name' => 'Salesman Built-in',            'email' => 'salesman@megatheron.co.za',        'role' => 'Salesman'],
    ],

    // Domain to replace when generating per-dealer builtin user emails.
    'builtin_email_base_domain' => 'megatheron.co.za',
];

