ju-front / green-light

G-Order Tabling System
https://ju-front.github.io/green-light
1 stars 2 forks source link

SignUp api 구현 #36

Open kjeok00 opened 3 weeks ago

kjeok00 commented 3 weeks ago

const SignUp = (userID, allergyData, receiptID) =>

{
 /* 새로운 아이디 생성, 알러지 보유 등록, 보유 쿠폰 등록 */
}

request

{
 "userID" : string,
 "alleryData": {
  "gluten": bool,
  "dairy": bool,
  "egg": bool,
  "shellfish": bool,
  "nut": bool,
  "soy": bool,
  "fish": bool,
  "celery": bool,
  "mustard": bool
 },
 "receiptID": int
}

response

{
  "coupon": int
}
kjeok00 commented 3 weeks ago

SignUp: Endpoint: api/signUp

Method: POST

Description: 사용자를 등록하고, 가장 최근 영수증의 total_price 값을 10000으로 나눈 값을 coupon으로 설정합니다.

Request Body:

json:
{
  "userID": "string", 
  "allergyData": {
    "gluten": "boolean",
    "dairy": "boolean",
    "egg": "boolean",
    "shellfish": "boolean",
    "nut": "boolean",
    "soy": "boolean",
    "fish": "boolean",
    "celery": "boolean",
    "mustard": "boolean"
  }
}
userID: 사용자가 입력한 ID 문자열.
allergyData: 사용자의 알러지 정보.

Response:

json:
{
  "message": "User signed up and coupon set successfully",
  "coupon": "integer"
}

작성된 message는 수정 예정