-
Notifications
You must be signed in to change notification settings - Fork 100
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(dunning): reset customer dunning campaign last attempt data on threshold changes #2861
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
improve code organization and readability
these will test side effects on campaign thresholds updates, reset last dunning campaign attempt is required when the threshold does not match anymore.
when the amount threshold does not match anymore
when matching threshold changes currency and it is not applicable anymore
also refactor the code to trigger the customer reset if there is a change in thresholds (discarded or changed) and there isn't at least one of the persisted thresholds of the campaigh matching a customer overdue blance with its currency
prior to this change in accepts to create new records with the same currency as an existing one with the new record deleted_at not null. however if the existing record was discarded (deleted_at not nil) and the new record is not discarded and matches the currency with the existing one, validation does not allow the record to be saved (not valid)
to cover the scneairo when a threshold is deleted an a new one is added in the same request that still matches the customer overdue balances and the customer should not be reseted
when there is still a matching currency threshold it does not reset the customer...
rsempe
reviewed
Nov 25, 2024
rsempe
reviewed
Nov 25, 2024
rsempe
reviewed
Nov 25, 2024
rsempe
reviewed
Nov 25, 2024
rsempe
approved these changes
Nov 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Roadmap
👉 https://getlago.canny.io/feature-requests/p/set-up-payment-retry-logic
👉 https://getlago.canny.io/feature-requests/p/send-reminders-for-overdue-invoices
Context
We want to automate dunning process so that our users don't have to look at each customer to maximize their chances of being paid retrying payments of overdue balances and sending email reminders.
We are extending dunning campaigns management to edit and delete campaigns.
Description
When a dunning campaign threshold changes, it resets customers last_dunning_campaign_attempt fields with the updated campaign applicable (through direct association or falling back to it through the organization default) when the thresholds does not match anymore (currency and/or amount_cents changed or deletion of the threshold).