Skip to content

rbenatti8/rbwallet-go

Repository files navigation

rbwallet-go

rbwallet although it has a wallet in its name is just an application to create transactions for users who have an account.

Features

  • Create and retrieve account information
  • Create transactions

Tech

  • 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

Installation

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

Create account

To create a account, you must send an HTTP POST request for route /accounts.

request body example

{
    "documentIdentifier": "01145609745",
}

response body example

{
    "id": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E"
}

Find account

To find a account, you must send an HTTP GET request for route /accounts/{id}.

example

/accounts/A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E

response body example

{
    "id": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E",
    "documentIdentifier": "01145609745"
}

Transaction

To create a transaction, you must send an HTTP POST request for route /transactions.

request body example

{
   "accountId": "A54C182B-7E22-4B1D-6ABB-0DF3A02FEE4E",
    "operationType": 2,
    "total": 110.10
}

response body example

{
   "code": "7DC61C43-15EA-4AE1-6D4F-30D30C7084FA"
}

Transaction Operations

Code Description
1 Cash Purchase
2 Installment Purchase
3 Withdraw
4 Payment

Roadmap

  • anti-corruption layer to validate input data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages