Add transaction fee support to trades (#1248)

Add an optional fee field (decimal, precision: 19, scale: 4) to trades.
Fee is included in the total amount calculation (qty * price + fee) for
both create and update flows. The fee field appears on both the create
and edit forms, defaults to 0, and auto-submits like other trade fields.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Serge L
2026-03-28 14:03:16 -04:00
committed by GitHub
parent 005d2fac20
commit cc7d675500
10 changed files with 123 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
class AddFeeToTrades < ActiveRecord::Migration[7.2]
def change
add_column :trades, :fee, :decimal, precision: 19, scale: 4, default: 0, null: false
end
end