package models

import (
	"go-admin/common/models"

	"github.com/shopspring/decimal"
)

type MemberBalanceLog struct {
	models.Model

	UserId        int             `json:"userId" gorm:"type:bigint;comment:用户id"`
	ChangeSource  string          `json:"changeSource" gorm:"type:varchar(50);comment:变更来源 (member_change_source)"`
	ChangeType    int             `json:"changeType" gorm:"type:tinyint;comment:变更类别 1-收入 2-支出"`
	Amount        decimal.Decimal `json:"amount" gorm:"type:decimal(18,6);comment:变更金额"`
	BalanceBefore decimal.Decimal `json:"balanceBefore" gorm:"type:decimal(18,6);comment:变更前余额"`
	BalanceAfter  decimal.Decimal `json:"balanceAfter" gorm:"type:decimal(18,6);comment:变更后余额"`
	Remark        string          `json:"remark" gorm:"type:varchar(255);comment:备注"`
	models.ModelTime
	models.ControlBy
}

func (MemberBalanceLog) TableName() string {
	return "member_balance_log"
}

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

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