Skip to content

Feat Allow multiple subscription_starting invoice_subscriptions when regenerating invoice #4083

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

Merged
merged 2 commits into from
Aug 1, 2025

Conversation

brunomiguelpinto
Copy link
Contributor

Context

To support regenerating invoices for starting subscriptions, we need to allow multiple invoice_subscriptions records with the same subscription_id and invoicing_reason = 'subscription_starting', as long as the invoice has been regenerated.

Currently, the uniqueness constraint (index_unique_starting_subscription_invoice) prevents this scenario, blocking valid regeneration flows for subscription starts.

Description

These changes allow invoice regeneration logic to function properly for starting subscriptions, while preserving database integrity for non-regenerated records.

@brunomiguelpinto brunomiguelpinto self-assigned this Jul 31, 2025
@brunomiguelpinto brunomiguelpinto merged commit 64d35b8 into main Aug 1, 2025
14 checks passed
@brunomiguelpinto brunomiguelpinto deleted the changed-starting-subscription-index branch August 1, 2025 08:48
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