<?php

return [

    // KPI widgets that follow the dashboard date range (rendered below the range picker, not in the fixed
    // snapshot row). Keyed by widget => required feature (null = always shown).
    'range_kpis' => [
        'enquiry_count' => null,
        'avg_inventory' => null,
        'reservations_period' => 'reservations',
        'reservations_revenue_period' => 'reservations',
        'service_bookings_period' => 'service-booking',
    ],

    'widgets' => [
        'chart' => [
            'kind' => 'graph',
            'widget' => 'chart',
            'data' => [
                'date_range' => 30,
                'metrics' => 'leads',
            ],
        ],
        'enquiries' => [
            'kind' => 'kpi',
            'widget' => 'enquiries',
            'data' => [],
        ],
        'stock' => [
            'kind' => 'kpi',
            'widget' => 'stock',
            'data' => [],
        ],
        'enquiry_count' => [
            'kind' => 'kpi',
            'widget' => 'enquiry_count',
            'data' => [],
        ],
        'avg_inventory' => [
            'kind' => 'kpi',
            'widget' => 'avg_inventory',
            'data' => [],
        ],
        'avg_vehicle_age' => [
            'kind' => 'kpi',
            'widget' => 'avg_vehicle_age',
            'data' => [],
        ],
        'reservations_today' => [
            'kind' => 'kpi',
            'widget' => 'reservations_today',
            'feature' => 'reservations',
            'data' => [],
        ],
        'reservations_revenue_today' => [
            'kind' => 'kpi',
            'widget' => 'reservations_revenue_today',
            'feature' => 'reservations',
            'data' => [],
        ],
        'service_bookings_today' => [
            'kind' => 'kpi',
            'widget' => 'service_bookings_today',
            'feature' => 'service-booking',
            'data' => [],
        ],
        'recent-offers' => [
            'kind' => 'section',
            'widget' => 'recent-offers',
            'feature' => 'new-vehicles',
            'data' => [],
        ],
        'recent-vehicles' => [
            'kind' => 'section',
            'widget' => 'recent-vehicles',
            'data' => [],
        ],
        'popular-vehicles' => [
            'kind' => 'section',
            'widget' => 'popular-vehicles',
            'data' => [],
        ],
        'popular-offers' => [
            'kind' => 'section',
            'widget' => 'popular-offers',
            'feature' => 'new-vehicles',
            'data' => [],
        ],
        'popular-new-cars' => [
            'kind' => 'section',
            'widget' => 'popular-new-cars',
            'feature' => 'new-vehicles',
            'data' => [],
        ],
    ],

    'default_dashboard' => [
        'home' => [
            0 => [
                'kind' => 'graph',
                'widget' => 'chart',
                'data' => [
                    'date_range' => 30,
                    'metrics' => 'leads',
                ],
            ],
            1 => [
                'kind' => 'kpi',
                'widget' => 'enquiries',
                'data' => [],
            ],
            2 => [
                'kind' => 'kpi',
                'widget' => 'stock',
                'data' => [],
            ],
            // enquiry_count and avg_inventory are date-range KPIs, loaded via the dashboard range-kpis endpoint.
            5 => [
                'kind' => 'kpi',
                'widget' => 'daily_vehicle_views',
                'data' => [],
            ],
            6 => [
                'kind' => 'kpi',
                'widget' => 'reservations_today',
                'feature' => 'reservations',
                'data' => [],
            ],
            7 => [
                'kind' => 'kpi',
                'widget' => 'reservations_revenue_today',
                'feature' => 'reservations',
                'data' => [],
            ],
            8 => [
                'kind' => 'kpi',
                'widget' => 'service_bookings_today',
                'feature' => 'service-booking',
                'data' => [],
            ],
            9 => [
                'kind' => 'section',
                'widget' => 'popular-vehicles',
                'data' => [],
            ],
            10 => [
                'kind' => 'section',
                'widget' => 'popular-offers',
                'feature' => 'new-vehicles',
                'data' => [],
            ],
            11 => [
                'kind' => 'section',
                'widget' => 'popular-new-cars',
                'feature' => 'new-vehicles',
                'data' => [],
            ],
            12 => [
                'kind' => 'section',
                'widget' => 'recent-offers',
                'feature' => 'new-vehicles',
                'data' => [],
            ],
            13 => [
                'kind' => 'section',
                'widget' => 'recent-vehicles',
                'data' => [],
            ],
        ],
    ],
];
