The Transaction Manager is a microservice for managing accounts and transaction creation. This service provides the following methods:
- Create Account
- Get Account
- Create Transaction
To access the API documentation, you can either:
- Navigate to the docs folder and open the Swagger files in a Swagger editor.
- Run the project locally and access the Swagger documentation at documentation
http://localhost:8080/v1/swagger/index.html
To run this project some system requirements are needed:
- Golang installed (version 1.20.8) or ASDF package manager
- Docker
- DockerCompose
- Clone de repo
- Install tools
make install-tools
if you already have golang installed just runmake install-go-tools
- Raise de database
make dev/up
- Run migrations
ENV=dev make migrate-up
- Run locally the application
make run-local
To update mocks, run the following command:
make mock-all
To update Swagger documentation, run:
make doc/update
Run uni tests
make test
To check test coverage
make test-coverage
To check lint
make lint
To check security vulnerability
make security-check
To create migration
make migrate-create
To downgrade migration
make migrate-down
curl --location 'http://localhost:8080/info'
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--data '{
"document_number": "{document_number}"
}'
curl --location 'http://localhost:8080/accounts/{id}'
curl --location 'http://localhost:8080/transactions' \
--header 'Content-Type: application/json' \
--data '{
"account_id": {account_id},
"operation_type_id": {operation_type_id},
"amount": {amount}
}'
Future changes and improvements mapped:
- Add container for application on docker-compose file
- Improve test coverage
- Add air live reload
- Create wrapper for package log
- Add container DI to the project