<?php
return [
    // ── Installment Plans ──
    ['GET',  '/advanced-finance/installments',                'InstallmentController@index',          'installments.view'],
    ['GET',  '/advanced-finance/installments/datatable',      'InstallmentController@datatable',      'installments.view'],
    ['GET',  '/advanced-finance/installments/create',         'InstallmentController@create',         'installments.create'],
    ['POST', '/advanced-finance/installments/store',          'InstallmentController@store',          'installments.create'],
    ['GET',  '/advanced-finance/installments/{id}',           'InstallmentController@show',           'installments.view'],
    ['POST', '/advanced-finance/installments/{id}/pay',       'InstallmentController@recordPayment',  'installments.create'],
    ['POST', '/advanced-finance/installments/{id}/default',   'InstallmentController@markDefaulted',  'installments.create'],

    // ── Installment Templates ──
    ['GET',  '/advanced-finance/installment-templates',              'InstallmentTemplateController@index',     'installments.create'],
    ['GET',  '/advanced-finance/installment-templates/datatable',    'InstallmentTemplateController@datatable', 'installments.create'],
    ['GET',  '/advanced-finance/installment-templates/create',       'InstallmentTemplateController@create',    'installments.create'],
    ['POST', '/advanced-finance/installment-templates/store',        'InstallmentTemplateController@store',     'installments.create'],
    ['GET',  '/advanced-finance/installment-templates/{id}/edit',    'InstallmentTemplateController@edit',      'installments.create'],
    ['POST', '/advanced-finance/installment-templates/{id}',         'InstallmentTemplateController@update',    'installments.create'],
    ['POST', '/advanced-finance/installment-templates/{id}/delete',  'InstallmentTemplateController@delete',    'installments.create'],

    // ── Checks ──
    ['GET',  '/advanced-finance/checks',                'CheckController@index',        'installments.view'],
    ['GET',  '/advanced-finance/checks/datatable',      'CheckController@datatable',    'installments.view'],
    ['GET',  '/advanced-finance/checks/create',         'CheckController@create',       'installments.create'],
    ['POST', '/advanced-finance/checks/store',          'CheckController@store',        'installments.create'],
    ['GET',  '/advanced-finance/checks/{id}',           'CheckController@show',         'installments.view'],
    ['POST', '/advanced-finance/checks/{id}/status',    'CheckController@updateStatus', 'installments.create'],

    // ── Credit Notes ──
    ['GET',  '/advanced-finance/credit-notes',              'CreditNoteController@index',     'installments.view'],
    ['GET',  '/advanced-finance/credit-notes/datatable',    'CreditNoteController@datatable', 'installments.view'],
    ['GET',  '/advanced-finance/credit-notes/create',       'CreditNoteController@create',    'installments.create'],
    ['POST', '/advanced-finance/credit-notes/store',        'CreditNoteController@store',     'installments.create'],
    ['GET',  '/advanced-finance/credit-notes/{id}',         'CreditNoteController@show',      'installments.view'],
    ['POST', '/advanced-finance/credit-notes/{id}/apply',   'CreditNoteController@apply',     'installments.create'],
    ['POST', '/advanced-finance/credit-notes/{id}/issue',   'CreditNoteController@issue',     'installments.create'],

    // ── Refunds ──
    ['GET',  '/advanced-finance/refunds',                  'RefundController@index',    'refunds.create'],
    ['GET',  '/advanced-finance/refunds/datatable',        'RefundController@datatable','refunds.create'],
    ['GET',  '/advanced-finance/refunds/create',           'RefundController@create',   'refunds.create'],
    ['POST', '/advanced-finance/refunds/store',            'RefundController@store',    'refunds.create'],
    ['GET',  '/advanced-finance/refunds/{id}',             'RefundController@show',     'refunds.create'],
    ['POST', '/advanced-finance/refunds/{id}/approve',     'RefundController@approve',  'refunds.approve'],
    ['POST', '/advanced-finance/refunds/{id}/process',     'RefundController@process',  'refunds.approve'],
    ['POST', '/advanced-finance/refunds/{id}/reject',      'RefundController@reject',   'refunds.approve'],

    // ── Write-Offs ──
    ['GET',  '/advanced-finance/write-offs',                  'WriteOffController@index',    'installments.view'],
    ['GET',  '/advanced-finance/write-offs/datatable',        'WriteOffController@datatable','installments.view'],
    ['GET',  '/advanced-finance/write-offs/create',           'WriteOffController@create',   'installments.create'],
    ['POST', '/advanced-finance/write-offs/store',            'WriteOffController@store',    'installments.create'],
    ['GET',  '/advanced-finance/write-offs/{id}',             'WriteOffController@show',     'installments.view'],
    ['POST', '/advanced-finance/write-offs/{id}/approve',     'WriteOffController@approve',  'refunds.approve'],
    ['POST', '/advanced-finance/write-offs/{id}/post',        'WriteOffController@post',     'gl.manage'],

    // ── Bank Accounts ──
    ['GET',  '/advanced-finance/bank-accounts',              'BankAccountController@index',     'gl.view'],
    ['GET',  '/advanced-finance/bank-accounts/datatable',    'BankAccountController@datatable', 'gl.view'],
    ['GET',  '/advanced-finance/bank-accounts/create',       'BankAccountController@create',    'gl.manage'],
    ['POST', '/advanced-finance/bank-accounts/store',        'BankAccountController@store',     'gl.manage'],
    ['GET',  '/advanced-finance/bank-accounts/{id}/edit',    'BankAccountController@edit',      'gl.manage'],
    ['POST', '/advanced-finance/bank-accounts/{id}',         'BankAccountController@update',    'gl.manage'],

    // ── Bank Deposits ──
    ['GET',  '/advanced-finance/deposits',                  'BankDepositController@index',     'gl.view'],
    ['GET',  '/advanced-finance/deposits/datatable',        'BankDepositController@datatable', 'gl.view'],
    ['GET',  '/advanced-finance/deposits/create',           'BankDepositController@create',    'gl.manage'],
    ['POST', '/advanced-finance/deposits/store',            'BankDepositController@store',     'gl.manage'],
    ['GET',  '/advanced-finance/deposits/{id}',             'BankDepositController@show',      'gl.view'],
    ['POST', '/advanced-finance/deposits/{id}/confirm',     'BankDepositController@confirm',   'gl.manage'],

    // ── General Ledger ──
    ['GET',  '/advanced-finance/gl',                                 'GLController@accounts',              'gl.view'],
    ['GET',  '/advanced-finance/gl/accounts/datatable',              'GLController@accountsDatatable',     'gl.view'],
    ['GET',  '/advanced-finance/gl/journal-entries',                  'GLController@journalEntries',        'gl.view'],
    ['GET',  '/advanced-finance/gl/journal-entries/datatable',        'GLController@journalEntriesDatatable','gl.view'],
    ['GET',  '/advanced-finance/gl/journal-entries/create',           'GLController@createJournalEntry',    'gl.manage'],
    ['POST', '/advanced-finance/gl/journal-entries/store',            'GLController@storeJournalEntry',     'gl.manage'],
    ['GET',  '/advanced-finance/gl/journal-entries/{id}',             'GLController@showJournalEntry',      'gl.view'],
    ['POST', '/advanced-finance/gl/journal-entries/{id}/post',        'GLController@postJournalEntry',      'gl.manage'],
    ['POST', '/advanced-finance/gl/journal-entries/{id}/reverse',     'GLController@reverseJournalEntry',   'gl.manage'],
    ['GET',  '/advanced-finance/gl/balances',                         'GLController@balances',              'gl.view'],

    // ── Budgets ──
    ['GET',  '/advanced-finance/budgets',              'BudgetController@index',     'budget.view'],
    ['GET',  '/advanced-finance/budgets/datatable',    'BudgetController@datatable', 'budget.view'],
    ['GET',  '/advanced-finance/budgets/create',       'BudgetController@create',    'budget.manage'],
    ['POST', '/advanced-finance/budgets/store',        'BudgetController@store',     'budget.manage'],
    ['GET',  '/advanced-finance/budgets/{id}/edit',    'BudgetController@edit',      'budget.manage'],
    ['POST', '/advanced-finance/budgets/{id}',         'BudgetController@update',    'budget.manage'],

    // ── API: member search helper ──
    ['GET',  '/advanced-finance/api/member-search',    'AdvFinanceApiController@memberSearch',  'installments.view'],
    ['GET',  '/advanced-finance/api/invoice-search',   'AdvFinanceApiController@invoiceSearch',  'installments.view'],
];