Project

General

Profile

New Function #51

Updated by Deca Park over 1 year ago

<p>[Save Money process logic]</p> 

 <p>1.when POST signup API is done</p> 

 <p>&nbsp;&nbsp;1) if save money was already created, <strong>SKIP&nbsp;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - DB:&nbsp;st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - conditions:&nbsp;user_seq = {the user_seq} AND&nbsp;save_money_type&nbsp;= <strong>&#39;SM02&#39;</strong><br /> 
 &nbsp; 2) create save money<br /> 
 &nbsp; &nbsp; a) if st_money_coupon.money_signup &gt; 0 (NOT NULL)<br /> 
 &nbsp; &nbsp; &nbsp; a-1) INSERT st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; user_seq = {signup user_seq}, save_money_type = <strong>&#39;SM02&#39;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; save_money = {st_money_coupon.money_signup}<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; , save_date={signup datetime}, reg_date/reg_user_seq</p> 

 <p>2.when POST /api/review API is done</p> 

 <p>&nbsp; <s>1) if save money was already created, <strong>SKIP&nbsp;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - DB:&nbsp;st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - conditions:&nbsp;review_code= {the review_code} AND&nbsp;save_money_type&nbsp;= <strong>&#39;SM03&#39;</strong></s><br /> 
 &nbsp; 2) create save money<br /> 
 &nbsp; &nbsp; a) if st_money_coupon.money_review_text &gt; 0 (NOT NULL) OR<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; st_money_coupon.money_review_image &gt; 0 (NOT NULL)&nbsp;<br /> 
 &nbsp; &nbsp; &nbsp; a-1) INSERT st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; user_seq = {write user_seq}, save_money_type = <strong>&#39;SM03&#39;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; if attach_file exists<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - save_money = {st_money_coupon.money_review_image}<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; else<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - save_money = {st_money_coupon.money_review_text}<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; save_date={signup datetime}, reg_date/reg_user_seq</p> 

 <p>3.when st_order.order_status is updated with &#39;OS04&#39; (구매확정: purchase confirmation) on ADMIN<br /> 
 &nbsp; OR when st_order.order_status is updated with &#39;SS04&#39; (수령완료: Receipt complete) on ADMIN</p> 

 <p>&nbsp;&nbsp;1) if save money was already created, <strong>SKIP&nbsp;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - DB:&nbsp;st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; - conditions:&nbsp;order_no = {the order_no} AND&nbsp;save_money_type&nbsp;= <strong>&#39;SM01&#39;&nbsp;</strong><br /> 
 &nbsp; 2) create save money<br /> 
 &nbsp; &nbsp; a) if st_money_coupon.money_grant_ratio &gt; 0 (NOT NULL)<br /> 
 &nbsp; &nbsp; &nbsp; a-1) INSERT st_user_save_money<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; user_seq = {write user_seq}, save_money_type = <strong>&#39;SM01&#39;</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; mall_code = {the mall_code} , order_no = {the order_no}<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; save_money = {st_order.payment_amount} * {money_grant_ratio} (%)<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - truncate on first number (ex: 1001 -&gt; 1000)<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; save_date={signup datetime}<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; reg_date/reg_user_seq</p> 

Back