refactor platform logic and add gasorder domain
This commit is contained in:
24
backend/api/internal/models/gasorder_contract_revision.go
Normal file
24
backend/api/internal/models/gasorder_contract_revision.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
)
|
||||
|
||||
// GasorderContractRevision 对应 gasorder_contract_revision,保存唯一合同的不可变变更快照。
|
||||
type GasorderContractRevision struct {
|
||||
Entity // 公共实体字段
|
||||
GasorderContractID uint64 `gorm:"column:gasorder_contract_id;not null;index" json:"gasorder_contract_id"` // 合同自增主键
|
||||
Action string `gorm:"column:action;type:varchar(32);not null;index" json:"action"` // 合同变更动作
|
||||
ContractStatus string `gorm:"column:contract_status;type:varchar(32);not null" json:"contract_status"` // 合同状态快照
|
||||
EffectiveAt time.Time `gorm:"column:effective_at;type:timestamptz;not null" json:"effective_at"` // 生效时间快照
|
||||
ExpiredAt *time.Time `gorm:"column:expired_at;type:timestamptz" json:"expired_at"` // 到期时间快照
|
||||
OperatorIdentity string `gorm:"column:operator_identity;type:varchar(36);not null;default:''" json:"operator_identity"` // 操作人标识
|
||||
OperatorName string `gorm:"column:operator_name;type:varchar(64);not null;default:''" json:"operator_name"` // 操作人姓名快照
|
||||
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"` // 变更原因
|
||||
}
|
||||
|
||||
func init() { database.AppendMigrate(&GasorderContractRevision{}) }
|
||||
func (table *GasorderContractRevision) TableName() string { return "gasorder_contract_revision" }
|
||||
Reference in New Issue
Block a user