Skip to content
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): flag customer as dunning campaign completed on last attempt execution #2889

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

ancorcruz
Copy link
Contributor

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

Flag customers as dunning campaign completed on last attempt execution, also check the completed flag instead of the campaign max attempts as execution exit condition.

Also, extracts code to reset customer dunning campaign status fields to be reused.

the way we are currently resetting customer's dunning campaign status
fields is error prone as this is composed by 3 fields and we could leave
some behind.
... on dunning campaign attempt execution when customer last attempt
count reaches dunning campaign max attempts.

Also, use customer dunning_campaign_completed? as guard clause instead
of comparing the number of attempts executed against the campaign max
attempts
@ancorcruz ancorcruz requested a review from rsempe November 28, 2024 08:51
@ancorcruz ancorcruz self-assigned this Nov 28, 2024
@rsempe rsempe merged commit c4420a6 into main Nov 28, 2024
6 checks passed
@rsempe rsempe deleted the feat/dunning-edit-reset-customer branch November 28, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants