mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 22:34:47 +00:00
* Add tax treatment support for accounts, investments, and cryptos * Replace hardcoded region labels with I18n translations * Add I18n support for subtype labels with fallback to hardcoded values * fixed schema --------- Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
30 lines
505 B
Ruby
30 lines
505 B
Ruby
class Crypto < ApplicationRecord
|
|
include Accountable
|
|
|
|
# Crypto is taxable by default, but can be held in tax-advantaged accounts
|
|
# (e.g., self-directed IRA, though rare)
|
|
enum :tax_treatment, {
|
|
taxable: "taxable",
|
|
tax_deferred: "tax_deferred",
|
|
tax_exempt: "tax_exempt"
|
|
}, default: :taxable
|
|
|
|
class << self
|
|
def color
|
|
"#737373"
|
|
end
|
|
|
|
def classification
|
|
"asset"
|
|
end
|
|
|
|
def icon
|
|
"bitcoin"
|
|
end
|
|
|
|
def display_name
|
|
"Crypto"
|
|
end
|
|
end
|
|
end
|