Skip to content

feat: implement accounting API (accounts, ledger, payments, audit)#5

Open
arendsyl wants to merge 1 commit into
mainfrom
feat/accounting-api
Open

feat: implement accounting API (accounts, ledger, payments, audit)#5
arendsyl wants to merge 1 commit into
mainfrom
feat/accounting-api

Conversation

@arendsyl
Copy link
Copy Markdown
Contributor

Implements the full accounting API on top of the initial scaffold.

Highlights

  • Accounts: CRUD + metadata; filterable listing (balance thresholds, in-debt, status, tag…).
  • Operations: append-only ledger (CREDIT/DEBIT), debt-limit enforced on DEBIT; balance reconciles to sum(operations).
  • Payments: method (ACCOUNT_BALANCE | EXTERNAL) × purpose (PURCHASE | TOP_UP) matrix, status state machine, confirm/reject/cancel transitions, payment_events audit log.
  • Account management: POST deactivate/reactivate/max-debt-allowed (audited) + filterable GET /audit/actions.
  • Docs: OpenAPI via utoipa, served with Scalar at /api/docs/ui.

Stack

  • sqlx 0.9 compile-time macros + committed .sqlx offline cache; axum 0.8.9; utoipa. Rust ≥ 1.94.
  • labels hstore → jsonb; new payments/payment_events tables + indexes. Config via env (HOST/PORT); no runtime dotenv.

Tests

  • State-machine unit tests + #[sqlx::test] integration tests (debt limit, reconciliation, payment matrix/transitions, search). Offline build verified.

@arendsyl arendsyl force-pushed the feat/accounting-api branch 2 times, most recently from f3444fd to a71d728 Compare May 30, 2026 17:13
…ents, audit)

- Accounts CRUD + metadata; filterable listing
- Append-only operations ledger (debt-limit checked); balance reconciles to sum(operations)
- Payments: method x purpose matrix, state machine, confirm/reject/cancel, event log
- Account-management actions (deactivate/reactivate/max-debt) + filterable /audit/actions
- sqlx 0.9 compile-time macros with committed offline cache; axum 0.8; OpenAPI via utoipa + Scalar
- HOST/PORT configurable; no runtime dotenv
@arendsyl arendsyl force-pushed the feat/accounting-api branch from a71d728 to 9e64cb5 Compare May 30, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant