New Function #104
closed[API] 주문 처리 (order process)
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} 상품 재고량이 부족하여 주문할 수 없습니다.")
Updated by bryant bryant over 1 year ago
- Status changed from New to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
- Description updated (diff)
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
Updated by Deca Park over 1 year ago
[API] POST /api/online_order, POST /api/store_order
1.if st_order.payment_amount = 0
1) As-is
- st_order_payment data is not created
2) Tb-be
- create st_order_payment data (because current order API has problem because of no st_order_payment)
[st_order_payment]
order_no
payment_amount: 0
payment_status: 'PS10'
reg_date / reg_user_seq
Updated by Deca Park over 1 year ago
[API] POST /api/pay_confirm
1.process (change logic)
1) if PG confirm API fails
a) As-is
- response ok
b) To-be
- response 500 (server error) with pg error code & message
- but, DB process should be kept as current
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
[API] POST /api/pay_confirm
1.if PG confirm API fails
1) As-is
- UPDATE st_order_payment with payment_status = 'PS02' (payment fail)
2) To-be
- DELETE st_order with order_no={the order_no}
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park