18 lines
1.2 KiB
Go
18 lines
1.2 KiB
Go
// 功能描述:保存供气订单创建时锁定的押金规则快照;版本:1.0.0。
|
||
package models
|
||
|
||
import "git.apinb.com/bsm-sdk/core/database"
|
||
|
||
// GasorderDeposit 在订单支付后转换为正式押金事实,防止计费规则在支付期间变化。
|
||
type GasorderDeposit struct {
|
||
Entity
|
||
DepositStatus int `gorm:"column:deposit_status;not null;default:10;index;comment:订单押金状态:10=待支付,22=已取消,23=已转正式押金" json:"deposit_status"`
|
||
GasorderBasicID uint64 `gorm:"column:gasorder_basic_id;not null;index;uniqueIndex:idx_gasorder_deposit_product;comment:供气订单内部主键" json:"gasorder_basic_id"`
|
||
ProductInfoID uint64 `gorm:"column:product_info_id;not null;index;uniqueIndex:idx_gasorder_deposit_product;comment:实体气瓶内部主键" json:"product_info_id"`
|
||
PolicyID uint64 `gorm:"column:policy_id;not null;index;comment:下单时采用的押金规则内部主键" json:"policy_id"`
|
||
Amount int64 `gorm:"column:amount;not null;check:amount >= 0;comment:下单时锁定的押金金额,单位分" json:"amount"`
|
||
}
|
||
|
||
func init() { database.AppendMigrate(&GasorderDeposit{}) }
|
||
func (table *GasorderDeposit) TableName() string { return "gasorder_deposit" }
|