mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(premium): give failed renewals a billing-cycle grace period (#3066)
This commit is contained in:
@@ -41,6 +41,9 @@ export const UserPremiumTypes = {
|
||||
|
||||
export type UserPremiumType = ValueOf<typeof UserPremiumTypes>;
|
||||
|
||||
export const PREMIUM_GRACE_PERIOD_DAYS = 3;
|
||||
export const PREMIUM_PAYMENT_RECOVERY_GRACE_DAYS = {monthly: 7, yearly: 14} as const;
|
||||
|
||||
export const UserPremiumTypesDescriptions: Record<keyof typeof UserPremiumTypes, string> = {
|
||||
NONE: 'No premium subscription',
|
||||
SUBSCRIPTION: 'Active premium subscription',
|
||||
|
||||
@@ -120,7 +120,7 @@ export const UserPrivateResponse = UserPartialResponse.extend({
|
||||
.string()
|
||||
.nullable()
|
||||
.describe(
|
||||
'ISO8601 timestamp at which the post-cancel grace period ends. Set when the subscription is fully canceled in Stripe; perks remain active and the original premium_since is restored on resubscribe until this timestamp passes. Null when not in grace.',
|
||||
'ISO8601 timestamp at which grace access ends after premium_until passes: after a failed renewal payment (7 days from the renewal for monthly plans, 14 for yearly), after a subscription ends (3 days), or during an App Store or Google Play grace period. Perks stay active and the original premium_since is kept on resubscribe until this timestamp passes. Null when no grace is recorded, in which case access lasts 3 days after premium_until.',
|
||||
),
|
||||
premium_discriminator: z
|
||||
.boolean()
|
||||
|
||||
Reference in New Issue
Block a user