Files
wangjia ca7595b113 feat(backend): 出入库汇总近30天滚动窗口 + 跨租户安全加固
- summaryBounds:本月/近30天滚动双口径(stock-in/out Summary ?window=rolling30)
- security(SEC-001):新增 ownership.go ensureShopRef 写入侧防线(stock-in/out/finance/
  盘点建单的 warehouse/partner/product 外键归属校验);读取侧全部 Preload 补
  shop_id 作用域,finance Summary JOIN 补租户条件;回归测试 CrossTenantRefs
- security(SEC-002):release 模式 JWT 密钥为空/默认值时拒绝启动
- gofmt 对齐若干 model/cmd 文件

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:57:52 +08:00

21 lines
1.0 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"`
}