Skip to content

feat: we need to grab charges even if deleted #4127

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 11, 2025

Conversation

brunomiguelpinto
Copy link
Contributor

@brunomiguelpinto brunomiguelpinto commented Aug 11, 2025

Context

When an invoice is regenerated (voided_invoice_id present), the associated AdjustedFee can reference a Charge or ChargeFilter that has been soft-deleted.
Currently:
• adjusted_fee.charge returns nil for deleted charges because the association respects the default scope.
• adjusted_fee.charge_filter behaves similarly.

This causes missing data in regenerated invoices and prevents correct fee reconstruction.

Description

This PR updates the service and model layer to reliably fetch Charge and ChargeFilter for AdjustedFee records when working with regenerated invoices

@brunomiguelpinto brunomiguelpinto self-assigned this Aug 11, 2025
@brunomiguelpinto brunomiguelpinto merged commit 7f9ed0b into main Aug 11, 2025
14 checks passed
@brunomiguelpinto brunomiguelpinto deleted the fix-calculations-with-deleted-charges branch August 11, 2025 18:57
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