<?php
return [
    // ── Page Routes ──
    ['GET',  '/reports',                        'ReportController@index',           'reports.view'],
    ['GET',  '/reports/kpis',                   'ReportController@kpis',            'reports.view'],
    ['GET',  '/reports/custom',                 'ReportController@custom',          'reports.custom'],
    ['GET',  '/reports/dashboard-config',       'ReportController@dashboardConfig', 'reports.view'],
    ['GET',  '/reports/schedules',              'ScheduleController@index',         'reports.schedule'],
    ['GET',  '/reports/schedules/create',       'ScheduleController@create',        'reports.schedule'],
    ['GET',  '/reports/schedules/{id}/edit',    'ScheduleController@edit',          'reports.schedule'],
    ['GET',  '/reports/{id}',                   'ReportController@view',            'reports.view'],

    // ── API: Reports ──
    ['POST', '/api/reports/init',               'ReportApiController@initReports',     'reports.view'],
    ['POST', '/api/reports/execute/{id}',       'ReportApiController@execute',         'reports.view'],
    ['POST', '/api/reports/export/{id}',        'ReportApiController@export',          'reports.view'],
    ['GET',  '/api/reports/kpi-data',           'ReportApiController@kpiData',         'reports.view'],
    ['GET',  '/api/reports/revenue-chart',      'ReportApiController@revenueChart',    'reports.view'],
    ['GET',  '/api/reports/member-growth',      'ReportApiController@memberGrowth',    'reports.view'],
    ['POST', '/api/reports/favorites',          'ReportApiController@saveFavorite',    'reports.view'],
    ['POST', '/api/reports/favorites/delete',   'ReportApiController@deleteFavorite',  'reports.view'],
    ['GET',  '/api/reports/favorites',          'ReportApiController@listFavorites',   'reports.view'],

    // ── API: Custom Builder ──
    ['GET',  '/api/reports/custom/sources',     'CustomReportApiController@sources',   'reports.custom'],
    ['POST', '/api/reports/custom/columns',     'CustomReportApiController@columns',   'reports.custom'],
    ['POST', '/api/reports/custom/preview',     'CustomReportApiController@preview',   'reports.custom'],
    ['POST', '/api/reports/custom/save',        'CustomReportApiController@save',      'reports.custom'],

    // ── API: Schedules ──
    ['GET',  '/api/reports/schedules/datatable','ScheduleApiController@datatable',     'reports.schedule'],
    ['POST', '/api/reports/schedules',          'ScheduleApiController@store',         'reports.schedule'],
    ['POST', '/api/reports/schedules/{id}',     'ScheduleApiController@update',        'reports.schedule'],
    ['POST', '/api/reports/schedules/{id}/delete','ScheduleApiController@destroy',     'reports.schedule'],
    ['POST', '/api/reports/schedules/{id}/toggle','ScheduleApiController@toggle',      'reports.schedule'],
    ['GET',  '/api/reports/schedules/{id}/runs','ScheduleApiController@runs',          'reports.schedule'],

    // ── API: Dashboard Config ──
    ['GET',  '/api/reports/dashboard-config',   'DashboardConfigApiController@load',   'reports.view'],
    ['POST', '/api/reports/dashboard-config',   'DashboardConfigApiController@save',   'reports.view'],
];