Skip to content

e-wallet simple API to simple running with unit testing and dockerize

License

Notifications You must be signed in to change notification settings

fadilahonespot/e-wallet-simple-api

Repository files navigation

E-Wallet Simple Api

project as a learning tool to build a simple API with dokerizer and unit testing

Go Version

  • 1.5

Installation

Using Make Command

  • Deploy project in docker
 $~ make deploy
  • Integration test
 $~ make integration-test
  • Unit test
 $~ make unit-test
  • Remove project in docker
 $~ make clean

Using Docker Command

 $~ docker-compose up --build -d

Without Docker

  • Setting database in .env file
  • Using postgres database
  • Run project in terminal
 $~ go run main.go

Endpoint

Add User Method POST

  • Url
localhost:8090/account
  • Request body
{
    "customer_name": "Siti Husna",
    "balance": 10000
}

Get Account Method GET

  • url
localhost:8090/account

Get Account Detail Methode GET

  • url
localhost:8090/account/{{account_number}}

Transfer method PUT

  • url
localhost:8090/transfer
  • Request header
account_number = {{account_number}}
  • Request body
{
    "to_account_number": "555002",
    "amount": 100
}