diagram db: https://dbdiagram.io/d/6404ccf2296d97641d8589c7
source api: https://docs.google.com/document/d/1CPJrx3pA0Jv5GVAcEpaOK1QWkTm8xNUX-t-2zn_s8hI/edit
docs.http
file for test API (use REST client vscode extension)
Note set cookies after success
Set-Cookie
ใน response headers ใช้สำหรับ auth
POST
/signIn
name type data type description username required string email / phoneNumber password required string N/A
http code content-type response 200
application/json
{"message":"Authentication successful"}
400
application/json
{"message":"Invalid password"}
500
application/json
{"message":"error"}
POST
/signUp
name type data type description fullName required string N/A required string N/A password required string N/A phoneNumber required string N/A
http code content-type response 200
application/json
{"message": "Registration successful"}
400
application/json
{"msg": "something wrong"}
Note จำเป็นต้องมี
Cookie
ใน headers ตอนส่ง
GET
/balanceSummary
(BusinessLogic)
totalNumber: totalDeposit + microFinancePotentaiLending + peerSharePotentaiLending microFinancePotentiaLending: get all peerSharingDetail by userId then sumup potential amount peerSharePotentaiLending: get all microFinanceDetail by userId then sumup potential amount
NONE
http code content-type response 200
application/json
{totalBalance: Number, microFinance: Number, peerShare: Number }
400
application/json
{"msg": "something wrong"}
POST
/addMoney
- Front Back Thrid-party API
- Button addMoney /addMoney–-> username, amount —-> omise/opn
- OK/NOT OK←—
name type data type description amount required number N/A
http code content-type response 200
application/json
{}
400
application/json
{"msg": "something wrong"}
POST
/withdrawn
name type data type description amount required number N/A
http code content-type response 200
application/json
{}
400
application/json
{"msg": "something wrong"}
GET
/peerShareSummary
NONE
http code content-type response 200
application/json
{"peerShareTotal":number, "currentDE":string, "creditScore":string}
400
application/json
{"msg": "something wrong"}
GET
/getAllpeerShareDetail
Member, payment, credit : query from db Joinable: query user credit then check with peerShareDetail credit
NONE
name data type description member number N/A payment number N/A credit string N/A joinable boolean N/A
http code content-type response 200
application/json
{"peerShareList": peerShareDetail[]}
400
application/json
{"msg": "something wrong"}