Description
When a user cancels their subscription (with cancellation scheduled at period end), the system currently allows them to subsequently perform upgrade or downgrade actions before the cancellation takes effect. This creates inconsistent subscription states and potential billing logic issues.
Expected Behavior
If a user has already initiated cancellation (cancel_at_period_end: true):
- Upgrade and downgrade actions should be rejected with an appropriate error (e.g., 400 Bad Request or 409 Conflict).
- The API should return a clear message indicating that the subscription is already scheduled for cancellation and cannot be modified.
Scenario 1: Cancel → Downgrade
Steps:
- User cancels subscription → "cancel_at_period_end": true
- Before cancellation takes effect, user requests an downgrade
- GET /v1/subscriptions still shows "cancel_at_period_end": true
Scenario 2: Cancel → Upgrade
Steps:
- User cancels subscription → "cancel_at_period_end": true
- Before cancellation takes effect, user requests an upgrade
- GET /v1/subscriptions still shows "cancel_at_period_end": true
Description
When a user cancels their subscription (with cancellation scheduled at period end), the system currently allows them to subsequently perform upgrade or downgrade actions before the cancellation takes effect. This creates inconsistent subscription states and potential billing logic issues.
Expected Behavior
If a user has already initiated cancellation (cancel_at_period_end: true):
Scenario 1: Cancel → Downgrade
Steps:
Scenario 2: Cancel → Upgrade
Steps: