Files
sure/app/views/api/v1/transfers/_transfer.json.jbuilder
DataEnginr e75f2a0c78 Fix fee display consistency, derive fees from entries, clean schema churn
- Show principal-only transfer amounts on both sides with separate fee and total lines (fixes inconsistent gross/net convention)
- Derive displayed fee amounts from fee_transactions entries (single source of truth) instead of stored columns
- Remove stored source_fee_amount/destination_fee_amount columns from transfers table
- Add foreign key for transactions.transfer_id -> transfers.id (replaces invalid CHECK subquery)
- Move destination fee line inside destination side div for consistent layout
- Remove orphaned view_fee_transaction locale keys from 7 locale files
- Rebuild schema.rb from origin/main to eliminate unrelated column reordering churn
2026-06-28 19:47:53 +00:00

26 lines
933 B
Ruby

# frozen_string_literal: true
json.id transfer.id
json.status transfer.status
json.date transfer.date
json.amount transfer.amount_abs.format
json.amount_cents money_to_minor_units(transfer.amount_abs)
json.currency transfer.inflow_transaction.entry.currency
json.transfer_type transfer.transfer_type
json.notes transfer.notes
json.source_fee_amount transfer.derived_source_fee_amount.to_s("F")
json.source_fee_currency transfer.from_account&.currency
json.destination_fee_amount transfer.derived_destination_fee_amount.to_s("F")
json.destination_fee_currency transfer.to_account&.currency
json.inflow_transaction do
json.partial! "api/v1/transfers/transaction_side", transaction: transfer.inflow_transaction
end
json.outflow_transaction do
json.partial! "api/v1/transfers/transaction_side", transaction: transfer.outflow_transaction
end
json.created_at transfer.created_at.iso8601
json.updated_at transfer.updated_at.iso8601