Project

General

Profile

New Function #104

Updated by Deca Park about 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 /> 
 &nbsp; 1)<strong> if use_point param &gt; 0</strong><br /> 
 &nbsp; &nbsp; a) if order user&#39;s current available point &lt; use_point param<br /> 
 &nbsp; &nbsp; &nbsp; - return error (status: 400, error_code: &quot;order.error.overUsePoint&quot;, &quot;사용가능 포인트를 초과하여 주문할 수 없습니다.&quot;)<br /> 
 &nbsp; 2)<strong> if use_money param &gt; 0</strong><br /> 
 &nbsp; &nbsp; a) if order user&#39;s current available money &lt; use_money param<br /> 
 &nbsp; &nbsp; &nbsp; - return error (status: 400, error_code: &quot;order.error.overUseMoney&quot;, &quot;사용가능 적립금을 초과하여 주문할 수 없습니다.&quot;)<br /> 
 &nbsp; 3) <strong>if coupon_code param is NOT NULL</strong><br /> 
 &nbsp; &nbsp; a) check if the coupon_code is existed on DB(st_user_coupon) and use_yn = &#39;N&#39;<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp;[logic]<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp;DB (st_user_coupon)<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp;condition: user_seq = {user_seq of id param} AND coupon_code = {param}<br /> 
 &nbsp; &nbsp; b) if the coupon_code is NOT existed OR use_yn != &#39;N&#39; (N: NOT used)<br /> 
 &nbsp; &nbsp; &nbsp; - return error (status: 400, error_code: &quot;order.error.notAvailableCoupon&quot;, &quot;order.error.NotAvailableCoupon&quot;, &quot;{coupon_name} 쿠폰은 주문 가능한 쿠폰이 아닙니다.&quot;)</p> 

 <p><span style="color:#e74c3c;">2.Add validation logic for order_products &gt;&nbsp;order_count<br /> 
 &nbsp; 1) if&nbsp;order product&#39;s&nbsp;<strong>st_product.stock_count is NOT NULL</strong><br /> 
 &nbsp; &nbsp;&nbsp;&nbsp;a) if order product&#39;s&nbsp;order_count <strong>&gt;</strong> st_product.stock_count<br /> 
 &nbsp; &nbsp; &nbsp;&nbsp;- return error (status: 400, error_code: &quot;order.error.noProductStock&quot;,&nbsp;&quot;{product_name} 상품 재고량이 부족하여 주문할 수 없습니다.&quot;)</span></p> 

Back