order-service

command
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Command order-service is the end-to-end example of a FlowCatalyst consumer application: one business operation (PlaceOrder) through the use-case envelope, its aggregate, domain event and audit row written to the outbox in one transaction, and a second operation whose plan carries a dispatch job, written in the same transaction as the event that asks for it.

The platform's outbox processor (fcdev / fc-server with the outbox subsystem pointed at this database) then sends each outbox row to the platform: events to /api/events/batch, audit rows to /api/audit-logs/batch, dispatch jobs to /api/dispatch-jobs/batch.

Run

FC_DATABASE_URL=postgres://localhost:5432/orders \
FC_CLIENT_CODE=acme \
go run ./examples/order-service

curl -XPOST localhost:8081/orders -H 'X-Principal-ID: prn_demo' \
     -d '{"customerId":"cus_42","totalCents":1500}'
curl -XPOST localhost:8081/orders/<id>/export -H 'X-Principal-ID: prn_demo'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL