-
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(precise_amount): Add migration, model methods and serializer (#2516
) ## Context For some customers some amounts are not enough precise as Lago convert fees to `amount_cent`. ## Description Add migration for columns for precise amount cents, add model methods and serializer attributes.
- Loading branch information
1 parent
2456a9c
commit f2bd12a
Showing
8 changed files
with
76 additions
and
12 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
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
16 changes: 16 additions & 0 deletions
16
db/migrate/20240829093425_add_precise_amount_cents_columns.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,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddPreciseAmountCentsColumns < ActiveRecord::Migration[7.1] | ||
def change | ||
safety_assured do | ||
change_table :fees, bulk: true do |t| | ||
t.decimal :precise_amount_cents, precision: 40, scale: 15, default: '0.0', null: false | ||
t.decimal :taxes_precise_amount_cents, precision: 40, scale: 15, default: '0.0', null: false | ||
end | ||
|
||
change_table :fees_taxes, bulk: true do |t| | ||
t.decimal :precise_amount_cents, precision: 40, scale: 15, default: '0.0', null: false | ||
end | ||
end | ||
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
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