Simple service for orders management using сlean architecture principles.
Sqlite database is used as storage.
Default service configuration is loaded from .env
file, but you can override any parameters from ENV.
- Run db migrations:
$ go install -tags 'sqlite3 sqlite' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
$ migrate -database "sqlite3://sqlite.db" -path db/migrations up
- Start service (on port 3000 by default):
$ go run cmd/main.go
$ curl --location 'localhost:3000/sale-order' \
--header 'Content-Type: application/json' \
--data '{"customer_id": 1, "products": [{"product_id":1, "quantity": 1}]}'
$ curl --location --request GET 'localhost:3000/sale-order?id=1'