summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-12 15:11:36 -0500
committerBen Sima <ben@bsima.me>2025-11-12 15:11:36 -0500
commite3be9b2fbf31d76ec65be38c484e6557a854742b (patch)
tree2c73bef213d2c00fd3ce1f53b0c37bb727a07d6b /Biz/PodcastItLater
parentee1138b39b9709871adcb97b915d5944cd2091c9 (diff)
Change free plan from monthly to lifetime limit
Free tier now has 10 articles total (lifetime) instead of 10 per month. Period boundaries for free users now span from account creation to far future.
Diffstat (limited to 'Biz/PodcastItLater')
-rw-r--r--Biz/PodcastItLater/Billing.py21
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",