mirror of
https://github.com/we-promise/sure.git
synced 2026-07-16 06:45:21 +00:00
- 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
26 lines
933 B
Ruby
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
|