1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Add nice formatting for subtypes on account list (#2138)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Add nice formatting for subtypes on account list

* Fix rubocop linting errors

* Implement better mapping

* Fix rubocop linting

* Add short and long versions of subtypes

* Simplify subtype reference

Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
Signed-off-by: Alex Hatzenbuhler <hatz@hey.com>

* Simplify reference logic, add a small test

* Fix test

* Fix tests

---------

Signed-off-by: Alex Hatzenbuhler <hatz@hey.com>
Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
This commit is contained in:
Alex Hatzenbuhler 2025-04-22 13:10:50 -05:00 committed by GitHub
parent db34f6d7a2
commit 47aeaf8cea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 83 additions and 30 deletions

View file

@ -1,20 +1,20 @@
class Investment < ApplicationRecord
include Accountable
SUBTYPES = [
[ "Brokerage", "brokerage" ],
[ "Pension", "pension" ],
[ "Retirement", "retirement" ],
[ "401(k)", "401k" ],
[ "Traditional 401(k)", "traditional_401k" ],
[ "Roth 401(k)", "roth_401k" ],
[ "529 Plan", "529_plan" ],
[ "Health Savings Account", "hsa" ],
[ "Mutual Fund", "mutual_fund" ],
[ "Traditional IRA", "traditional_ira" ],
[ "Roth IRA", "roth_ira" ],
[ "Angel", "angel" ]
].freeze
SUBTYPES = {
"brokerage" => { short: "Brokerage", long: "Brokerage" },
"pension" => { short: "Pension", long: "Pension" },
"retirement" => { short: "Retirement", long: "Retirement" },
"401k" => { short: "401(k)", long: "401(k)" },
"traditional_401k" => { short: "Traditional 401(k)", long: "Traditional 401(k)" },
"roth_401k" => { short: "Roth 401(k)", long: "Roth 401(k)" },
"529_plan" => { short: "529 Plan", long: "529 Plan" },
"hsa" => { short: "HSA", long: "Health Savings Account" },
"mutual_fund" => { short: "Mutual Fund", long: "Mutual Fund" },
"traditional_ira" => { short: "Traditional IRA", long: "Traditional IRA" },
"roth_ira" => { short: "Roth IRA", long: "Roth IRA" },
"angel" => { short: "Angel", long: "Angel" }
}.freeze
class << self
def color