Overview
SubscriptionsService.pauseSubscription() in src/payments/subscriptions/subscriptions.service.ts accepts a resumeAt and stores it on the subscription's properties (resumeAt, isPaused: true), but the code that would actually schedule the automatic resume is left commented out as a TODO (lines ~116-135). A subscription-job.processor.ts already exists to handle subscription jobs, so the consumer side is present — only the scheduling call is missing. As a result, a subscription paused with a resumeAt stays paused forever and must be resumed manually, silently breaking the documented pause/auto-resume behaviour.
Specifications
Features:
- Pausing a subscription with a future
resumeAt schedules an automatic resume at that time.
- The resume job is retried on failure and is a no-op if the subscription was already resumed/cancelled.
Tasks:
- Replace the commented-out TODO in
pauseSubscription() with a real enqueue: schedule a delayed RESUME_SUBSCRIPTION job (delay = resumeAt - now) via the queue service, only when resumeAt is in the future.
- Implement/verify the corresponding handler in
subscription-job.processor.ts that transitions the subscription from PAUSED back to ACTIVE, guarding against double-resume and missing/cancelled subscriptions.
- Ignore or reject a
resumeAt in the past with a clear error.
Impacted Files:
- src/payments/subscriptions/subscriptions.service.ts
- src/payments/subscriptions/subscription-job.processor.ts
Acceptance Criteria
- Pausing with a future
resumeAt results in the subscription becoming ACTIVE again at that time without manual intervention.
- The resume handler is idempotent (a second run does not double-resume) and safely handles an already-cancelled subscription.
- A
resumeAt in the past is handled explicitly rather than silently ignored.
Overview
SubscriptionsService.pauseSubscription()insrc/payments/subscriptions/subscriptions.service.tsaccepts aresumeAtand stores it on the subscription'sproperties(resumeAt,isPaused: true), but the code that would actually schedule the automatic resume is left commented out as a TODO (lines ~116-135). Asubscription-job.processor.tsalready exists to handle subscription jobs, so the consumer side is present — only the scheduling call is missing. As a result, a subscription paused with aresumeAtstays paused forever and must be resumed manually, silently breaking the documented pause/auto-resume behaviour.Specifications
Features:
resumeAtschedules an automatic resume at that time.Tasks:
pauseSubscription()with a real enqueue: schedule a delayedRESUME_SUBSCRIPTIONjob (delay = resumeAt - now) via the queue service, only whenresumeAtis in the future.subscription-job.processor.tsthat transitions the subscription fromPAUSEDback toACTIVE, guarding against double-resume and missing/cancelled subscriptions.resumeAtin the past with a clear error.Impacted Files:
Acceptance Criteria
resumeAtresults in the subscription becomingACTIVEagain at that time without manual intervention.resumeAtin the past is handled explicitly rather than silently ignored.