diff options
Diffstat (limited to 'Biz/PodcastItLater/Billing.py')
| -rw-r--r-- | Biz/PodcastItLater/Billing.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Biz/PodcastItLater/Billing.py b/Biz/PodcastItLater/Billing.py index 025f1aa..4cf1c0e 100644 --- a/Biz/PodcastItLater/Billing.py +++ b/Biz/PodcastItLater/Billing.py @@ -61,7 +61,7 @@ def get_period_boundaries( """Get billing period boundaries for user. For paid users: use Stripe subscription period. - For free users: use current calendar month (UTC). + For free users: lifetime (from account creation to far future). Returns: tuple: (period_start, period_end) as datetime objects @@ -71,20 +71,11 @@ def get_period_boundaries( period_start = datetime.fromisoformat(user["current_period_start"]) period_end = datetime.fromisoformat(user["current_period_end"]) else: - # Free user - use calendar month + # Free user - lifetime limit from account creation + period_start = datetime.fromisoformat(user["created_at"]) + # Set far future end date (100 years from now) now = datetime.now(timezone.utc) - period_start = now.replace( - day=1, - hour=0, - minute=0, - second=0, - microsecond=0, - ) - # Get first day of next month - if now.month == 12: # noqa: PLR2004 - period_end = period_start.replace(year=now.year + 1, month=1) - else: - period_end = period_start.replace(month=now.month + 1) + period_end = now.replace(year=now.year + 100) return period_start, period_end @@ -407,7 +398,7 @@ def get_tier_info(tier: str) -> dict[str, typing.Any]: "name": "Free", "articles_limit": 10, "price": "$0", - "description": "10 articles per month", + "description": "10 articles total", }, "personal": { "name": "Personal", |
