-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: anrok <> credit_notes model changes (#2558)
We need to adjust credit_note and credit_note::applied_tax to reflect the changes in processing taxes: - applied_tax might not belong to a stored in lago tax, so tax_id becomes optional, - during reporting we might receive some errors, so credit_note can have many :error_details
- Loading branch information
1 parent
3bfa4f7
commit d2f5348
Showing
7 changed files
with
36 additions
and
8 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
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
7 changes: 7 additions & 0 deletions
7
db/migrate/20240910093646_change_tax_id_null_on_credit_note_applied_taxes.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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class ChangeTaxIdNullOnCreditNoteAppliedTaxes < ActiveRecord::Migration[7.1] | ||
def change | ||
change_column_null :credit_notes_taxes, :tax_id, true | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
db/migrate/20240910111203_update_indexes_for_credit_notes_taxes.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,12 @@ | ||
# frozen_string_literal: true | ||
|
||
class UpdateIndexesForCreditNotesTaxes < ActiveRecord::Migration[7.1] | ||
disable_ddl_transaction! | ||
|
||
def change | ||
remove_index :credit_notes_taxes, %i[credit_note_id tax_id], unique: true, algorithm: :concurrently | ||
|
||
add_index :credit_notes_taxes, :tax_code, algorithm: :concurrently | ||
add_index :credit_notes_taxes, %i[credit_note_id tax_code], unique: true, 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
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