This PR introduces functionality that allows users to upgrade or downgrade their subscription plans within the application. The implementation includes:
A new endpoint to handle plan upgrades and downgrades.
Validation to ensure users can only switch to valid plans.
Logic to prorate charges or credits based on the current billing cycle.
Integration with Stripe to handle the necessary payment adjustments.
Database updates to reflect the new subscription plan and billing cycle.
This change is required to provide flexibility to users who may need to adjust their subscription plans due to changes in their usage requirements. By enabling plan upgrades and downgrades, we aim to enhance the user experience and cater to a broader range of customer needs.
How Has This Been Tested?
Integration tests were performed to ensure the changes work smoothly with existing functionalities.
Manual testing was conducted using Postman to verify the correct behavior of the API endpoints.
Screenshots (if appropriate - Postman, etc):
Types of changes
[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[X] My code follows the code style of this project.
[X] My change requires a change to the documentation.
Description
This PR introduces functionality that allows users to upgrade or downgrade their subscription plans within the application. The implementation includes:
Related Issue (Link to issue ticket)
https://github.com/hngprojects/hng_boilerplate_nestjs/issues/876
Motivation and Context
This change is required to provide flexibility to users who may need to adjust their subscription plans due to changes in their usage requirements. By enabling plan upgrades and downgrades, we aim to enhance the user experience and cater to a broader range of customer needs.
How Has This Been Tested?
Screenshots (if appropriate - Postman, etc):
Types of changes
Checklist: