mirror of
https://github.com/we-promise/sure.git
synced 2026-07-21 01:05:28 +00:00
- Add WiseItem/WiseAccount models with full sync pipeline (importer, syncer, processor) - Detect income vs expense using targetAccount == recipientId from borderless accounts API - Support JAR (SAVINGS) accounts with totalWorth balance and savings subtype - Fetch JAR activity via profile activities API (INTERBALANCE, BALANCE_CASHBACK, BALANCE_ASSET_FEE) - Route INTERBALANCE activities to both JAR and STANDARD accounts and link as Transfer records - Add provider connection status registration, routes, views, and i18n - Add migration for wise_items and wise_accounts tables - Add tests for WiseAccount, WiseEntry::Processor, WiseActivity::Processor, WiseItem::Importer, and WiseItem#link_jar_transfers!
51 lines
2.2 KiB
Plaintext
51 lines
2.2 KiB
Plaintext
<% content_for :title, t(".title") %>
|
|
|
|
<%= render DS::Dialog.new do |dialog| %>
|
|
<% dialog.with_header(title: t(".title")) do %>
|
|
<div class="flex items-center gap-2">
|
|
<%= icon "wallet", class: "text-primary" %>
|
|
<span class="text-primary"><%= t(".subtitle") %></span>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% dialog.with_body do %>
|
|
<div class="space-y-6">
|
|
<% if @wise_accounts.empty? %>
|
|
<div class="p-8 flex flex-col gap-3 items-center justify-center text-center">
|
|
<%= icon "check-circle", size: "lg", class: "text-success" %>
|
|
<p class="text-primary font-medium"><%= t(".no_accounts_to_setup") %></p>
|
|
<p class="text-secondary text-sm"><%= t(".all_accounts_linked") %></p>
|
|
</div>
|
|
<%= render DS::Link.new(text: t(".done"), variant: "primary", href: accounts_path) %>
|
|
<% else %>
|
|
<p class="text-sm text-secondary"><%= t(".description") %></p>
|
|
|
|
<div class="space-y-3">
|
|
<% @wise_accounts.each do |wise_account| %>
|
|
<div class="border border-primary rounded-lg p-4 flex items-center justify-between gap-4">
|
|
<div>
|
|
<p class="font-medium text-primary text-sm"><%= wise_account.name %></p>
|
|
<p class="text-xs text-secondary mt-0.5">
|
|
<%= format_money(Money.new(wise_account.current_balance || 0, wise_account.currency)) %>
|
|
·
|
|
<%= wise_account.currency %>
|
|
</p>
|
|
</div>
|
|
<%= button_to complete_account_setup_wise_item_path(@wise_item),
|
|
method: :post,
|
|
params: { wise_account_id: wise_account.id },
|
|
class: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium text-primary border border-primary rounded-lg hover:bg-subtle",
|
|
data: { turbo_frame: "_top" } do %>
|
|
<%= icon "plus", size: "sm" %>
|
|
<%= t(".create_account") %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= render DS::Link.new(text: t(".done"), variant: "secondary", href: accounts_path) %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|