-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: issue credit note on credit invoice - db change (#2676)
## Context Now we don't allow creation of credit notes on prepaid credits. We want to implement this possibility. When credits will be issued, we'll be creating a voiding outbound wallet_transaction. Currently we're tracking the outbound wallet transactions. To support this behaviour we'll need to add credit_note_id to the wallet transaction ## Description Added credit_note_id to wallet_transaction
- Loading branch information
1 parent
c64d89b
commit 849c4d7
Showing
5 changed files
with
35 additions
and
3 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
9 changes: 9 additions & 0 deletions
9
db/migrate/20241010055733_add_reference_to_credit_note_from_wallet_transaction.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,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddReferenceToCreditNoteFromWalletTransaction < ActiveRecord::Migration[7.1] | ||
disable_ddl_transaction! | ||
|
||
def change | ||
add_reference :wallet_transactions, :credit_note, type: :uuid, null: true, index: {algorithm: :concurrently} | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
...rate/20241011123148_add_foreign_key_constraint_to_credit_note_id_at_wallet_transaction.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 AddForeignKeyConstraintToCreditNoteIdAtWalletTransaction < ActiveRecord::Migration[7.1] | ||
def change | ||
add_foreign_key :wallet_transactions, :credit_notes, validate: false | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
...e/20241011123621_change_validate_on_foreign_key_from_wallet_transaction_to_credit_note.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 ChangeValidateOnForeignKeyFromWalletTransactionToCreditNote < ActiveRecord::Migration[7.1] | ||
def change | ||
validate_foreign_key :wallet_transactions, :credit_notes | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.