Skip to content

Feature/prorated plans#18

Merged
krakenhavoc merged 3 commits intomainfrom
feature/prorated-plans
Mar 16, 2026
Merged

Feature/prorated plans#18
krakenhavoc merged 3 commits intomainfrom
feature/prorated-plans

Conversation

@krakenhavoc
Copy link
Contributor

This pull request introduces a new paid plan upgrade flow, including backend API endpoints, service logic, validation, and frontend integration for previewing and executing subscription upgrades. The implementation covers Stripe payment handling, proration calculation, and UI changes for a seamless upgrade experience.

Backend: Plan upgrade APIs and service logic

  • Added previewUpgrade and upgradeSubscription methods to BillingService, including plan validation, price difference calculation, Stripe integration, and immediate charging for upgrades.
  • Introduced new endpoints in BillingController for /upgrade/preview and /upgrade, with authentication, rate limiting, and proper API documentation.
  • Implemented UpgradePlanDto for upgrade requests, validating allowed plans.
  • Synced plan from Stripe price ID during subscription updates, ensuring accurate plan tracking.

Backend: Test coverage and Stripe mock updates

  • Added comprehensive tests for upgrade preview and upgrade flows, including error cases and Stripe interactions.
  • Updated Stripe mocks to support new endpoints and actions for upgrade scenarios. [1] [2]
  • Added controller tests for new endpoints. [1] [2]

Frontend: Upgrade flow integration

  • Integrated upgrade preview and confirmation modal in Billing.tsx, including error handling, amount formatting, and plan metadata. [1] [2] [3] [4]

Backend: Plan upgrade APIs and service logic

  • Added previewUpgrade and upgradeSubscription methods to BillingService for validating upgrades, calculating price differences, and handling Stripe payments and plan changes.
  • Introduced /upgrade/preview and /upgrade endpoints in BillingController with authentication, rate limiting, and API docs.
  • Implemented UpgradePlanDto for validating upgrade requests.
  • Synced plan from Stripe price ID during subscription updates for accurate plan tracking.

Backend: Test coverage and Stripe mock updates

  • Added tests for upgrade preview and upgrade flows, including error cases and Stripe mock updates. [1] [2] [3]
  • Added controller tests for new endpoints. [1] [2]

Frontend: Upgrade flow integration

  • Integrated upgrade preview and confirmation modal in Billing.tsx, with error handling, amount formatting, and plan metadata. [1] [2] [3] [4]

@krakenhavoc krakenhavoc merged commit 02aa749 into main Mar 16, 2026
18 checks passed
@krakenhavoc krakenhavoc deleted the feature/prorated-plans branch March 16, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant