Add tax treatment classification for investment accounts with international support (#693)

* 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>
This commit is contained in:
LPW
2026-01-18 11:29:02 -05:00
committed by GitHub
parent 6ec03e93f4
commit 64dc5c2fb8
14 changed files with 488 additions and 23 deletions

View File

@@ -0,0 +1,17 @@
<%# locals: (account:) %>
<%
treatment = account.tax_treatment
badge_classes = case treatment
when :tax_exempt
"bg-green-500/10 text-green-600 theme-dark:text-green-400"
when :tax_deferred
"bg-blue-500/10 text-blue-600 theme-dark:text-blue-400"
when :tax_advantaged
"bg-purple-500/10 text-purple-600 theme-dark:text-purple-400"
else
"bg-gray-500/10 text-secondary"
end
%>
<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium <%= badge_classes %>" title="<%= t("accounts.tax_treatment_descriptions.#{treatment}") %>">
<%= account.tax_treatment_label %>
</span>

View File

@@ -9,6 +9,9 @@
<div class="truncate">
<div class="flex items-center gap-3">
<h2 class="font-medium text-xl truncate <%= "animate-pulse" if account.syncing? %>"><%= title %></h2>
<% if account.tax_treatment.present? %>
<%= render partial: "accounts/tax_treatment_badge", locals: { account: account } %>
<% end %>
<% if account.draft? %>
<%= render DS::Link.new(
text: "Complete setup",