<?php
declare(strict_types=1);

return [
    ['GET',  '/installments',                           'Installments\Controllers\InstallmentController@index',          ['auth'], 'installment.view'],
    ['GET',  '/installments/create/{memberId}',         'Installments\Controllers\InstallmentController@create',         ['auth'], 'installment.create'],
    ['POST', '/installments/store/{memberId}',          'Installments\Controllers\InstallmentController@store',          ['auth', 'csrf'], 'installment.create_plan'],
    ['GET',  '/installments/{id}',                      'Installments\Controllers\InstallmentController@show',           ['auth'], 'installment.view'],
    ['POST', '/installments/{planId}/pay/{scheduleId}', 'Installments\Controllers\InstallmentController@payInstallment', ['auth', 'csrf'], 'installment.pay'],
    ['POST', '/installments/{id}/recalculate',          'Installments\Controllers\InstallmentController@recalculate',    ['auth', 'csrf'], 'installment.create_plan'],

    // Early settlement
    ['GET',  '/installments/{id}/early-settlement',              'Installments\Controllers\InstallmentController@earlySettlement',       ['auth'], 'installment.pay'],
    ['POST', '/installments/{id}/early-settlement',              'Installments\Controllers\InstallmentController@processEarlySettlement', ['auth', 'csrf'], 'installment.pay'],
    ['GET',  '/installments/{id}/settlement-receipt/{receiptId}','Installments\Controllers\InstallmentController@settlementReceipt',     ['auth'], 'installment.view'],

    // Cheque uploads
    ['GET',  '/installments/{planId}/cheques',           'Installments\Controllers\ChequeController@index',              ['auth'], 'installment.view'],
    ['POST', '/installments/{planId}/cheques',           'Installments\Controllers\ChequeController@store',              ['auth', 'csrf'], 'installment.create_plan'],
    ['POST', '/installments/{planId}/cheques/batch',     'Installments\Controllers\ChequeController@storeBatch',         ['auth', 'csrf'], 'installment.create_plan'],
];