package models

import (
	"go-admin/common/models"

	"github.com/shopspring/decimal"
)

type LineReduceStrategyItem struct {
	models.Model

	ReduceStrategyId int                `json:"reduceStrategyId" gorm:"type:bigint;comment:减仓策略id"`
	LossPercent      decimal.Decimal    `json:"lossPercent" gorm:"type:decimal(10,2);comment:亏损百分比"`
	QuantityPercent  decimal.Decimal    `json:"quantityPercent" gorm:"type:decimal(10,2);comment:减仓数量百分比"`
	OrderType        string             `json:"orderType" gorm:"type:varchar(20);comment:订单类型 LIMIT-限价 MARKET-市价"`
	ReduceStrategy   LineReduceStrategy `json:"reduceStrategy" gorm:"foreignKey:ReduceStrategyId;"`
	models.ModelTime
	models.ControlBy
}

func (LineReduceStrategyItem) TableName() string {
	return "line_reduce_strategy_item"
}

func (e *LineReduceStrategyItem) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *LineReduceStrategyItem) GetId() interface{} {
	return e.Id
}
