Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
/ bank-api Public archive

💵 Low level bank-api. Using JDBC, h2, HttpServer

Notifications You must be signed in to change notification settings

romanwrites/bank-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💵 Bank-api

🍧 Features

On card creation return 201 status code
If the card isn't found - 404
400 On bad request
If card is closed you can't update it. Even it's status
If card status is PENDING (1) it updates to ACTIVE (2) with first deposit
Updates account balance when card balance is updated
Using transactions on all DML operations

DB design

database schema

💳 Card API

GET

api/card/all

api/card/all/status

api/card?number=4000000967827322

api/card/balance?number=4000000967827322

api/card/status?number=4000000967827322
POST

api/card
{"account":"22222222222222222222"}

api/card/deposit
{"number":"4000000967827322","amount":15.30}

api/card/status
{"number":"4000000967827322","status":2}

api/card/activate
{"number":"4000000967827322"}

api/card/close
{"number":"4000000967827322"}

api/card/delete
{"number":"4000000967827322"}

🧮 Account API

GET

api/account/all
api/account?id=2
POST

api/account
{"phone":"+75557774430"}

Author: Roman Kukin