"""Accounting event type definitions (contracts only — no consumers)."""
from __future__ import annotations

import enum


class AccountingEventType(str, enum.Enum):
    # Foundation
    ACCOUNT_CREATED = "account.created"
    CHART_OF_ACCOUNTS_CREATED = "chart_of_accounts.created"
    FISCAL_YEAR_CREATED = "fiscal_year.created"
    FISCAL_PERIOD_OPENED = "fiscal_period.opened"

    # Posting (Phase 5.2)
    VOUCHER_CREATED = "voucher.created"
    VOUCHER_VALIDATED = "voucher.validated"
    VOUCHER_POSTED = "voucher.posted"
    VOUCHER_CANCELLED = "voucher.cancelled"
    VOUCHER_REVERSED = "voucher.reversed"
    JOURNAL_ENTRY_CREATED = "journal_entry.created"
    POSTING_COMPLETED = "posting.completed"
    POSTING_FAILED = "posting.failed"

    # Ledger (Phase 5.3)
    FISCAL_YEAR_CLOSED = "fiscal_year.closed"
    FISCAL_PERIOD_LOCKED = "fiscal_period.locked"
    FISCAL_PERIOD_CLOSED = "fiscal_period.closed"
    TRIAL_BALANCE_GENERATED = "trial_balance.generated"
    LEDGER_UPDATED = "ledger.updated"
    BALANCE_RECALCULATED = "balance.recalculated"

    # Treasury (Phase 5.4)
    CASH_RECEIVED = "cash.received"
    CASH_PAID = "cash.paid"
    BANK_DEPOSIT_CREATED = "bank_deposit.created"
    BANK_WITHDRAWAL_CREATED = "bank_withdrawal.created"
    CHEQUE_ISSUED = "cheque.issued"
    CHEQUE_RECEIVED = "cheque.received"
    CHEQUE_DEPOSITED = "cheque.deposited"
    CHEQUE_CLEARED = "cheque.cleared"
    CHEQUE_BOUNCED = "cheque.bounced"
    TRANSFER_COMPLETED = "transfer.completed"
    TREASURY_TRANSACTION_POSTED = "treasury_transaction.posted"
    BANK_RECONCILIATION_COMPLETED = "bank_reconciliation.completed"

    # AR/AP (Phase 5.5)
    CUSTOMER_INVOICE_CREATED = "customer_invoice.created"
    SUPPLIER_INVOICE_CREATED = "supplier_invoice.created"
    CUSTOMER_PAYMENT_RECEIVED = "customer_payment.received"
    SUPPLIER_PAYMENT_COMPLETED = "supplier_payment.completed"
    SETTLEMENT_COMPLETED = "settlement.completed"
    CREDIT_NOTE_ISSUED = "credit_note.issued"
    DEBIT_NOTE_ISSUED = "debit_note.issued"
    ADVANCE_PAYMENT_RECORDED = "advance_payment.recorded"
    ADVANCE_RECEIPT_RECORDED = "advance_receipt.recorded"
    CUSTOMER_AGING_CALCULATED = "customer_aging.calculated"
    SUPPLIER_AGING_CALCULATED = "supplier_aging.calculated"

    # Sales Accounting (Phase 5.6)
    SALES_INVOICE_POSTED = "sales_invoice.posted"
    SALES_INVOICE_CANCELLED = "sales_invoice.cancelled"
    SALES_RETURN_POSTED = "sales_return.posted"
    REVENUE_RECOGNIZED = "revenue.recognized"
    DISCOUNT_APPLIED = "discount.applied"
    SALES_ACCOUNTING_COMPLETED = "sales_accounting.completed"
    POSTING_RULE_EXECUTED = "posting_rule.executed"

    # Purchase/Inventory (Phase 5.7)
    GOODS_RECEIVED = "goods.received"
    GOODS_ISSUED = "goods.issued"
    INVENTORY_ADJUSTED = "inventory.adjusted"
    INVENTORY_TRANSFERRED = "inventory.transferred"
    PURCHASE_COMPLETED = "purchase.completed"
    PURCHASE_RETURNED = "purchase.returned"
    INVENTORY_REVALUED = "inventory.revalued"
    INVENTORY_COST_ADJUSTED = "inventory.cost_adjusted"
    INVENTORY_ACCOUNTING_COMPLETED = "inventory_accounting.completed"
    PURCHASE_ACCOUNTING_COMPLETED = "purchase_accounting.completed"

    # Fixed Assets (Phase 5.8)
    ASSET_CREATED = "asset.created"
    ASSET_ACTIVATED = "asset.activated"
    ASSET_DEPRECIATED = "asset.depreciated"
    ASSET_TRANSFERRED = "asset.transferred"
    ASSET_REVALUED = "asset.revalued"
    ASSET_DISPOSED = "asset.disposed"
    ASSET_SOLD = "asset.sold"
    ASSET_RETIRED = "asset.retired"
    ASSET_IMPAIRED = "asset.impaired"
    DEPRECIATION_CALCULATED = "depreciation.calculated"
    ASSET_ACCOUNTING_COMPLETED = "asset_accounting.completed"

    # Payroll (Phase 5.9)
    PAYROLL_CALCULATED = "payroll.calculated"
    PAYROLL_APPROVED = "payroll.approved"
    PAYROLL_POSTED = "payroll.posted"
    PAYROLL_PAID = "payroll.paid"
    PAYROLL_REVERSED = "payroll.reversed"
    SALARY_ADJUSTED = "salary.adjusted"
    BONUS_PAID = "bonus.paid"
    OVERTIME_APPROVED = "overtime.approved"
    LOAN_DEDUCTED = "loan.deducted"
    ADVANCE_RECOVERED = "advance.recovered"
    PAYROLL_ACCOUNTING_COMPLETED = "payroll_accounting.completed"

    # Reporting (Phase 5.10)
    FINANCIAL_REPORT_GENERATED = "financial_report.generated"
    DASHBOARD_GENERATED = "dashboard.generated"
    BALANCE_SHEET_GENERATED = "balance_sheet.generated"
    INCOME_STATEMENT_GENERATED = "income_statement.generated"
    CASH_FLOW_GENERATED = "cash_flow.generated"
    REPORT_EXPORTED = "report.exported"
    SCHEDULED_REPORT_GENERATED = "scheduled_report.generated"
    FINANCIAL_SNAPSHOT_CREATED = "financial_snapshot.created"

    # Compliance (Phase 5.11)
    AUDIT_RECORD_CREATED = "audit_record.created"
    COMPLIANCE_VALIDATED = "compliance.validated"
    POLICY_VIOLATION_DETECTED = "policy_violation.detected"
    APPROVAL_COMPLETED = "approval.completed"
    APPROVAL_REJECTED = "approval.rejected"
    GOVERNANCE_RULE_EXECUTED = "governance_rule.executed"
    RISK_DETECTED = "risk.detected"
    EVIDENCE_UPLOADED = "evidence.uploaded"
    RETENTION_POLICY_APPLIED = "retention_policy.applied"
