27 lines
2.2 KiB
Go
27 lines
2.2 KiB
Go
|
|
package models
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"time"
|
|||
|
|
|
|||
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// GasorderContract 对应 gasorder_contract,保存用户与气站唯一供气合同。
|
|||
|
|
type GasorderContract struct {
|
|||
|
|
Entity // 公共实体字段
|
|||
|
|
ContractNo string `gorm:"column:contract_no;type:varchar(64);not null;uniqueIndex" json:"contract_no"` // 合同编号
|
|||
|
|
UserAccountID uint64 `gorm:"column:user_account_id;not null;uniqueIndex:idx_gasorder_contract_party" json:"user_account_id"` // 签约用户自增主键
|
|||
|
|
GasBasicID uint64 `gorm:"column:gas_basic_id;not null;uniqueIndex:idx_gasorder_contract_party" json:"gas_basic_id"` // 签约气站自增主键
|
|||
|
|
DeliveryBasicID uint64 `gorm:"column:delivery_basic_id;not null;default:0;index" json:"delivery_basic_id"` // 默认配送点自增主键
|
|||
|
|
Title string `gorm:"column:title;type:varchar(255);not null" json:"title"` // 合同标题
|
|||
|
|
Terms string `gorm:"column:terms;type:text;not null;default:''" json:"terms"` // 合同条款
|
|||
|
|
FileURI string `gorm:"column:file_uri;type:varchar(512);not null;default:''" json:"file_uri"` // 合同文件地址
|
|||
|
|
DefaultDeliveryFee int64 `gorm:"column:default_delivery_fee;not null;default:0;check:default_delivery_fee >= 0" json:"default_delivery_fee"` // 默认配送费,单位分
|
|||
|
|
SignedAt time.Time `gorm:"column:signed_at;type:timestamptz;not null" json:"signed_at"` // 签订时间
|
|||
|
|
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"` // 到期时间
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() { database.AppendMigrate(&GasorderContract{}) }
|
|||
|
|
func (table *GasorderContract) TableName() string { return "gasorder_contract" }
|