|
@@ -68,21 +68,23 @@ belongs_to :kdan_product
|
|
~~~ruby
|
|
~~~ruby
|
|
{
|
|
{
|
|
kdan_id:integer,
|
|
kdan_id:integer,
|
|
- pack_id:integer,
|
|
|
|
- stauts:[free_trial, active, expired, refund, cancel]
|
|
|
|
|
|
+ kdan_product_id:integer,
|
|
|
|
+ stauts:[free_trial, subscribed, expired, refund, cancel]
|
|
}
|
|
}
|
|
~~~
|
|
~~~
|
|
* free\_trial: Subscription is in free trial period.
|
|
* free\_trial: Subscription is in free trial period.
|
|
-* active: Subscription is active now.
|
|
|
|
-* expired: Subscription is expired now.
|
|
|
|
|
|
+* subscribed: Subscription is active now.
|
|
|
|
+* expired: Only for customer service/creative store offered products
|
|
* cancel: Auto-renew canceled but current subscription not changed.
|
|
* cancel: Auto-renew canceled but current subscription not changed.
|
|
* refund: Auto-renew canceled and current subscription rollbacked.
|
|
* refund: Auto-renew canceled and current subscription rollbacked.
|
|
-* status priority: **active \> free\_trial \> expired \> cancel \> refund**
|
|
|
|
|
|
+* status priority based on receipts.purchase_date
|
|
|
|
|
|
### Schedule.rb
|
|
### Schedule.rb
|
|
* update KdanPackSubscriptionStatus every 15m
|
|
* update KdanPackSubscriptionStatus every 15m
|
|
-* select updated receipts in 15min
|
|
|
|
-* select expired receipts in 15min
|
|
|
|
|
|
+ * select kdan\_ids from kdan.updated_at in 15min
|
|
|
|
+ * select kdan\_ids from receipts.end\_of\_date in 15min
|
|
|
|
+ * distinct kdan\_ids
|
|
|
|
+ * cals\_pack\_subscription_status(kdan.receipts)
|
|
|
|
|
|
## CR System
|
|
## CR System
|
|
### SendyMailList
|
|
### SendyMailList
|
|
@@ -92,15 +94,14 @@ belongs_to :kdan_product
|
|
sendy_list_long_id:string,
|
|
sendy_list_long_id:string,
|
|
sendy_list_short_id:integer,
|
|
sendy_list_short_id:integer,
|
|
select_criteria:json,
|
|
select_criteria:json,
|
|
- active_count:integer,
|
|
|
|
- unsubscribed_count:integer,
|
|
|
|
- bounced_count:integer,
|
|
|
|
- bounced_soft_count:integer,
|
|
|
|
- complaint_count:integer,
|
|
|
|
|
|
+ email_count:integer,
|
|
sendy_delete_at:datetime,
|
|
sendy_delete_at:datetime,
|
|
}
|
|
}
|
|
~~~
|
|
~~~
|
|
|
|
|
|
|
|
+* query from backup db: meber\_center and iap\_center
|
|
|
|
+* sequel to insert sendy list and subscriber
|
|
|
|
+
|
|
# Views
|
|
# Views
|
|
## CR System
|
|
## CR System
|
|
|
|
|