Skip to content

Commit

Permalink
Add federal tax data migration
Browse files Browse the repository at this point in the history
  • Loading branch information
neb417 committed Jul 11, 2024
1 parent 958f5e6 commit 2f8fadc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions db/data/20240711124610_create_tax_tables.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

class CreateTaxTables < ActiveRecord::Migration[7.0]
def up
FederalTaxBracket.create(tier: 'Tier 1', bottom_range: 0, top_range: 23_200, rate: 0.1, cumulative: 0)
FederalTaxBracket.create(tier: 'Tier 2', bottom_range: 23_001, top_range: 94_300, rate: 0.12, cumulative: 2_320)
FederalTaxBracket.create(tier: 'Tier 3', bottom_range: 94_301, top_range: 201_050, rate: 0.22, cumulative: 10_852)
FederalTaxBracket.create(tier: 'Tier 4', bottom_range: 201_051, top_range: 383_900, rate: 0.24, cumulative: 34_337)
FederalTaxBracket.create(tier: 'Tier 5', bottom_range: 383_901, top_range: 487_450, rate: 0.32, cumulative: 78_221)
FederalTaxBracket.create(tier: 'Tier 6', bottom_range: 487_451, top_range: 731_200, rate: 0.35, cumulative: 111_357)
FederalTaxBracket.create(tier: 'Tier 7', bottom_range: 731_201, top_range: 10_000_000, rate: 0.35, cumulative: 196_669)
end

def down
raise ActiveRecord::IrreversibleMigration
end
end
1 change: 1 addition & 0 deletions db/data_schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DataMigrate::Data.define(version: 20240711124610)

0 comments on commit 2f8fadc

Please sign in to comment.