-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dunning): Add deleted_at to dunning campaign threshold (#2831)
## Roadmap Task 👉 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 This change adds capabilities to soft delete dunning campaign thresholds
- Loading branch information
Showing
5 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
db/migrate/20241118165935_add_deleted_at_to_dunning_campaign_thresholds.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddDeletedAtToDunningCampaignThresholds < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :dunning_campaign_thresholds, :deleted_at, :timestamp | ||
|
||
safety_assured do | ||
add_index :dunning_campaign_thresholds, :deleted_at | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
db/migrate/20241119110219_update_unique_index_on_dunning_campaign_thresholds.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class UpdateUniqueIndexOnDunningCampaignThresholds < ActiveRecord::Migration[7.1] | ||
disable_ddl_transaction! | ||
|
||
def change | ||
remove_index :dunning_campaign_thresholds, %i[dunning_campaign_id currency], unique: true, algorithm: :concurrently | ||
|
||
add_index :dunning_campaign_thresholds, | ||
[:dunning_campaign_id, :currency], | ||
unique: true, | ||
where: "deleted_at IS NULL", | ||
algorithm: :concurrently | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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