Files
jiu/backend/internal/model/partner.go
T

21 lines
1.1 KiB
Go

package model
type Partner struct {
TenantBase
Code string `gorm:"size:50" json:"code"`
Name string `gorm:"size:200;not null" json:"name" binding:"required"`
// 拼音搜索列(同 products):Create/Update 时由 util.ToPinyin 生成,启动回填存量
NamePinyin string `gorm:"size:400;index" json:"-"`
NameInitials string `gorm:"size:100;index" json:"-"`
Type string `gorm:"type:set('supplier','customer');default:'supplier'" json:"type"`
Contact string `gorm:"size:50" json:"contact"`
Phone string `gorm:"size:30" json:"phone"`
Address string `gorm:"size:255" json:"address"`
BankAccount string `gorm:"size:100" json:"bank_account"`
CreditLimit float64 `gorm:"type:decimal(12,2)" json:"credit_limit"`
Balance float64 `gorm:"type:decimal(12,2);default:0" json:"balance"`
Status string `gorm:"type:enum('enabled','disabled');not null;default:'enabled'" json:"status"`
CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"`
Remark string `gorm:"size:500" json:"remark"`
}