<?php
declare(strict_types=1);

return [
    // ── Dashboard ────────────────────────────────────────────
    ['GET',  '/accounting',                                      'Accounting\Controllers\ReportController@dashboard',              ['auth'], 'accounting.reports.view'],

    // ── Fiscal Years ─────────────────────────────────────────
    ['GET',  '/accounting/fiscal-years',                         'Accounting\Controllers\FiscalYearController@index',              ['auth'], 'accounting.fiscal_year.view'],
    ['GET',  '/accounting/fiscal-years/create',                  'Accounting\Controllers\FiscalYearController@create',             ['auth'], 'accounting.fiscal_year.manage'],
    ['POST', '/accounting/fiscal-years',                         'Accounting\Controllers\FiscalYearController@store',              ['auth', 'csrf'], 'accounting.fiscal_year.manage'],
    ['GET',  '/accounting/fiscal-years/{id:\d+}',                'Accounting\Controllers\FiscalYearController@show',               ['auth'], 'accounting.fiscal_year.view'],
    ['POST', '/accounting/fiscal-years/{id:\d+}/close',          'Accounting\Controllers\FiscalYearController@close',              ['auth', 'csrf'], 'accounting.fiscal_year.close'],

    // ── Chart of Accounts ────────────────────────────────────
    ['GET',  '/accounting/chart-of-accounts',                    'Accounting\Controllers\ChartOfAccountsController@index',         ['auth'], 'accounting.coa.view'],
    ['GET',  '/accounting/chart-of-accounts/create',             'Accounting\Controllers\ChartOfAccountsController@create',        ['auth'], 'accounting.coa.manage'],
    ['POST', '/accounting/chart-of-accounts',                    'Accounting\Controllers\ChartOfAccountsController@store',         ['auth', 'csrf'], 'accounting.coa.manage'],
    ['GET',  '/accounting/chart-of-accounts/{id:\d+}/edit',      'Accounting\Controllers\ChartOfAccountsController@edit',          ['auth'], 'accounting.coa.manage'],
    ['POST', '/accounting/chart-of-accounts/{id:\d+}',           'Accounting\Controllers\ChartOfAccountsController@update',        ['auth', 'csrf'], 'accounting.coa.manage'],
    ['GET',  '/accounting/chart-of-accounts/search',             'Accounting\Controllers\ChartOfAccountsController@search',        ['auth'], 'accounting.coa.view'],

    // ── Journal Types ────────────────────────────────────────
    ['GET',  '/accounting/journal-types',                        'Accounting\Controllers\JournalTypeController@index',             ['auth'], 'accounting.journal_type.view'],
    ['POST', '/accounting/journal-types',                        'Accounting\Controllers\JournalTypeController@store',             ['auth', 'csrf'], 'accounting.journal_type.manage'],
    ['GET',  '/accounting/journal-types/{id:\d+}/edit',          'Accounting\Controllers\JournalTypeController@edit',              ['auth'], 'accounting.journal_type.manage'],
    ['POST', '/accounting/journal-types/{id:\d+}',              'Accounting\Controllers\JournalTypeController@update',            ['auth', 'csrf'], 'accounting.journal_type.manage'],
    ['POST', '/accounting/journal-types/{id:\d+}/toggle-active', 'Accounting\Controllers\JournalTypeController@toggleActive',     ['auth', 'csrf'], 'accounting.journal_type.manage'],

    // ── Cost Centers ─────────────────────────────────────────
    ['GET',  '/accounting/cost-centers',                         'Accounting\Controllers\CostCenterController@index',              ['auth'], 'accounting.cost_center.view'],
    ['GET',  '/accounting/cost-centers/create',                  'Accounting\Controllers\CostCenterController@create',             ['auth'], 'accounting.cost_center.manage'],
    ['POST', '/accounting/cost-centers',                         'Accounting\Controllers\CostCenterController@store',              ['auth', 'csrf'], 'accounting.cost_center.manage'],
    ['GET',  '/accounting/cost-centers/{id:\d+}/edit',           'Accounting\Controllers\CostCenterController@edit',               ['auth'], 'accounting.cost_center.manage'],
    ['POST', '/accounting/cost-centers/{id:\d+}',                'Accounting\Controllers\CostCenterController@update',             ['auth', 'csrf'], 'accounting.cost_center.manage'],

    // ── Budgets ──────────────────────────────────────────────
    ['GET',  '/accounting/budgets',                              'Accounting\Controllers\BudgetController@index',                  ['auth'], 'accounting.budget.view'],
    ['POST', '/accounting/budgets',                              'Accounting\Controllers\BudgetController@store',                  ['auth', 'csrf'], 'accounting.budget.manage'],
    ['GET',  '/accounting/budgets/cost-centers',                 'Accounting\Controllers\BudgetController@costCenters',            ['auth'], 'accounting.budget.view'],
    ['POST', '/accounting/budgets/cost-centers',                 'Accounting\Controllers\BudgetController@storeCostCenter',        ['auth', 'csrf'], 'accounting.budget.manage'],
    ['GET',  '/accounting/budgets/variance',                     'Accounting\Controllers\BudgetController@varianceReport',         ['auth'], 'accounting.budget.view'],

    // ── Bank Accounts ────────────────────────────────────────
    ['GET',  '/accounting/bank-accounts',                        'Accounting\Controllers\BankAccountController@index',             ['auth'], 'accounting.bank_account.view'],
    ['GET',  '/accounting/bank-accounts/create',                 'Accounting\Controllers\BankAccountController@create',            ['auth'], 'accounting.bank_account.manage'],
    ['POST', '/accounting/bank-accounts',                        'Accounting\Controllers\BankAccountController@store',             ['auth', 'csrf'], 'accounting.bank_account.manage'],
    ['GET',  '/accounting/bank-accounts/{id:\d+}/edit',          'Accounting\Controllers\BankAccountController@edit',              ['auth'], 'accounting.bank_account.manage'],
    ['POST', '/accounting/bank-accounts/{id:\d+}',               'Accounting\Controllers\BankAccountController@update',            ['auth', 'csrf'], 'accounting.bank_account.manage'],

    // ── Journal Entries ──────────────────────────────────────
    ['GET',  '/accounting/journal-entries',                       'Accounting\Controllers\JournalEntryController@index',            ['auth'], 'accounting.journal.view'],
    ['GET',  '/accounting/journal-entries/create',                'Accounting\Controllers\JournalEntryController@create',           ['auth'], 'accounting.journal.create'],
    ['POST', '/accounting/journal-entries',                       'Accounting\Controllers\JournalEntryController@store',            ['auth', 'csrf'], 'accounting.journal.create'],
    ['GET',  '/accounting/journal-entries/{id:\d+}',              'Accounting\Controllers\JournalEntryController@show',             ['auth'], 'accounting.journal.view'],
    ['POST', '/accounting/journal-entries/{id:\d+}/post',         'Accounting\Controllers\JournalEntryController@post',             ['auth', 'csrf'], 'accounting.journal.post'],
    ['POST', '/accounting/journal-entries/{id:\d+}/reverse',      'Accounting\Controllers\JournalEntryController@reverse',          ['auth', 'csrf'], 'accounting.journal.reverse'],
    ['GET',  '/accounting/journal-entries/search-accounts',       'Accounting\Controllers\JournalEntryController@searchAccounts',   ['auth'], 'accounting.journal.view'],

    // ── Negotiable Instruments ──────────────────────────────
    ['GET',  '/accounting/instruments',                          'Accounting\Controllers\NegotiableInstrumentController@index',     ['auth'], 'accounting.instruments.view'],
    ['POST', '/accounting/instruments',                          'Accounting\Controllers\NegotiableInstrumentController@store',     ['auth', 'csrf'], 'accounting.instruments.manage'],
    ['GET',  '/accounting/instruments/due-soon',                 'Accounting\Controllers\NegotiableInstrumentController@dueSoon',   ['auth'], 'accounting.instruments.view'],
    ['GET',  '/accounting/instruments/{id:\d+}',                 'Accounting\Controllers\NegotiableInstrumentController@show',      ['auth'], 'accounting.instruments.view'],
    ['POST', '/accounting/instruments/{id:\d+}/change-status',   'Accounting\Controllers\NegotiableInstrumentController@changeStatus', ['auth', 'csrf'], 'accounting.instruments.manage'],

    // ── Instrument Portfolios ────────────────────────────────
    ['GET',  '/accounting/portfolios',                           'Accounting\Controllers\InstrumentPortfolioController@index',      ['auth'], 'accounting.instruments.view'],
    ['GET',  '/accounting/portfolios/create',                    'Accounting\Controllers\InstrumentPortfolioController@create',     ['auth'], 'accounting.instruments.manage'],
    ['POST', '/accounting/portfolios',                           'Accounting\Controllers\InstrumentPortfolioController@store',      ['auth', 'csrf'], 'accounting.instruments.manage'],
    ['GET',  '/accounting/portfolios/{id:\d+}',                  'Accounting\Controllers\InstrumentPortfolioController@show',       ['auth'], 'accounting.instruments.view'],
    ['POST', '/accounting/portfolios/{id:\d+}/confirm',          'Accounting\Controllers\InstrumentPortfolioController@confirm',    ['auth', 'csrf'], 'accounting.instruments.manage'],

    // ── Bank Reconciliation ──────────────────────────────────
    ['GET',  '/accounting/bank-reconciliation',                   'Accounting\Controllers\BankReconciliationController@index',      ['auth'], 'accounting.bank_recon.view'],
    ['GET',  '/accounting/bank-reconciliation/create',            'Accounting\Controllers\BankReconciliationController@create',     ['auth'], 'accounting.bank_recon.manage'],
    ['POST', '/accounting/bank-reconciliation',                   'Accounting\Controllers\BankReconciliationController@store',      ['auth', 'csrf'], 'accounting.bank_recon.manage'],
    ['GET',  '/accounting/bank-reconciliation/{id:\d+}',          'Accounting\Controllers\BankReconciliationController@show',       ['auth'], 'accounting.bank_recon.view'],
    ['POST', '/accounting/bank-reconciliation/{id:\d+}/add-item', 'Accounting\Controllers\BankReconciliationController@addItem',   ['auth', 'csrf'], 'accounting.bank_recon.manage'],
    ['POST', '/accounting/bank-reconciliation/{id:\d+}/complete', 'Accounting\Controllers\BankReconciliationController@complete',   ['auth', 'csrf'], 'accounting.bank_recon.manage'],

    // ── Accounting Dimensions ───────────────────────────────
    ['GET',  '/accounting/dimensions',                           'Accounting\Controllers\DimensionController@index',                ['auth'], 'accounting.dimensions.view'],
    ['POST', '/accounting/dimensions',                           'Accounting\Controllers\DimensionController@store',                ['auth', 'csrf'], 'accounting.dimensions.manage'],
    ['GET',  '/accounting/dimensions/{id:\d+}',                  'Accounting\Controllers\DimensionController@show',                 ['auth'], 'accounting.dimensions.view'],
    ['POST', '/accounting/dimensions/{id:\d+}/values',           'Accounting\Controllers\DimensionController@storeValue',           ['auth', 'csrf'], 'accounting.dimensions.manage'],
    ['POST', '/accounting/dimensions/{id:\d+}/toggle-active',    'Accounting\Controllers\DimensionController@toggleActive',         ['auth', 'csrf'], 'accounting.dimensions.manage'],

    // ── Period Closing ───────────────────────────────────────
    ['GET',  '/accounting/period-closing',                        'Accounting\Controllers\PeriodClosingController@index',           ['auth'], 'accounting.period.view'],
    ['POST', '/accounting/period-closing/close-month',            'Accounting\Controllers\PeriodClosingController@closeMonth',      ['auth', 'csrf'], 'accounting.period.close'],
    ['POST', '/accounting/period-closing/reopen-month',           'Accounting\Controllers\PeriodClosingController@reopenMonth',     ['auth', 'csrf'], 'accounting.period.reopen'],

    // ── Daily Transactions (Bulk Entry) ─────────────────────
    ['GET',  '/accounting/daily-transactions',                   'Accounting\Controllers\DailyTransactionController@index',         ['auth'], 'accounting.daily_tx.view'],
    ['POST', '/accounting/daily-transactions',                   'Accounting\Controllers\DailyTransactionController@store',         ['auth', 'csrf'], 'accounting.daily_tx.manage'],
    ['POST', '/accounting/daily-transactions/consolidate',       'Accounting\Controllers\DailyTransactionController@consolidate',   ['auth', 'csrf'], 'accounting.daily_tx.manage'],

    // ── Opening Entries & Historical Balances ───────────────
    ['GET',  '/accounting/opening-entries',                      'Accounting\Controllers\OpeningEntryController@index',             ['auth'], 'accounting.opening_entry.view'],
    ['GET',  '/accounting/opening-entries/create',               'Accounting\Controllers\OpeningEntryController@create',            ['auth'], 'accounting.opening_entry.manage'],
    ['POST', '/accounting/opening-entries',                      'Accounting\Controllers\OpeningEntryController@store',             ['auth', 'csrf'], 'accounting.opening_entry.manage'],
    ['POST', '/accounting/opening-entries/snapshot',             'Accounting\Controllers\OpeningEntryController@snapshot',          ['auth', 'csrf'], 'accounting.opening_entry.manage'],

    // ── GL Sync (super-admin) ───────────────────────────────
    ['POST', '/accounting/sync-gl',                              'Accounting\Controllers\ReportController@syncGL',              ['auth', 'csrf'], 'accounting.fiscal_year.manage'],

    // ── Reports ──────────────────────────────────────────────
    ['GET',  '/accounting/reports/trial-balance',                 'Accounting\Controllers\ReportController@trialBalance',           ['auth'], 'accounting.reports.trial_balance'],
    ['GET',  '/accounting/reports/trial-balance/export-csv',      'Accounting\Controllers\ReportController@trialBalanceExportCsv',  ['auth'], 'accounting.reports.trial_balance'],
    ['GET',  '/accounting/reports/general-ledger',                'Accounting\Controllers\ReportController@generalLedger',          ['auth'], 'accounting.reports.general_ledger'],
    ['GET',  '/accounting/reports/income-statement',              'Accounting\Controllers\ReportController@incomeStatement',        ['auth'], 'accounting.reports.income_statement'],
    ['GET',  '/accounting/reports/balance-sheet',                 'Accounting\Controllers\ReportController@balanceSheet',           ['auth'], 'accounting.reports.balance_sheet'],
    ['GET',  '/accounting/reports/balance-sheet/export-csv',      'Accounting\Controllers\ReportController@balanceSheetExportCsv',  ['auth'], 'accounting.reports.balance_sheet'],
    ['GET',  '/accounting/reports/consolidated-balance-sheet',    'Accounting\Controllers\ReportController@consolidatedBalanceSheet', ['auth'], 'accounting.reports.consolidated'],
    ['GET',  '/accounting/reports/accounts-receivable',           'Accounting\Controllers\ReportController@accountsReceivable',     ['auth'], 'accounting.reports.ar'],
    ['GET',  '/accounting/reports/accounts-payable',              'Accounting\Controllers\ReportController@accountsPayable',        ['auth'], 'accounting.reports.ap'],
    ['GET',  '/accounting/reports/member-statement',              'Accounting\Controllers\ReportController@memberStatement',        ['auth'], 'accounting.reports.member_statement'],
    ['GET',  '/accounting/reports/treasury',                     'Accounting\Controllers\ReportController@treasury',                ['auth'], 'accounting.reports.treasury'],
    ['GET',  '/accounting/reports/revenue-analysis',             'Accounting\Controllers\ReportController@revenueAnalysis',         ['auth'], 'accounting.reports.revenue_analysis'],

    // ── Account Statements ──────────────────────────────────
    ['GET',  '/accounting/statements/customer',                  'Accounting\Controllers\AccountStatementController@customerStatement', ['auth'], 'accounting.statements.view'],
    ['GET',  '/accounting/statements/supplier',                  'Accounting\Controllers\AccountStatementController@supplierStatement', ['auth'], 'accounting.statements.view'],
    ['GET',  '/accounting/statements/daily-cash',                'Accounting\Controllers\AccountStatementController@dailyCash',         ['auth'], 'accounting.cash.view'],

    // ── Bank Loans ──────────────────────────────────────────
    ['GET',  '/accounting/loans',                                'Accounting\Controllers\BankLoanController@index',                 ['auth'], 'accounting.loans.view'],
    ['GET',  '/accounting/loans/create',                         'Accounting\Controllers\BankLoanController@create',                ['auth'], 'accounting.loans.manage'],
    ['POST', '/accounting/loans',                                'Accounting\Controllers\BankLoanController@store',                 ['auth', 'csrf'], 'accounting.loans.manage'],
    ['GET',  '/accounting/loans/{id:\d+}',                       'Accounting\Controllers\BankLoanController@show',                  ['auth'], 'accounting.loans.view'],
    ['POST', '/accounting/loans/{id:\d+}/payment',               'Accounting\Controllers\BankLoanController@recordPayment',         ['auth', 'csrf'], 'accounting.loans.manage'],

    // ── Cross-Entity Settlements ────────────────────────────
    ['GET',  '/accounting/settlements',                          'Accounting\Controllers\SettlementController@index',               ['auth'], 'accounting.settlements.view'],
    ['GET',  '/accounting/settlements/create',                   'Accounting\Controllers\SettlementController@create',              ['auth'], 'accounting.settlements.manage'],
    ['POST', '/accounting/settlements',                          'Accounting\Controllers\SettlementController@store',               ['auth', 'csrf'], 'accounting.settlements.manage'],
    ['POST', '/accounting/settlements/{id:\d+}/approve',         'Accounting\Controllers\SettlementController@approve',             ['auth', 'csrf'], 'accounting.settlements.approve'],

    // ── Documentary Credits ─────────────────────────────────
    ['GET',  '/accounting/documentary-credits',                  'Accounting\Controllers\DocumentaryCreditController@index',        ['auth'], 'accounting.lc.view'],
    ['GET',  '/accounting/documentary-credits/create',           'Accounting\Controllers\DocumentaryCreditController@create',       ['auth'], 'accounting.lc.manage'],
    ['POST', '/accounting/documentary-credits',                  'Accounting\Controllers\DocumentaryCreditController@store',        ['auth', 'csrf'], 'accounting.lc.manage'],
    ['GET',  '/accounting/documentary-credits/{id:\d+}',         'Accounting\Controllers\DocumentaryCreditController@show',         ['auth'], 'accounting.lc.view'],
    ['POST', '/accounting/documentary-credits/{id:\d+}/status',  'Accounting\Controllers\DocumentaryCreditController@updateStatus', ['auth', 'csrf'], 'accounting.lc.manage'],

    // ── Letters of Guarantee ────────────────────────────────
    ['GET',  '/accounting/guarantees',                           'Accounting\Controllers\LetterOfGuaranteeController@index',        ['auth'], 'accounting.guarantee.view'],
    ['GET',  '/accounting/guarantees/create',                    'Accounting\Controllers\LetterOfGuaranteeController@create',       ['auth'], 'accounting.guarantee.manage'],
    ['POST', '/accounting/guarantees',                           'Accounting\Controllers\LetterOfGuaranteeController@store',        ['auth', 'csrf'], 'accounting.guarantee.manage'],
    ['GET',  '/accounting/guarantees/{id:\d+}',                  'Accounting\Controllers\LetterOfGuaranteeController@show',         ['auth'], 'accounting.guarantee.view'],
    ['POST', '/accounting/guarantees/{id:\d+}/status',           'Accounting\Controllers\LetterOfGuaranteeController@updateStatus', ['auth', 'csrf'], 'accounting.guarantee.manage'],
];
