New Function #104
Updated by Deca Park over 1 year ago
<p><strong>[API] POST /api/online_order, POST /api/store_order</strong></p> <p>1.Add validate logic for <strong>use_point / use_money / coupon_code</strong><br /> 1)<strong> if use_point param > 0</strong><br /> a) if order user's current available point < use_point param<br /> - return error (status: 400, error_code: "order.error.overUsePoint", "사용가능 포인트를 초과하여 주문할 수 없습니다.")<br /> 2)<strong> if use_money param > 0</strong><br /> a) if order user's current available money < use_money param<br /> - return error (status: 400, error_code: "order.error.overUseMoney", "사용가능 적립금을 초과하여 주문할 수 없습니다.")<br /> 3) <strong>if coupon_code param is NOT NULL</strong><br /> a) check if the coupon_code is existed on DB(st_user_coupon) and use_yn = 'N'<br /> [logic]<br /> DB (st_user_coupon)<br /> condition: user_seq = {user_seq of id param} AND coupon_code = {param}<br /> b) if the coupon_code is NOT existed OR use_yn != 'N' (N: NOT used)<br /> - return error (status: 400, error_code: "order.error.notAvailableCoupon", "order.error.NotAvailableCoupon", "{coupon_name} 쿠폰은 주문 가능한 쿠폰이 아닙니다.")</p> <p><span style="color:#e74c3c;">2.Add validation logic for order_products > order_count<br /> 1) if order product's <strong>st_product.stock_count is NOT NULL</strong><br /> a) if order product's order_count <strong>></strong> st_product.stock_count<br /> - return error (status: 400, error_code: "order.error.noProductStock", "{product_name} 상품 재고량이 부족하여 주문할 수 없습니다.")</span></p>