insert net_profit into the table

i really don't know why I forgot this lol
This commit is contained in:
c9s 2024-11-15 16:57:00 +08:00
parent f2ae512e3f
commit 56fdf0a21f
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 4 additions and 1 deletions

View File

@ -67,6 +67,7 @@ func (s *PositionService) Insert(
base, base,
quote, quote,
profit, profit,
net_profit,
trade_id, trade_id,
exchange, exchange,
side, side,
@ -81,6 +82,7 @@ func (s *PositionService) Insert(
:base, :base,
:quote, :quote,
:profit, :profit,
:net_profit,
:trade_id, :trade_id,
:exchange, :exchange,
:side, :side,
@ -96,6 +98,7 @@ func (s *PositionService) Insert(
"base": position.Base, "base": position.Base,
"quote": position.Quote, "quote": position.Quote,
"profit": profit, "profit": profit,
"net_profit": netProfit,
"trade_id": trade.ID, "trade_id": trade.ID,
"exchange": trade.Exchange, "exchange": trade.Exchange,
"side": trade.Side, "side": trade.Side,

View File

@ -54,7 +54,7 @@ func TestPositionService(t *testing.T) {
Exchange: types.ExchangeBinance, Exchange: types.ExchangeBinance,
Side: types.SideTypeSell, Side: types.SideTypeSell,
Time: types.Time(time.Now()), Time: types.Time(time.Now()),
}, fixedpoint.NewFromFloat(10.9), fixedpoint.Zero) }, fixedpoint.NewFromFloat(10.9), fixedpoint.NewFromFloat(8.1))
assert.NoError(t, err) assert.NoError(t, err)
}) })