Files
2021-12-28 17:14:02 +08:00

42 lines
1.4 KiB
Go

package model
// BillInstance 账单信息数据模型
type BillInstance struct {
Model
BillInstanceBasic
ModelDeleted
ModelAt
}
// BillInstanceBasic 账单基本信息
type BillInstanceBasic struct {
OrderNo string `gorm:"column:order_no;type:varchar(30);default:'';comment:订单号" json:"order_no"`
Kind string `gorm:"column:kind;type:varchar(20);default:'';comment:账单类型" json:"kind"`
Amount float64 `gorm:"column:amount;type:decimal(10,2);default:0;comment:账单金额" json:"amount"`
Number float64 `gorm:"column:number;type:decimal(10,2);default:0;comment:账单数量" json:"number"`
Status BillInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:账单状态" json:"status"`
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:账单备注" json:"remark"`
}
// BillInstanceStatus 账单状态
type BillInstanceStatus int
const (
// BillInstanceStatusForInit 初始化
BillInstanceStatusForInit BillInstanceStatus = iota
// BillInstanceStatusForApply 申请中
BillInstanceStatusForApply
// BillInstanceStatusForProcessing 处理中
BillInstanceStatusForProcessing
// BillInstanceStatusForProcessed 已处理
BillInstanceStatusForProcessed
)
func (m *BillInstance) TableName() string {
return "bill_instance"
}
func NewBillInstance() *BillInstance {
return &BillInstance{}
}