Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle plan transition logic for "Upgrade" and "Downgrade" on Payment #974

Merged
merged 6 commits into from
Aug 24, 2024

Conversation

MikeSoft007
Copy link
Collaborator

Description

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.

Related Issue (Link to issue ticket)

hngprojects/hng_boilerplate_nestjs#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?

  • 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):

image

Types of changes

  • 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:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@johnson-oragui johnson-oragui merged commit c56fe40 into hngprojects:dev Aug 24, 2024
1 check passed
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.

2 participants