package models

import (
	"github.com/shopspring/decimal"
	"time"

	"go-admin/common/models"
)

type VtsRecharge struct {
	models.Model

	CoinCode        string          `json:"coinCode" gorm:"type:varchar(20);comment:币种"`
	TranType        int             `json:"tranType" gorm:"type:int;comment:类型：1-线上 2-内部"`
	OrderNo         string          `json:"orderNo" gorm:"type:varchar(255);comment:订单号"`
	AdUserId        int             `json:"adUserId" gorm:"type:bigint;comment:用户id"`
	Amount          decimal.Decimal `json:"amount" gorm:"type:decimal(32,8);comment:订单价格"`
	PriceCurrency   string          `json:"priceCurrency" gorm:"type:varchar(20);comment:CoinGate结算货币代码"`
	ReceiveAmount   decimal.Decimal `json:"receiveAmount" gorm:"type:decimal(32,8);comment:实收数量"`
	PayAmount       decimal.Decimal `json:"payAmount" gorm:"type:decimal(32,8);comment:实际支付数量"`
	PayCurrency     string          `json:"payCurrency" gorm:"type:varchar(255);comment:实际支付的加密货币"`
	UnderpaidAmount decimal.Decimal `json:"underpaidAmount" gorm:"type:decimal(32,8);comment:买家少付数量"`
	OverpaidAmount  decimal.Decimal `json:"overpaidAmount" gorm:"type:decimal(32,8);comment:买家多付数量"`
	IsRefundable    int             `json:"isRefundable" gorm:"type:tinyint;comment:指示购物者是否可以请求发票退款"`
	WalletCreateAt  time.Time       `json:"walletCreateAt" gorm:"type:datetime;comment:第三方创建时间"`
	WalletId        int             `json:"walletId" gorm:"type:int;comment:第三方钱包订单"`
	Fee             decimal.Decimal `json:"fee" gorm:"type:decimal(32,8);comment:手续费"`
	CallbackAt      time.Time       `json:"callbackAt" gorm:"type:datetime;comment:回调时间"`
	Status          string          `json:"status" gorm:"type:varchar(20);comment:状态(字典 vts_recharge_status)"`
	ConfirmStatus   string          `json:"confirmStatus" gorm:"type:varchar(20);comment:确认状态(字典 vts_confirm_status)"`
	Remark          string          `json:"remark" gorm:"type:varchar(500);comment:备注"`
	models.ModelTime
	models.ControlBy
}

func (VtsRecharge) TableName() string {
	return "vts_recharge"
}

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

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