Files
platforms/backend/api/internal/models/gasorder_contract_revision.go
2026-07-29 13:18:52 +08:00

25 lines
1.8 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 int `gorm:"column:contract_status;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" }