Practitionist / Practitionist/elluminar_web
🔁 Handle subscription.resumed — restore ACTIVE status
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 17h 2m
- Merged PRs (30d)
- 18
Description
Context
docs/DEPLOYMENT.md instructs enabling the subscription.resumed Razorpay webhook event, but STATUS_MAP in handleRazorpaySubscriptionEvent (src/lib/commerce/subscriptions.ts) has no entry for it — resuming a paused/halted subscription updates nothing locally, so the Subscription row stays PAUSED/PAST_DUE while Razorpay bills again.
Implementation
- Add
"subscription.resumed": "ACTIVE"to STATUS_MAP; when transitioning PAST_DUE/PAUSED → ACTIVE, recomputecurrentPeriodStart/Endfrom the event payload's charge fields (mirror thesubscription.chargedperiod logic) so access windows don't silently extend. - If the resume event carries no billing-cycle info, rely on the paired
subscription.chargedthat Razorpay emits on the next cycle; resumed should still flip status immediately. - Reuse the lapse/reinstate helper used by
activatedso enrollments scoped byEnrollment.subscriptionIdregain access exactly once (idempotent). - Add a unit test with a synthetic resumed payload.
Acceptance
- Resuming in Razorpay dashboard flips local status to ACTIVE and restores scoped enrollments
- No duplicate credit grants or period extension
Part of #38. Advances #42.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/lib/commerce/subscriptions.ts at handleRazorpaySubscriptionEvent and compare the existing activated and subscription.charged handling, including the lapse/reinstate helper. Add coverage with a synthetic subscription.resumed payload; done means the subscription becomes ACTIVE, scoped enrollments regain access once, and billing periods or credits are not duplicated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, payments
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100