Project

General

Profile

Actions

New Function #104

closed

[API] 주문 처리 (order process)

Added by Deca Park about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
08/26/2023
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

[API] POST /api/online_order, POST /api/store_order

1.Add validate logic for use_point / use_money / coupon_code
  1) if use_point param > 0
    a) if order user's current available point < use_point param
      - return error (status: 400, error_code: "order.error.overUsePoint", "사용가능 포인트를 초과하여 주문할 수 없습니다.")
  2) if use_money param > 0
    a) if order user's current available money < use_money param
      - return error (status: 400, error_code: "order.error.overUseMoney", "사용가능 적립금을 초과하여 주문할 수 없습니다.")
  3) if coupon_code param is NOT NULL
    a) check if the coupon_code is existed on DB(st_user_coupon) and use_yn = 'N'
       [logic]
       DB (st_user_coupon)
       condition: user_seq = {user_seq of id param} AND coupon_code = {param}
    b) if the coupon_code is NOT existed OR use_yn != 'N' (N: NOT used)
      - return error (status: 400, error_code: "order.error.notAvailableCoupon", "{coupon_name} 쿠폰은 주문 가능한 쿠폰이 아닙니다.")

2.Add validation logic for order_products > order_count
  1) if order product's st_product.stock_count is NOT NULL
     a) if order product's order_count > st_product.stock_count
      - return error (status: 400, error_code: "order.error.noProductStock", "{product_name} 상품 재고량이 부족하여 주문할 수 없습니다.")

Actions

Also available in: Atom PDF