rbwallet although it has a wallet in its name is just an application to create transactions for users who have an account.
- Create and retrieve account information
- Create transactions
- Gorilla mux - request router and dispatcher
- Negroni - negroni is an idiomatic approach to web middleware
- Validator - validations for structs and individual fields based on tags.
- Mysql - The world's most popular open source database
rbwallet requires Docker and Docker Compose.
Install the dependencies and devDependencies and start the server.
git clone https://github.com/devbenatti/rbwallet-go.git
cd rbwallet-go
docker-compose up -d
To create a account, you must send an HTTP POST request for route /accounts
.
{
"documentIdentifier": "01145609745",
}
{
"id": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E"
}
To find a account, you must send an HTTP GET request for route /accounts/{id}
.
/accounts/A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E
{
"id": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E",
"documentIdentifier": "01145609745"
}
To create a transaction, you must send an HTTP POST request for route /transactions
.
{
"accountId": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E",
"operationType": 2,
"total": 110.10
}
{
"code": "7DC61C43-15EA-4AE1-6D4F-30D30C7084FA"
}
Code | Description |
---|---|
1 | Cash Purchase |
2 | Installment Purchase |
3 | Withdraw |
4 | Payment |
- anti-corruption layer to validate input data