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'
Click to show internal directories.
Click to hide internal directories.