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://postgres:postgres@localhost:5433/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 '{
    "data": {
      "chart_code": "us",
      "code": "10000",
      "name": "ASSETS",
      "classification": "asset",
      "is_postable": false
    }
  }' | jq

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

Swagger UI is at localhost:8080/api-docs when SWAGGER_ON=true (set by make dev).

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 the Azure Service Bus topic accounting-account-fanout.

OpenAPI

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

On this page