階段 27-4|購買限制規則(limited/daily/monthly/first7/first30)#39
Merged
Conversation
a80ecdb to
49384cd
Compare
49384cd to
da7d1a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
階段 27-4|購買限制規則(limited/daily/monthly/first7/first30)
目標
將你 JSON 的購買限制在前端落地:
purchase_limit_type∈limited|unlimited|daily|monthly|first7|first30purchase_max_count(對limited使用;其他型別視為當期上限=1)規格
PurchaseLimitPolicybool canPurchase(String storeId, DateTime now)void recordPurchase(String storeId, DateTime now)int remainingQuota(String storeId, DateTime now)(UI 顯示用)limit:daily:<YYYY-MM-DD>:<storeId>limit:monthly:<YYYY-MM>:<storeId>now - firstLaunchDate > N 天,返回不可購limit:once:<storeId>+ 計數驗收實例化需求
purchase_limit_type=limited,purchase_max_count=1canPurchase=true;recordPurchase後canPurchase=falsepurchase_limit_type=dailycanPurchase=false;跨日 →canPurchase=truepurchase_limit_type=monthlycanPurchase=false;下個月 →canPurchase=truecanPurchase=falselimited=0/1,daily=0/1,monthly=0/1)