New Function #52
Updated by Deca Park almost 2 years ago
<p>[<strong>Regular Coupon</strong> <p>[Save Money process logic]</p> <p>1.when POST signup API is done</p> <p> 1) <p> 1) if <strong>signup coupon </strong>was save money was already created, SKIP <br <strong>SKIP </strong><br /> - DB: st_user_coupon<br DB: st_user_save_money<br /> - conditions: user_seq conditions: user_seq = {the user_seq} AND regular_coupon_type = <strong>'RC01'</strong><br AND save_money_type = <strong>'SM02'</strong><br /> 2) create signup coupon<br save money<br /> a) if st_money_coupon.signup_coupon_code is NOT NULL<br st_money_coupon.money_signup > 0 (NOT NULL)<br /> a-1) INSERT st_user_coupon<br st_user_save_money<br /> - user_seq = {signup user_seq}, coupon_code save_money_type = {signup_coupon_code}<br <strong>'SM02'</strong><br /> - regular_coupon_type save_money = <strong>'RC01'</strong><br {st_money_coupon.money_signup}<br /> , save_date={signup datetime}, reg_date/reg_user_seq</p> <p>2.when POST /api/review API is done</p> <p> <s>1) if st_coupon.use_period_limit_yn = 'Y' AND expire_days save money was already created, <strong>SKIP </strong><br /> - DB: st_user_save_money<br /> - conditions: review_code= {the review_code} AND save_money_type = <strong>'SM03'</strong></s><br /> 2) create save money<br /> a) if st_money_coupon.money_review_text > 0 (with signup_coupon_code)<br (NOT NULL) OR<br /> st_money_coupon.money_review_image > 0 (NOT NULL) <br /> a-1) INSERT st_user_save_money<br /> user_seq = {write user_seq}, save_money_type = <strong>'SM03'</strong><br /> if attach_file exists<br /> - expire_date save_money = {current date} + expire_days<br {st_money_coupon.money_review_image}<br /> else<br /> - reg_date</p> save_money = {st_money_coupon.money_review_text}<br /> save_date={signup datetime}, reg_date/reg_user_seq</p> <p>2.if user.birth_day <p>3.when st_order.order_status is NOT NULL AND birth_day updated with 'OS04' (구매확정: purchase confirmation) on ADMIN<br /> OR when st_order.order_status is {current date}</p> updated with 'SS04' (수령완료: Receipt complete) on ADMIN<br /> <strong>- set status code by constant bcz the status code coube be changed</strong></p> <p> 1) <p> 1) if <strong>birthday coupon</strong> save money was already created, SKIP <br <strong>SKIP </strong><br /> - DB: st_user_coupon<br DB: st_user_save_money<br /> - conditions: user_seq conditions: order_no = {the user_seq} AND regular_coupon_type = <strong>'RC02'</strong><br order_no} AND save_money_type = <strong>'SM01' </strong><br /> 2) create birthday coupon<br save money<br /> a) if st_money_coupon.birthday_coupon_code is NOT NULL<br st_money_coupon.money_grant_ratio > 0 (NOT NULL)<br /> a-1) INSERT st_user_coupon<br st_user_save_money<br /> - user_seq = {signup {write user_seq}, coupon_code save_money_type = {birthday_coupon_code}<br <strong>'SM01'</strong><br /> - regular_coupon_type =<strong> 'RC02'</strong><br mall_code = {the mall_code} , order_no = {the order_no}<br /> if st_coupon.use_period_limit_yn save_money = 'Y' AND expire_days > 0 (with birthday_coupon_code)<br {st_order.payment_amount} * {money_grant_ratio} (%)<br /> - expire_date = {current date} + expire_days<br truncate on first number (ex: 1001 -> 1000)<br /> - reg_date<br save_date={signup datetime}<br /> </p> reg_date/reg_user_seq</p>