Flow
ServicesAccounting Service

Getting started

Run accounting locally, create an account, and observe outbox events.

Start the stack and service

make dev-up
make migrate
make dev-seed
make dev

Accounting listens on localhost:8080. Database: postgres://accounting:accounting@localhost:5432/accounting.

Create an account

curl -s -X POST localhost:8080/v1/accounts \
  -H 'X-Dev-Actor: fid_dev_controller' \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
    "chart_code": "us",
    "code": "10000",
    "name": "ASSETS",
    "classification": "asset",
    "is_postable": false
  }' | jq

Optional parent_code links hierarchy. Optional why carries audit context in the event envelope.

Watch events (dev only)

In another terminal:

go run ./services/accounting/cmd/logconsumer

The API process also runs the outbox publisher (internal/publisher) which drains unpublished rows to RabbitMQ exchange core-events with routing key accounting.account.created.

OpenAPI

services/accounting/openapi.yaml is included in the merged openapi.yaml at the repository root.

On this page