Flow
ServicesAccounting Service

Architecture

Binaries, chart domain, outbox publisher, and service layout.

Binaries

BinaryPathRole
APIcmd/apiHTTP + background outbox publisher
Log consumercmd/logconsumerDev-only RabbitMQ logger for accounting.#

The API binary starts publisher.Run in a goroutine after the HTTP server is up — see services/accounting/cmd/api/main.go.

Domain packages

PackageRole
internal/chartCreate account, classifications, hierarchy validation
internal/commandSame Execute pattern as template
internal/publisherPoll outbox, publish to RabbitMQ
internal/ledgerPlaceholder for the next slice

Handlers: services/accounting/internal/handlers/accounts.go.

Events

Payload structs and golden fixtures live under the domain's events/ package (target: <domain>/events/ per docs/decisions/0015-domain-scoped-outbox-and-table-prefixes.md). Today: services/accounting/events/account.go at the service root (legacy). Event envelope (including optional why): services/accounting/envelope/.

Migrations

  • 0001_platform.sql — service-scoped principals (target: no domain tables here)
  • 0002_chart.sql — charts and accounts (target: chart_* prefix per domain slug)
  • 0003_why.sql — audit envelope column

Accounting still uses the legacy service-wide outbox until refactored to docs/decisions/0015-domain-scoped-outbox-and-table-prefixes.md.

Authorization

Cedar policy: services/accounting/policies/policy.cedar. Dev principals seeded by make dev-seed from services/accounting/testdata/dev-seed.sql.

On this page