TorbatYar/backend/services/accounting/app/permissions/definitions.py
Mortezakoohjani 12c8615615 Ship enterprise Accounting FE/API with CRUD parity and production wiring.
Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 15:26:43 +03:30

134 lines
5.6 KiB
Python

"""Accounting permission definitions."""
from __future__ import annotations
# Phase 5.1 — Foundation
ACCOUNTING_VIEW = "accounting.view"
ACCOUNTING_CREATE = "accounting.create"
ACCOUNTING_UPDATE = "accounting.update"
ACCOUNTING_DELETE = "accounting.delete"
ACCOUNTING_MANAGE = "accounting.manage"
# Phase 5.2 — Posting
ACCOUNTING_POST = "accounting.post"
ACCOUNTING_VALIDATE = "accounting.validate"
ACCOUNTING_REVERSE = "accounting.reverse"
ACCOUNTING_CANCEL = "accounting.cancel"
ACCOUNTING_VIEW_AUDIT = "accounting.view_audit"
ACCOUNTING_MANAGE_POSTING = "accounting.manage_posting"
# Phase 5.3 — Ledger & Fiscal
ACCOUNTING_LEDGER_VIEW = "accounting.ledger.view"
ACCOUNTING_LEDGER_MANAGE = "accounting.ledger.manage"
ACCOUNTING_FISCAL_VIEW = "accounting.fiscal.view"
ACCOUNTING_FISCAL_MANAGE = "accounting.fiscal.manage"
ACCOUNTING_PERIOD_CLOSE = "accounting.period.close"
ACCOUNTING_PERIOD_REOPEN = "accounting.period.reopen"
ACCOUNTING_TRIAL_BALANCE_VIEW = "accounting.trial_balance.view"
# Phase 5.4 — Treasury
TREASURY_VIEW = "treasury.view"
TREASURY_MANAGE = "treasury.manage"
TREASURY_CASH = "treasury.cash"
TREASURY_BANK = "treasury.bank"
TREASURY_CHEQUE = "treasury.cheque"
TREASURY_PAYMENT = "treasury.payment"
TREASURY_TRANSFER = "treasury.transfer"
TREASURY_RECONCILIATION = "treasury.reconciliation"
# Phase 5.5 — AR/AP
RECEIVABLE_VIEW = "receivable.view"
RECEIVABLE_MANAGE = "receivable.manage"
RECEIVABLE_RECEIVE_PAYMENT = "receivable.receive_payment"
RECEIVABLE_STATEMENT = "receivable.statement"
PAYABLE_VIEW = "payable.view"
PAYABLE_MANAGE = "payable.manage"
PAYABLE_MAKE_PAYMENT = "payable.make_payment"
PAYABLE_STATEMENT = "payable.statement"
SETTLEMENT_MANAGE = "settlement.manage"
# Phase 5.6 — Sales Accounting
SALES_ACCOUNTING_VIEW = "sales_accounting.view"
SALES_ACCOUNTING_POST = "sales_accounting.post"
SALES_ACCOUNTING_CONFIGURE = "sales_accounting.configure"
SALES_ACCOUNTING_REVENUE_RECOGNITION = "sales_accounting.revenue_recognition"
SALES_ACCOUNTING_PREVIEW = "sales_accounting.preview"
SALES_ACCOUNTING_MANAGE = "sales_accounting.manage"
# Phase 5.7 — Purchase/Inventory Accounting
PURCHASE_ACCOUNTING_VIEW = "purchase_accounting.view"
PURCHASE_ACCOUNTING_POST = "purchase_accounting.post"
PURCHASE_ACCOUNTING_CONFIGURE = "purchase_accounting.configure"
INVENTORY_ACCOUNTING_VIEW = "inventory_accounting.view"
INVENTORY_ACCOUNTING_POST = "inventory_accounting.post"
INVENTORY_ACCOUNTING_CONFIGURE = "inventory_accounting.configure"
INVENTORY_VALUATION_MANAGE = "inventory_valuation.manage"
POSTING_SIMULATION_EXECUTE = "posting_simulation.execute"
# Phase 5.8 — Fixed Assets
ASSETS_VIEW = "assets.view"
ASSETS_CREATE = "assets.create"
ASSETS_UPDATE = "assets.update"
ASSETS_DEPRECIATE = "assets.depreciate"
ASSETS_TRANSFER = "assets.transfer"
ASSETS_DISPOSE = "assets.dispose"
ASSETS_REVALUE = "assets.revalue"
ASSETS_MANAGE = "assets.manage"
# Phase 5.9 — Payroll
HR_VIEW = "hr.view"
HR_MANAGE = "hr.manage"
PAYROLL_VIEW = "payroll.view"
PAYROLL_CALCULATE = "payroll.calculate"
PAYROLL_APPROVE = "payroll.approve"
PAYROLL_PAY = "payroll.pay"
PAYROLL_REVERSE = "payroll.reverse"
PAYROLL_CONFIGURE = "payroll.configure"
# Phase 5.10 — Reporting
REPORTS_VIEW = "reports.view"
REPORTS_EXPORT = "reports.export"
REPORTS_SCHEDULE = "reports.schedule"
REPORTS_BUILDER = "reports.builder"
DASHBOARD_VIEW = "dashboard.view"
DASHBOARD_MANAGE = "dashboard.manage"
ANALYTICS_VIEW = "analytics.view"
FINANCIAL_STATEMENTS_VIEW = "financial_statements.view"
# Phase 5.11 — Compliance
AUDIT_VIEW = "audit.view"
AUDIT_EXPORT = "audit.export"
COMPLIANCE_VIEW = "compliance.view"
COMPLIANCE_MANAGE = "compliance.manage"
GOVERNANCE_VIEW = "governance.view"
GOVERNANCE_MANAGE = "governance.manage"
APPROVAL_EXECUTE = "approval.execute"
RISK_VIEW = "risk.view"
RISK_MANAGE = "risk.manage"
ALL_PERMISSIONS = [
ACCOUNTING_VIEW, ACCOUNTING_CREATE, ACCOUNTING_UPDATE, ACCOUNTING_DELETE,
ACCOUNTING_MANAGE, ACCOUNTING_POST, ACCOUNTING_VALIDATE, ACCOUNTING_REVERSE,
ACCOUNTING_CANCEL, ACCOUNTING_VIEW_AUDIT, ACCOUNTING_MANAGE_POSTING,
ACCOUNTING_LEDGER_VIEW, ACCOUNTING_LEDGER_MANAGE, ACCOUNTING_FISCAL_VIEW,
ACCOUNTING_FISCAL_MANAGE, ACCOUNTING_PERIOD_CLOSE, ACCOUNTING_PERIOD_REOPEN,
ACCOUNTING_TRIAL_BALANCE_VIEW, TREASURY_VIEW, TREASURY_MANAGE, TREASURY_CASH,
TREASURY_BANK, TREASURY_CHEQUE, TREASURY_PAYMENT, TREASURY_TRANSFER,
TREASURY_RECONCILIATION, RECEIVABLE_VIEW, RECEIVABLE_MANAGE,
RECEIVABLE_RECEIVE_PAYMENT, RECEIVABLE_STATEMENT, PAYABLE_VIEW, PAYABLE_MANAGE,
PAYABLE_MAKE_PAYMENT, PAYABLE_STATEMENT, SETTLEMENT_MANAGE,
SALES_ACCOUNTING_VIEW, SALES_ACCOUNTING_POST, SALES_ACCOUNTING_CONFIGURE,
SALES_ACCOUNTING_REVENUE_RECOGNITION, SALES_ACCOUNTING_PREVIEW,
SALES_ACCOUNTING_MANAGE,
PURCHASE_ACCOUNTING_VIEW, PURCHASE_ACCOUNTING_POST, PURCHASE_ACCOUNTING_CONFIGURE,
INVENTORY_ACCOUNTING_VIEW, INVENTORY_ACCOUNTING_POST, INVENTORY_ACCOUNTING_CONFIGURE,
INVENTORY_VALUATION_MANAGE, POSTING_SIMULATION_EXECUTE,
ASSETS_VIEW, ASSETS_CREATE, ASSETS_UPDATE, ASSETS_DEPRECIATE, ASSETS_TRANSFER,
ASSETS_DISPOSE, ASSETS_REVALUE, ASSETS_MANAGE,
HR_VIEW, HR_MANAGE, PAYROLL_VIEW, PAYROLL_CALCULATE, PAYROLL_APPROVE,
PAYROLL_PAY, PAYROLL_REVERSE, PAYROLL_CONFIGURE,
REPORTS_VIEW, REPORTS_EXPORT, REPORTS_SCHEDULE, REPORTS_BUILDER,
DASHBOARD_VIEW, DASHBOARD_MANAGE, ANALYTICS_VIEW, FINANCIAL_STATEMENTS_VIEW,
AUDIT_VIEW, AUDIT_EXPORT, COMPLIANCE_VIEW, COMPLIANCE_MANAGE,
GOVERNANCE_VIEW, GOVERNANCE_MANAGE, APPROVAL_EXECUTE, RISK_VIEW, RISK_MANAGE,
]