package models

import (
	"time"

	"go-admin/common/models"

	"github.com/shopspring/decimal"
)

type MemberRenwaLog struct {
	models.Model

	NetworkName         string          `json:"networkName" gorm:"type:varchar(255);comment:网络名称"`
	ReceiveAddress      string          `json:"receiveAddress" gorm:"type:varchar(255);comment:接收地址"`
	RenwalId            int             `json:"renwalId" gorm:"type:bigint;comment:套餐id"`
	UserId              int             `json:"userId" gorm:"type:bigint;comment:用户id"`
	RenwalName          string          `json:"renwalName" gorm:"type:varchar(255);comment:续期套餐名称"`
	RenwalDuration      int             `json:"renwalDuration" gorm:"type:int;comment:续期时长(天数)"`
	Status              string          `json:"status" gorm:"type:varchar(255);comment:订单状态(member_renwal_log_status)"`
	PayableAmount       decimal.Decimal `json:"payableAmount" gorm:"type:decimal(18,6);comment:应付金额"`
	ActualPaymentAmount decimal.Decimal `json:"actualPaymentAmount" gorm:"type:decimal(18,6);comment:实付金额"`
	FromAddress         string          `json:"fromAddress" gorm:"type:varchar(255);comment:付款地址"`
	Coin                string          `json:"coin" gorm:"type:varchar(255);comment:代币"`
	PaymentTime         *time.Time      `json:"paymentTime" gorm:"type:datetime;comment:支付时间"`
	Hash                string          `json:"hash" gorm:"type:varchar(255);comment:交易hash"`
	ExpirationTime      time.Time       `json:"expirationTime" gorm:"type:datetime;comment:到期时间"`
	NickName            string          `json:"nickName" gorm:"-"`
	models.ModelTime
	models.ControlBy
}

func (MemberRenwaLog) TableName() string {
	return "member_renwa_log"
}

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

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