Skip to content

feat(payment-gated-subs): Apply activation rules on plan upgrades#5541

Merged
osmarluz merged 2 commits into
mainfrom
feat/payment-gated-subs-3/apply-activation-rules-on-plan-upgrades
May 27, 2026
Merged

feat(payment-gated-subs): Apply activation rules on plan upgrades#5541
osmarluz merged 2 commits into
mainfrom
feat/payment-gated-subs-3/apply-activation-rules-on-plan-upgrades

Conversation

@osmarluz

@osmarluz osmarluz commented May 20, 2026

Copy link
Copy Markdown
Contributor

Context

When a plan's amount is updated and a pending upgrade subscription exists, Plans::UpdateService and Plans::UpdateAmountService trigger Subscriptions::PlanUpgradeService to create a new active subscription. The activation rules attached to the pending subscription were dropped in this flow, so payment-gated upgrades silently lost their rules.

Description

process_pending_subscriptions in both services now serializes the pending subscription's activation_rules into the {type:, timeout_hours:} shape and forwards them via the params of Subscriptions::PlanUpgradeService, which re-applies them to the new subscription through Subscriptions::ActivationRules::ApplyService.

@osmarluz
osmarluz requested a review from ancorcruz May 20, 2026 09:14

@ancorcruz ancorcruz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@osmarluz
osmarluz merged commit 2145667 into main May 27, 2026
12 checks passed
@osmarluz
osmarluz deleted the feat/payment-gated-subs-3/apply-activation-rules-on-plan-upgrades branch May 27, 2026 07:50
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