<?php
declare(strict_types=1);

return [
    // Dashboard
    ['GET',  '/sa',                                             'SportsActivity\Controllers\DashboardController@index',         ['auth'], 'sa.dashboard'],

    // Disciplines
    ['GET',  '/sa/disciplines',                                 'SportsActivity\Controllers\DisciplineController@index',        ['auth'], 'sa.discipline.view'],
    ['GET',  '/sa/disciplines/create',                          'SportsActivity\Controllers\DisciplineController@create',       ['auth'], 'sa.discipline.manage'],
    ['POST', '/sa/disciplines',                                 'SportsActivity\Controllers\DisciplineController@store',        ['auth', 'csrf'], 'sa.discipline.manage'],
    ['GET',  '/sa/disciplines/{id:\d+}',                        'SportsActivity\Controllers\DisciplineController@show',         ['auth'], 'sa.discipline.view'],
    ['GET',  '/sa/disciplines/{id:\d+}/edit',                   'SportsActivity\Controllers\DisciplineController@edit',         ['auth'], 'sa.discipline.manage'],
    ['POST', '/sa/disciplines/{id:\d+}',                        'SportsActivity\Controllers\DisciplineController@update',       ['auth', 'csrf'], 'sa.discipline.manage'],
    ['POST', '/sa/disciplines/{id:\d+}/toggle',                 'SportsActivity\Controllers\DisciplineController@toggle',       ['auth', 'csrf'], 'sa.discipline.manage'],

    // Facilities
    ['GET',  '/sa/facilities',                                  'SportsActivity\Controllers\FacilityController@index',          ['auth'], 'sa.facility.view'],
    ['GET',  '/sa/facilities/create',                           'SportsActivity\Controllers\FacilityController@create',         ['auth'], 'sa.facility.manage'],
    ['POST', '/sa/facilities',                                  'SportsActivity\Controllers\FacilityController@store',          ['auth', 'csrf'], 'sa.facility.manage'],
    ['GET',  '/sa/facilities/{id:\d+}',                         'SportsActivity\Controllers\FacilityController@show',           ['auth'], 'sa.facility.view'],
    ['GET',  '/sa/facilities/{id:\d+}/edit',                    'SportsActivity\Controllers\FacilityController@edit',           ['auth'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{id:\d+}',                         'SportsActivity\Controllers\FacilityController@update',         ['auth', 'csrf'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{id:\d+}/toggle',                  'SportsActivity\Controllers\FacilityController@toggle',         ['auth', 'csrf'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{id:\d+}/blackout',                'SportsActivity\Controllers\FacilityController@addBlackout',    ['auth', 'csrf'], 'sa.facility.manage'],

    // Facility Units
    ['GET',  '/sa/facilities/{fid:\d+}/units',                  'SportsActivity\Controllers\FacilityUnitController@index',      ['auth'], 'sa.facility.view'],
    ['GET',  '/sa/facilities/{fid:\d+}/units/create',           'SportsActivity\Controllers\FacilityUnitController@create',     ['auth'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{fid:\d+}/units',                  'SportsActivity\Controllers\FacilityUnitController@store',      ['auth', 'csrf'], 'sa.facility.manage'],
    ['GET',  '/sa/facilities/{fid:\d+}/units/{id:\d+}/edit',    'SportsActivity\Controllers\FacilityUnitController@edit',       ['auth'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{fid:\d+}/units/{id:\d+}',         'SportsActivity\Controllers\FacilityUnitController@update',     ['auth', 'csrf'], 'sa.facility.manage'],

    // Time Brackets
    ['GET',  '/sa/facilities/{fid:\d+}/brackets',               'SportsActivity\Controllers\FacilityController@brackets',       ['auth'], 'sa.facility.view'],
    ['POST', '/sa/facilities/{fid:\d+}/brackets',               'SportsActivity\Controllers\FacilityController@storeBracket',   ['auth', 'csrf'], 'sa.facility.manage'],
    ['POST', '/sa/facilities/{fid:\d+}/brackets/{id:\d+}/delete', 'SportsActivity\Controllers\FacilityController@deleteBracket', ['auth', 'csrf'], 'sa.facility.manage'],

    // Coaches
    ['GET',  '/sa/coaches',                                     'SportsActivity\Controllers\CoachController@index',             ['auth'], 'sa.coach.view'],
    ['GET',  '/sa/coaches/create',                              'SportsActivity\Controllers\CoachController@create',            ['auth'], 'sa.coach.manage'],
    ['POST', '/sa/coaches',                                     'SportsActivity\Controllers\CoachController@store',             ['auth', 'csrf'], 'sa.coach.manage'],
    ['GET',  '/sa/coaches/{id:\d+}',                            'SportsActivity\Controllers\CoachController@show',              ['auth'], 'sa.coach.view'],
    ['GET',  '/sa/coaches/{id:\d+}/edit',                       'SportsActivity\Controllers\CoachController@edit',              ['auth'], 'sa.coach.manage'],
    ['POST', '/sa/coaches/{id:\d+}',                            'SportsActivity\Controllers\CoachController@update',            ['auth', 'csrf'], 'sa.coach.manage'],
    ['POST', '/sa/coaches/{id:\d+}/toggle',                     'SportsActivity\Controllers\CoachController@toggle',            ['auth', 'csrf'], 'sa.coach.manage'],

    // Players
    ['GET',  '/sa/players',                                     'SportsActivity\Controllers\PlayerController@index',            ['auth'], 'sa.player.view'],
    ['GET',  '/sa/players/create',                              'SportsActivity\Controllers\PlayerController@create',           ['auth'], 'sa.player.manage'],
    ['POST', '/sa/players',                                     'SportsActivity\Controllers\PlayerController@store',            ['auth', 'csrf'], 'sa.player.manage'],
    ['GET',  '/sa/players/{id:\d+}',                            'SportsActivity\Controllers\PlayerController@show',             ['auth'], 'sa.player.view'],
    ['GET',  '/sa/players/{id:\d+}/edit',                       'SportsActivity\Controllers\PlayerController@edit',             ['auth'], 'sa.player.manage'],
    ['POST', '/sa/players/{id:\d+}',                            'SportsActivity\Controllers\PlayerController@update',           ['auth', 'csrf'], 'sa.player.manage'],

    // Player Documents
    ['GET',  '/sa/players/{pid:\d+}/documents',                 'SportsActivity\Controllers\PlayerDocumentController@index',    ['auth'], 'sa.player.view'],
    ['POST', '/sa/players/{pid:\d+}/documents',                 'SportsActivity\Controllers\PlayerDocumentController@upload',   ['auth', 'csrf'], 'sa.player.manage'],
    ['POST', '/sa/players/{pid:\d+}/documents/{id:\d+}/approve', 'SportsActivity\Controllers\PlayerDocumentController@approve', ['auth', 'csrf'], 'sa.medical.approve'],
    ['POST', '/sa/players/{pid:\d+}/documents/{id:\d+}/reject', 'SportsActivity\Controllers\PlayerDocumentController@reject',   ['auth', 'csrf'], 'sa.medical.approve'],

    // Academies
    ['GET',  '/sa/academies',                                   'SportsActivity\Controllers\AcademyController@index',           ['auth'], 'sa.academy.view'],
    ['GET',  '/sa/academies/create',                            'SportsActivity\Controllers\AcademyController@create',          ['auth'], 'sa.academy.manage'],
    ['POST', '/sa/academies',                                   'SportsActivity\Controllers\AcademyController@store',           ['auth', 'csrf'], 'sa.academy.manage'],
    ['GET',  '/sa/academies/{id:\d+}',                          'SportsActivity\Controllers\AcademyController@show',            ['auth'], 'sa.academy.view'],
    ['GET',  '/sa/academies/{id:\d+}/edit',                     'SportsActivity\Controllers\AcademyController@edit',            ['auth'], 'sa.academy.manage'],
    ['POST', '/sa/academies/{id:\d+}',                          'SportsActivity\Controllers\AcademyController@update',          ['auth', 'csrf'], 'sa.academy.manage'],

    // Academy Contracts
    ['GET',  '/sa/academies/{aid:\d+}/contracts',               'SportsActivity\Controllers\AcademyContractController@index',   ['auth'], 'sa.contract.view'],
    ['GET',  '/sa/academies/{aid:\d+}/contracts/create',        'SportsActivity\Controllers\AcademyContractController@create',  ['auth'], 'sa.contract.manage'],
    ['POST', '/sa/academies/{aid:\d+}/contracts',               'SportsActivity\Controllers\AcademyContractController@store',   ['auth', 'csrf'], 'sa.contract.manage'],
    ['GET',  '/sa/academy-contracts/{id:\d+}',                  'SportsActivity\Controllers\AcademyContractController@show',    ['auth'], 'sa.contract.view'],
    ['POST', '/sa/academy-contracts/{id:\d+}/approve',          'SportsActivity\Controllers\AcademyContractController@approve', ['auth', 'csrf'], 'sa.contract.approve'],

    // Programs
    ['GET',  '/sa/programs',                                    'SportsActivity\Controllers\ProgramController@index',           ['auth'], 'sa.program.view'],
    ['GET',  '/sa/programs/create',                             'SportsActivity\Controllers\ProgramController@create',          ['auth'], 'sa.program.manage'],
    ['POST', '/sa/programs',                                    'SportsActivity\Controllers\ProgramController@store',           ['auth', 'csrf'], 'sa.program.manage'],
    ['GET',  '/sa/programs/{id:\d+}',                           'SportsActivity\Controllers\ProgramController@show',            ['auth'], 'sa.program.view'],
    ['GET',  '/sa/programs/{id:\d+}/edit',                      'SportsActivity\Controllers\ProgramController@edit',            ['auth'], 'sa.program.manage'],
    ['POST', '/sa/programs/{id:\d+}',                           'SportsActivity\Controllers\ProgramController@update',          ['auth', 'csrf'], 'sa.program.manage'],

    // Groups
    ['GET',  '/sa/groups',                                      'SportsActivity\Controllers\GroupController@index',             ['auth'], 'sa.group.view'],
    ['GET',  '/sa/groups/create',                               'SportsActivity\Controllers\GroupController@create',            ['auth'], 'sa.group.manage'],
    ['POST', '/sa/groups',                                      'SportsActivity\Controllers\GroupController@store',             ['auth', 'csrf'], 'sa.group.manage'],
    ['GET',  '/sa/groups/{id:\d+}',                             'SportsActivity\Controllers\GroupController@show',              ['auth'], 'sa.group.view'],
    ['GET',  '/sa/groups/{id:\d+}/edit',                        'SportsActivity\Controllers\GroupController@edit',              ['auth'], 'sa.group.manage'],
    ['POST', '/sa/groups/{id:\d+}',                             'SportsActivity\Controllers\GroupController@update',            ['auth', 'csrf'], 'sa.group.manage'],
    ['POST', '/sa/groups/{id:\d+}/enroll',                      'SportsActivity\Controllers\GroupController@enroll',            ['auth', 'csrf'], 'sa.group.enroll'],
    ['POST', '/sa/groups/{id:\d+}/remove-player',               'SportsActivity\Controllers\GroupController@removePlayer',      ['auth', 'csrf'], 'sa.group.manage'],
    ['POST', '/sa/groups/{id:\d+}/schedule',                    'SportsActivity\Controllers\GroupController@saveSchedule',      ['auth', 'csrf'], 'sa.group.manage'],

    // Schedule
    ['GET',  '/sa/schedule',                                    'SportsActivity\Controllers\ScheduleController@calendar',       ['auth'], 'sa.schedule.view'],
    ['GET',  '/sa/schedule/daily/{date}',                       'SportsActivity\Controllers\ScheduleController@daily',          ['auth'], 'sa.schedule.view'],
    ['GET',  '/sa/schedule/weekly',                             'SportsActivity\Controllers\ScheduleController@weekly',         ['auth'], 'sa.schedule.view'],
    ['POST', '/sa/schedule/generate',                           'SportsActivity\Controllers\ScheduleController@generate',       ['auth', 'csrf'], 'sa.schedule.manage'],

    // Bookings
    ['GET',  '/sa/bookings',                                    'SportsActivity\Controllers\BookingController@index',           ['auth'], 'sa.booking.view'],
    ['GET',  '/sa/bookings/create',                             'SportsActivity\Controllers\BookingController@create',          ['auth'], 'sa.booking.create'],
    ['POST', '/sa/bookings',                                    'SportsActivity\Controllers\BookingController@store',           ['auth', 'csrf'], 'sa.booking.create'],
    ['GET',  '/sa/bookings/{id:\d+}',                           'SportsActivity\Controllers\BookingController@show',            ['auth'], 'sa.booking.view'],
    ['POST', '/sa/bookings/{id:\d+}/cancel',                    'SportsActivity\Controllers\BookingController@cancel',          ['auth', 'csrf'], 'sa.booking.manage'],
    ['POST', '/sa/bookings/{id:\d+}/checkin',                   'SportsActivity\Controllers\BookingController@checkin',         ['auth', 'csrf'], 'sa.booking.manage'],
    ['POST', '/sa/bookings/{id:\d+}/checkout',                  'SportsActivity\Controllers\BookingController@checkout',        ['auth', 'csrf'], 'sa.booking.manage'],

    // Pricing
    ['GET',  '/sa/pricing',                                     'SportsActivity\Controllers\PricingController@index',           ['auth'], 'sa.pricing.view'],
    ['GET',  '/sa/pricing/rules',                               'SportsActivity\Controllers\PricingController@rules',           ['auth'], 'sa.pricing.manage'],
    ['POST', '/sa/pricing/rules',                               'SportsActivity\Controllers\PricingController@storeRule',       ['auth', 'csrf'], 'sa.pricing.manage'],
    ['POST', '/sa/pricing/rules/{id:\d+}',                      'SportsActivity\Controllers\PricingController@updateRule',      ['auth', 'csrf'], 'sa.pricing.manage'],
    ['POST', '/sa/pricing/rules/{id:\d+}/deactivate',           'SportsActivity\Controllers\PricingController@deactivateRule',  ['auth', 'csrf'], 'sa.pricing.manage'],

    // Subscriptions
    ['GET',  '/sa/subscriptions',                               'SportsActivity\Controllers\SubscriptionController@index',      ['auth'], 'sa.subscription.view'],
    ['POST', '/sa/subscriptions/generate',                      'SportsActivity\Controllers\SubscriptionController@generate',   ['auth', 'csrf'], 'sa.subscription.generate'],
    ['GET',  '/sa/subscriptions/{id:\d+}',                      'SportsActivity\Controllers\SubscriptionController@show',       ['auth'], 'sa.subscription.view'],
    ['POST', '/sa/subscriptions/{id:\d+}/pay',                  'SportsActivity\Controllers\SubscriptionController@pay',        ['auth', 'csrf'], 'sa.subscription.collect'],
    ['POST', '/sa/subscriptions/{id:\d+}/exempt',               'SportsActivity\Controllers\SubscriptionController@exempt',     ['auth', 'csrf'], 'sa.subscription.exempt'],

    // Attendance
    ['GET',  '/sa/attendance',                                  'SportsActivity\Controllers\AttendanceController@index',        ['auth'], 'sa.attendance.view'],
    ['GET',  '/sa/attendance/record/{bookingId:\d+}',           'SportsActivity\Controllers\AttendanceController@record',       ['auth'], 'sa.attendance.manage'],
    ['POST', '/sa/attendance/record/{bookingId:\d+}',           'SportsActivity\Controllers\AttendanceController@store',        ['auth', 'csrf'], 'sa.attendance.manage'],
    ['GET',  '/sa/attendance/report',                           'SportsActivity\Controllers\AttendanceController@report',       ['auth'], 'sa.attendance.view'],

    // Mirror (read-only display)
    ['GET',  '/sa/mirror',                                      'SportsActivity\Controllers\MirrorController@index',            ['auth'], 'sa.mirror.view'],
    ['GET',  '/sa/mirror/facility/{id:\d+}',                    'SportsActivity\Controllers\MirrorController@facility',         ['auth'], 'sa.mirror.view'],
    ['GET',  '/sa/mirror/facility/{id:\d+}/{date}',             'SportsActivity\Controllers\MirrorController@facilityDate',     ['auth'], 'sa.mirror.view'],

    // Waitlist
    ['GET',  '/sa/waitlist',                                    'SportsActivity\Controllers\WaitlistController@index',          ['auth'], 'sa.waitlist.view'],
    ['POST', '/sa/waitlist/{id:\d+}/offer',                     'SportsActivity\Controllers\WaitlistController@offer',          ['auth', 'csrf'], 'sa.waitlist.manage'],
    ['POST', '/sa/waitlist/{id:\d+}/cancel',                    'SportsActivity\Controllers\WaitlistController@cancel',         ['auth', 'csrf'], 'sa.waitlist.manage'],

    // JSON APIs (AJAX)
    ['GET',  '/api/sa/schedule/availability',                   'SportsActivity\Controllers\Api\ScheduleApiController@availability',  ['auth'], 'sa.schedule.view'],
    ['GET',  '/api/sa/schedule/conflicts',                      'SportsActivity\Controllers\Api\ScheduleApiController@conflicts',     ['auth'], 'sa.schedule.view'],
    ['GET',  '/api/sa/bookings/price-preview',                  'SportsActivity\Controllers\Api\BookingApiController@pricePreview',   ['auth'], 'sa.booking.create'],
    ['GET',  '/api/sa/players/search',                          'SportsActivity\Controllers\Api\PlayerSearchApiController@search',    ['auth'], 'sa.player.view'],
    ['GET',  '/api/sa/mirror/{id:\d+}/state',                   'SportsActivity\Controllers\Api\MirrorApiController@state',           ['auth'], 'sa.mirror.view'],
];
