<?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'], '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'], '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'], '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'], 'accounting.coa.manage'],
    ['GET',  '/accounting/chart-of-accounts/search',             'Accounting\Controllers\ChartOfAccountsController@search',        ['auth'], 'accounting.coa.view'],

    // ── 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'], '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'], 'accounting.cost_center.manage'],

    // ── 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'], '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'], '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'], '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'], 'accounting.journal.post'],
    ['POST', '/accounting/journal-entries/{id:\d+}/reverse',      'Accounting\Controllers\JournalEntryController@reverse',          ['auth'], 'accounting.journal.reverse'],
    ['GET',  '/accounting/journal-entries/search-accounts',       'Accounting\Controllers\JournalEntryController@searchAccounts',   ['auth'], 'accounting.journal.view'],

    // ── 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'], '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'], 'accounting.bank_recon.manage'],
    ['POST', '/accounting/bank-reconciliation/{id:\d+}/complete', 'Accounting\Controllers\BankReconciliationController@complete',   ['auth'], 'accounting.bank_recon.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'], 'accounting.period.close'],
    ['POST', '/accounting/period-closing/reopen-month',           'Accounting\Controllers\PeriodClosingController@reopenMonth',     ['auth'], 'accounting.period.reopen'],

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

    // ── Reports ──────────────────────────────────────────────
    ['GET',  '/accounting/reports/trial-balance',                 'Accounting\Controllers\ReportController@trialBalance',           ['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/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'],
];
