The implementation of event sourced system that uses PostgreSQL as an event store. This repository should use as a template.
Start infras
./scripts/dev.sh up
Run migration(need to manual create database first)
./scripts/dev.sh migrate
Start service
./scripts/dev.sh start
Other commands
./scripts/dev.sh help
Place order
curl --location --request POST 'http://localhost:4012/order/place' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": 123123,
"price": 10.2
}'
Cancel order
curl --location --request POST 'http://localhost:4012/order/cancel' \
--header 'Content-Type: application/json' \
--data '{
"order_id": "fe55e443-2426-437a-9656-f2daf01fa2f1"
}'
Get order
curl --location --request GET 'http://localhost:4012/order/fe55e443-2426-437a-9656-f2daf01fa2f1' \
--header 'Content-Type: application/json'