27 lines
2.1 KiB
Go
27 lines
2.1 KiB
Go
|
|
package models
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"time"
|
|||
|
|
|
|||
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// ProductOwner 对应 product_owner,保存产品库房与责任归属的不可变快照。
|
|||
|
|
type ProductOwner struct {
|
|||
|
|
Entity // 公共实体字段
|
|||
|
|
ProductInfoID uint64 `gorm:"column:product_info_id;not null;index" json:"product_info_id"` // 产品档案自增主键
|
|||
|
|
WarehouseID uint64 `gorm:"column:warehouse_id;not null;default:0;index" json:"warehouse_id"` // 当前实际库房自增主键快照
|
|||
|
|
GasBasicID uint64 `gorm:"column:gas_basic_id;not null;default:0;index" json:"gas_basic_id"` // 当前归属气站自增主键快照
|
|||
|
|
DeliveryBasicID uint64 `gorm:"column:delivery_basic_id;not null;default:0;index" json:"delivery_basic_id"` // 当前归属配送站自增主键快照
|
|||
|
|
UserAccountID uint64 `gorm:"column:user_account_id;not null;default:0;index" json:"user_account_id"` // 当前归属用户自增主键快照
|
|||
|
|
Action string `gorm:"column:action;type:varchar(32);not null" json:"action"` // 归属变更动作
|
|||
|
|
OccurredAt time.Time `gorm:"column:occurred_at;type:timestamptz;not null;index" json:"occurred_at"` // 实际发生时间
|
|||
|
|
Reason string `gorm:"column:reason;type:text;not null;default:''" json:"reason"` // 变更原因
|
|||
|
|
Remark string `gorm:"column:remark;type:text;not null;default:''" json:"remark"` // 备注
|
|||
|
|
OperatorIdentity string `gorm:"column:operator_identity;type:varchar(36);not null;default:'';index" json:"operator_identity"` // 操作者业务标识
|
|||
|
|
OperatorName string `gorm:"column:operator_name;type:varchar(64);not null;default:''" json:"operator_name"` // 操作者姓名快照
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() { database.AppendMigrate(&ProductOwner{}) }
|
|||
|
|
func (table *ProductOwner) TableName() string { return "product_owner" }
|