Skip to content

Bangkok Open Source Hackathon 2023 Project.

License

Notifications You must be signed in to change notification settings

Kittonn/bank4all-api

 
 

Repository files navigation

backend

diagram db: https://dbdiagram.io/d/6404ccf2296d97641d8589c7
source api: https://docs.google.com/document/d/1CPJrx3pA0Jv5GVAcEpaOK1QWkTm8xNUX-t-2zn_s8hI/edit


api docs

docs.http file for test API (use REST client vscode extension)


ยังไม่ได้ login

Note set cookies after success
Set-Cookie ใน response headers ใช้สำหรับ auth

POST /signIn
Parameters
name type data type description
username required string email / phoneNumber
password required string N/A
Responses
http code content-type response
200 application/json {"message":"Authentication successful"}
400 application/json {"message":"Invalid password"}
500 application/json {"message":"error"}
POST /signUp
Parameters
name type data type description
fullName required string N/A
email required string N/A
password required string N/A
phoneNumber required string N/A
Responses
http code content-type response
200 application/json {"message": "Registration successful"}
400 application/json {"msg": "something wrong"}

login แล้ว (ยืนยันตัวตนด้วย cookie)

Note จำเป็นต้องมี Cookie ใน headers ตอนส่ง

GET /balanceSummary (BusinessLogic)
Details
totalNumber: totalDeposit + microFinancePotentaiLending + peerSharePotentaiLending
microFinancePotentiaLending: get all peerSharingDetail by userId then sumup potential amount
peerSharePotentaiLending: get all microFinanceDetail by userId then sumup potential amount
Parameters

NONE

Responses
http code content-type response
200 application/json {totalBalance: Number, microFinance: Number, peerShare: Number }
400 application/json {"msg": "something wrong"}
POST /addMoney
Details
  • Front Back Thrid-party API
  • Button addMoney /addMoney–-> username, amount —-> omise/opn
  • OK/NOT OK←—
Parameters
name type data type description
amount required number N/A
Responses
http code content-type response
200 application/json {}
400 application/json {"msg": "something wrong"}
POST /withdrawn
Parameters
name type data type description
amount required number N/A
Responses
http code content-type response
200 application/json {}
400 application/json {"msg": "something wrong"}
GET /peerShareSummary
Parameters

NONE

Responses
http code content-type response
200 application/json {"peerShareTotal":number, "currentDE":string, "creditScore":string}
400 application/json {"msg": "something wrong"}
GET /getAllpeerShareDetail
Details

Member, payment, credit : query from db Joinable: query user credit then check with peerShareDetail credit

Parameters

NONE

peerShareDetail
name data type description
member number N/A
payment number N/A
credit string N/A
joinable boolean N/A
Responses
http code content-type response
200 application/json {"peerShareList": peerShareDetail[]}
400 application/json {"msg": "something wrong"}

About

Bangkok Open Source Hackathon 2023 Project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.9%
  • Solidity 5.6%
  • Dockerfile 0.5%