Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

feat(investments): add Cash Management Account subtype (#3532)

Justin McBrideca4a6b4a0e5b
diff --git a/app/models/investment.rb b/app/models/investment.rb
index 4e397326ed..7139f66b25 100644
--- a/app/models/investment.rb
+++ b/app/models/investment.rb
@@ -9,6 +9,7 @@ class Investment < ApplicationRecord
SUBTYPES = {
# === United States ===
"brokerage" => { short: "Brokerage", long: "Brokerage", region: "us", tax_treatment: :taxable },
+ "cash_management" => { short: "CMA", long: "Cash Management Account", region: "us", tax_treatment: :taxable },
"401k" => { short: "401(k)", long: "401(k)", region: "us", tax_treatment: :tax_deferred },
"roth_401k" => { short: "Roth 401(k)", long: "Roth 401(k)", region: "us", tax_treatment: :tax_exempt },
"403b" => { short: "403(b)", long: "403(b)", region: "us", tax_treatment: :tax_deferred },
diff --git a/config/locales/views/investments/en.yml b/config/locales/views/investments/en.yml
index 63a12c0def..6e098d4fde 100644
--- a/config/locales/views/investments/en.yml
+++ b/config/locales/views/investments/en.yml
@@ -15,6 +15,9 @@ en:
brokerage:
short: Brokerage
long: Brokerage
+ cash_management:
+ short: CMA
+ long: Cash Management Account
401k:
short: 401(k)
long: 401(k)
diff --git a/test/models/investment_test.rb b/test/models/investment_test.rb
index 34f047cc20..524afe3783 100644
--- a/test/models/investment_test.rb
+++ b/test/models/investment_test.rb
@@ -25,7 +25,7 @@ class InvestmentTest < ActiveSupport::TestCase
end
test "tax_treatment returns taxable for standard accounts" do
- %w[brokerage mutual_fund angel trust ugma utma other].each do |subtype|
+ %w[brokerage cash_management mutual_fund angel trust ugma utma other].each do |subtype|
investment = Investment.new(subtype: subtype)
assert_equal :taxable, investment.tax_treatment, "Expected #{subtype} to be taxable"
end