<?php
return [
    // ─── Invoices ───
    ['GET',  '/finance/invoices',              'InvoiceController@index',         'invoices.view'],
    ['GET',  '/finance/invoices/datatable',    'InvoiceController@datatable',     'invoices.view'],
    ['GET',  '/finance/invoices/create',       'InvoiceController@create',        'invoices.create'],
    ['POST', '/finance/invoices',              'InvoiceController@store',         'invoices.create'],
    ['GET',  '/finance/invoices/{id}',         'InvoiceController@show',          'invoices.view'],
    ['POST', '/finance/invoices/{id}/issue',   'InvoiceController@issue',         'invoices.create'],
    ['POST', '/finance/invoices/{id}/void',    'InvoiceController@void',          'invoices.void'],

    // ─── Payments ───
    ['GET',  '/finance/payments',              'PaymentController@index',         'payments.view'],
    ['GET',  '/finance/payments/datatable',    'PaymentController@datatable',     'payments.view'],
    ['GET',  '/finance/payments/create',       'PaymentController@create',        'payments.create'],
    ['POST', '/finance/payments',              'PaymentController@store',         'payments.create'],
    ['GET',  '/finance/payments/{id}',         'PaymentController@show',          'payments.view'],

    // ─── Receipts ───
    ['GET',  '/finance/receipts',              'ReceiptController@index',         'receipts.view'],
    ['GET',  '/finance/receipts/datatable',    'ReceiptController@datatable',     'receipts.view'],
    ['GET',  '/finance/receipts/{id}',         'ReceiptController@show',          'receipts.view'],
    ['GET',  '/finance/receipts/{id}/print',   'ReceiptController@printReceipt', 'receipts.print'],

    // ─── Cash Register ───
    ['GET',  '/finance/cashier',               'CashRegisterController@index',    'cash_register.open'],
    ['POST', '/finance/cashier/open',          'CashRegisterController@open',     'cash_register.open'],
    ['POST', '/finance/cashier/close',         'CashRegisterController@close',    'cash_register.close'],
    ['GET',  '/finance/cashier/sessions',      'CashRegisterController@sessions', 'cash_register.open'],
    ['GET',  '/finance/cashier/sessions/datatable', 'CashRegisterController@sessionsDatatable', 'cash_register.open'],

    // ─── Fee Types ───
    ['GET',  '/finance/fee-types',             'FeeTypeController@index',         'invoices.view'],
    ['GET',  '/finance/fee-types/datatable',   'FeeTypeController@datatable',     'invoices.view'],
    ['POST', '/finance/fee-types',             'FeeTypeController@store',         'invoices.create'],
    ['POST', '/finance/fee-types/{id}',        'FeeTypeController@update',        'invoices.create'],

    // ─── Payment Methods ───
    ['GET',  '/finance/payment-methods',           'PaymentMethodController@index',     'payments.view'],
    ['GET',  '/finance/payment-methods/datatable', 'PaymentMethodController@datatable', 'payments.view'],
    ['POST', '/finance/payment-methods',           'PaymentMethodController@store',     'payments.create'],
    ['POST', '/finance/payment-methods/{id}',      'PaymentMethodController@update',    'payments.create'],

    // ─── Fiscal Years ───
    ['GET',  '/finance/fiscal-years',              'FiscalYearController@index',     'invoices.view'],
    ['GET',  '/finance/fiscal-years/datatable',    'FiscalYearController@datatable', 'invoices.view'],
    ['POST', '/finance/fiscal-years',              'FiscalYearController@store',     'invoices.create'],
    ['POST', '/finance/fiscal-years/{id}',         'FiscalYearController@update',    'invoices.create'],
    ['POST', '/finance/fiscal-years/{id}/periods', 'FiscalYearController@storePeriod', 'invoices.create'],

    // ─── Member Statement ───
    ['GET',  '/finance/statement/{id}',        'MemberStatementController@show',  'invoices.view'],

    // ─── Reports ───
    ['GET',  '/finance/reports/daily-revenue',          'RevenueReportController@index',     'payments.view'],
    ['GET',  '/finance/reports/daily-revenue/data',     'RevenueReportController@data',      'payments.view'],
    ['GET',  '/finance/reports/overdue',                'OverdueReportController@index',     'invoices.view'],
    ['GET',  '/finance/reports/overdue/datatable',      'OverdueReportController@datatable', 'invoices.view'],

    // ─── API helpers ───
    ['GET',  '/finance/api/members/search',    'InvoiceController@memberSearch',  'invoices.view'],
    ['GET',  '/finance/api/fee-types/list',    'FeeTypeController@listActive',    'invoices.view'],
    ['GET',  '/finance/api/invoices/for-member', 'InvoiceController@forMember',   'payments.create'],
];