Giter VIP home page Giter VIP logo

banktransfer's Introduction

Bank Transfer API

requirement

  • Docker
  • docker compose
  • client DB

structure code

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

Flow of the apps

whe have 3 API on each apps (mock and api)

  1. api

    1. 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

    2. 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

    3. disbursement callback

      handle on transaction module, to receive status from bank service (mock) and store the status into db

  2. bank (mock)

    1. validate

      handle on user module, the api will receive name and account number, will check account number on db and validate with name

    2. transfer

      handle on transaction module, the api will receive transaction object and give HOLD status to the transaction

    3. 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

How To Run

every step need to open different terminal, step to run:

  1. run db

    docker-compose up --build -d

after run, we can test it via postman, the collection already in the repo

banktransfer's People

Contributors

mhuseinj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.