feat: add pause resume billing adjustment - #1071
Open
eischideraa-unn wants to merge 1 commit into
Open
Conversation
|
@eischideraa-unn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements subscription pause/resume billing adjustment support for the app’s subscription lifecycle. It adds the missing billing behavior around paused subscriptions so users can pause an active subscription, receive a prorated billing credit, and resume without losing billing continuity. The fix ensures the subscription state, pause history, and next billing date behave consistently during pause and resume cycles.
Closes #932
Motivation
The codebase already had pause-related UI/state plumbing, but the billing adjustment flow was incomplete and inconsistent across the subscription store. Specifically, the app needed a clear and safe flow for:
This PR closes that gap in the key subscription logic implemented in subscriptionStore.ts and the pause model in pause.ts.
What Changed
1) Subscription pause logic
The store now properly creates a pause record when a subscription is paused:
Implemented in:
2) Billing adjustment metadata
The pause record model now includes the fields needed to represent billing-adjustment behavior and resume lifecycle tracking, including:
Updated in:
3) Resume flow with billing restart
When a subscription is resumed:
This protects against billing drift when a subscription is paused and later resumed.
4) Regression coverage
Added targeted unit tests covering the critical pause/resume billing flow, including:
Test coverage added in:
5) Documentation alignment
The issue flow is consistent with the pause/resume billing documentation already present in:
Edge Cases Considered
Testing
Added focused unit coverage for the newly introduced behavior:
Note: this PR is prepared with the implementation in place and unit tests added, but the full CI quality gates below remain to be validated in the project environment.
Pull Request Checklist
Quality Gates (All must pass before merge)
Additional Requirements