package model import "time" type FinanceRecord struct { Base ShopID uint64 `gorm:"not null;index" json:"shop_id"` PartnerID *uint64 `json:"partner_id"` Type string `gorm:"type:enum('receivable','payable','receipt','payment')" json:"type"` Amount float64 `gorm:"type:decimal(16,2)" json:"amount"` Balance float64 `gorm:"type:decimal(16,2)" json:"balance"` Status string `gorm:"size:10;default:open" json:"status"` RefType string `gorm:"size:30" json:"ref_type"` RefID *uint64 `json:"ref_id"` OperatorID uint64 `gorm:"not null" json:"operator_id"` RecordDate time.Time `gorm:"type:date" json:"record_date"` CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"` Remark string `gorm:"size:500" json:"remark"` Partner *Partner `gorm:"foreignKey:PartnerID" json:"partner,omitempty"` } type NumberRule struct { ID uint64 `gorm:"primaryKey;autoIncrement" json:"id"` ShopID uint64 `gorm:"not null;uniqueIndex:uk_shop_type" json:"shop_id"` Type string `gorm:"size:30;uniqueIndex:uk_shop_type" json:"type"` Prefix string `gorm:"size:20;default:''" json:"prefix"` CurrentNo int `gorm:"default:0" json:"current_no"` DateFormat string `gorm:"size:20;default:'YYYYMMDD'" json:"date_format"` UpdatedAt time.Time `json:"updated_at"` }