<?php
declare(strict_types=1);

return [
    ['GET',  '/rentals',                                    'Rentals\Controllers\RentalController@index',           ['auth'], 'rental.view'],
    ['GET',  '/rentals/entities',                           'Rentals\Controllers\RentalController@entities',        ['auth'], 'rental.view'],
    ['GET',  '/rentals/entities/create',                    'Rentals\Controllers\RentalController@createEntity',    ['auth'], 'rental.manage_entity'],
    ['POST', '/rentals/entities',                           'Rentals\Controllers\RentalController@storeEntity',     ['auth', 'csrf'], 'rental.manage_entity'],
    ['GET',  '/rentals/entities/{id:\d+}',                  'Rentals\Controllers\RentalController@showEntity',      ['auth'], 'rental.view'],
    ['GET',  '/rentals/entities/{id:\d+}/edit',             'Rentals\Controllers\RentalController@editEntity',      ['auth'], 'rental.manage_entity'],
    ['POST', '/rentals/entities/{id:\d+}',                  'Rentals\Controllers\RentalController@updateEntity',    ['auth', 'csrf'], 'rental.manage_entity'],
    ['GET',  '/rentals/contracts/create',                   'Rentals\Controllers\RentalController@createContract',  ['auth'], 'rental.manage_contract'],
    ['POST', '/rentals/contracts',                          'Rentals\Controllers\RentalController@storeContract',   ['auth', 'csrf'], 'rental.manage_contract'],
    ['GET',  '/rentals/contracts/{id:\d+}',                 'Rentals\Controllers\RentalController@showContract',    ['auth'], 'rental.view'],
    ['POST', '/rentals/contracts/{id:\d+}/approve',         'Rentals\Controllers\RentalController@approveContract', ['auth', 'csrf'], 'rental.approve'],
    ['POST', '/rentals/contracts/{id:\d+}/deposit/collect', 'Rentals\Controllers\RentalController@collectDeposit',  ['auth', 'csrf'], 'rental.manage_deposit'],
    ['POST', '/rentals/contracts/{id:\d+}/deposit/refund',  'Rentals\Controllers\RentalController@refundDeposit',   ['auth', 'csrf'], 'rental.manage_deposit'],

    // Invoices
    ['GET',  '/rentals/contracts/{id:\d+}/invoices/create',        'Rentals\Controllers\RentalController@createInvoice',        ['auth'], 'rental.manage_contract'],
    ['POST', '/rentals/contracts/{id:\d+}/invoices',               'Rentals\Controllers\RentalController@storeInvoice',         ['auth', 'csrf'], 'rental.manage_contract'],
    ['POST', '/rentals/contracts/{id:\d+}/invoices/bulk-generate', 'Rentals\Controllers\RentalController@bulkGenerateInvoices', ['auth', 'csrf'], 'rental.manage_contract'],
    ['GET',  '/rentals/invoices/{id:\d+}',                         'Rentals\Controllers\RentalController@showInvoice',          ['auth'], 'rental.view'],
    ['POST', '/rentals/invoices/{id:\d+}/pay',                     'Rentals\Controllers\RentalController@payInvoice',           ['auth', 'csrf'], 'rental.manage_contract'],
];
