- Docker
- docker compose
- client DB
consist of 2 apps
- api: main app
api
|---module
|-----|-----transactions
|-----|-----------|------entity
|-----|-----------|------handler
|-----|-----------|------repository
|-----|-----------|------service
|-----|-----accounts
|-----|-----------|------entity
|-----|-----------|------handler
|-----|-----------|------repository
|-----|-----------|------service
|---config
|-----|-----dbConfig
go.mod
main.go
.env
- bank: mock bank app
bank
|---module
|-----|-----transactions
|-----|-----------|------entity
|-----|-----------|------handler
|-----|-----------|------service
|-----|-----accounts
|-----|-----------|------entity
|-----|-----------|------handler
|-----|-----------|------repository
|-----|-----------|------service
|---config
|-----|-----dbConfig
go.mod
main.go
.env
whe have 3 API on each apps (mock and api)
-
api
- validate
handle on user module, this api will call the validate on mock service, and mock service will check whether the account exist and name is simmilar with the request
- disbursment
handle on transaction module, is to create transfer request (disbursement) and the the transaction will put on hold until the bank setled or canceled the transaction via callback
- disbursement callback
handle on transaction module, to receive status from bank service (mock) and store the status into db
- validate
-
bank (mock)
- validate
handle on user module, the api will receive name and account number, will check account number on db and validate with name
- transfer
handle on transaction module, the api will receive transaction object and give HOLD status to the transaction
- settlement
handle on transaction module, the api will receive transaction object with the updated status and call api service callback to update the status of the transaction
- validate
every step need to open different terminal, step to run:
- run db
docker-compose up --build -d
after run, we can test it via postman, the collection already in the repo