Commit Graph

23 Commits

Author SHA1 Message Date
isra el
ef45421150 fix(billing): retain paid plan until period end on cancellation
Polar's subscription.canceled signals a scheduled cancellation (access
continues until the period end), while subscription.revoked is the event
that should actually remove access. The webhook handler was downgrading
immediately on cancel and never handled revoke, so a Pro user dropped to
Free the moment they canceled instead of at their real period end.

- cancelSubscription now records cancelAtPeriodEnd + currentPeriodEnd and
  keeps the subscription active instead of deactivating it
- add revokeSubscription for the real downgrade, wired to the
  subscription.revoked event in the Polar webhook handler
- add controller + service specs covering event dispatch and the
  record-vs-downgrade DB semantics
- add jest moduleNameMapper so specs can resolve src/* path aliases

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 09:02:39 +03:00
isra el
b1c8585e11 chore(api): update polar sdk version 2026-05-24 16:48:39 +03:00
isra el
86060456fa fix(api): fix build issues 2025-12-14 15:01:26 +03:00
isra el
ca0ac8cf6e fix(api): fix build issue 2025-12-14 14:42:41 +03:00
isra el
ba0437ff01 chore(api): bump dependencies 2025-12-14 14:28:29 +03:00
isra el
455696275b feat(api): billing notifications 2025-10-29 06:18:30 +03:00
isra el
99efd20e7a fix(api): prevent duplicate checkout sessions per user 2025-08-04 08:40:03 +03:00
isra el
677a7b3554 update polar-sdk version 2025-03-30 14:28:27 +03:00
isra el
26b5ee3107 update polar-sdk package 2025-03-30 14:17:57 +03:00
isra el
f6763939e2 feat(api): implement optional job queue for sending sms with delay and scheduling 2025-03-24 03:51:30 +03:00
isra el
70d35ff1a5 chore(api): update packages 2025-03-09 11:27:17 +03:00
isra el
992c260e1a chore(api): update polar sdk and improve billing and checkout logic 2025-02-21 20:21:36 +03:00
isra el
c572070270 fix(api): fix polar webhook signature verification issue 2025-02-15 19:40:14 +03:00
isra el
014ca7cb52 new pricing and billing 2025-02-15 12:54:16 +03:00
isra el
cd31316c86 feat(api): webhooks implementation v1 2024-12-21 14:55:06 +03:00
isra el
6f250192da chore(api): update dependencies 2024-10-19 11:29:29 +03:00
isra el
a3eeb6da9a hotfix(api): update deprecated firebase-admin fcm send api 2024-09-12 23:06:56 +03:00
isra el
415e8452c0 feat(api): throttle all endpoints to 30 requests per minute 2024-03-30 18:47:31 +03:00
isra el
9be88bd2ff feat: reset password 2024-03-25 14:02:53 +03:00
isra el
5582b095a4 chore(api): update packages 2023-05-16 09:53:04 +03:00
isra el
09baa28923 feat: signin with google 2023-03-28 10:07:04 +03:00
isra el
d8dca6a55c config(api): update start script 2023-03-18 07:57:19 +03:00
isra el
78cce57091 refactor: move everything to one repo 2023-03-11 09:20:41 +03:00