2026-08-28 15:06:01 +08:00
|
|
|
package schema
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"entgo.io/ent"
|
|
|
|
|
"entgo.io/ent/schema/field"
|
|
|
|
|
)
|
|
|
|
|
|
2026-09-02 08:21:11 +08:00
|
|
|
// Zone 库房区域(大分区)
|
|
|
|
|
// 仅作为"大分区"维度(如 待检区/标准存储区/暂存区/退货区),编码 Z01~Z04。
|
|
|
|
|
// 业务决策:小货架高频取货场景无需"货架-层-格"精确货位,系统管到区域即可,
|
|
|
|
|
// 货架内部由仓管经验定位,不给现场增加录入负担。库存(inventory)只关联 zone_code。
|
2026-08-28 15:06:01 +08:00
|
|
|
type Zone struct {
|
|
|
|
|
ent.Schema
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Zone) Fields() []ent.Field {
|
|
|
|
|
return []ent.Field{
|
|
|
|
|
field.String("zone_code").Unique().Comment("区域编码"),
|
|
|
|
|
field.String("zone_name").Comment("区域名称"),
|
|
|
|
|
field.String("description").Optional().Comment("描述"),
|
2026-09-01 13:49:44 +08:00
|
|
|
field.String("status").Default("启用").Comment("状态:启用/停用"),
|
2026-08-28 15:06:01 +08:00
|
|
|
field.Int64("created_at").DefaultFunc(nowUnix),
|
2026-09-01 13:49:44 +08:00
|
|
|
field.Int64("updated_at").DefaultFunc(nowUnix).Optional().Comment("更新时间"),
|
2026-08-28 15:06:01 +08:00
|
|
|
}
|
|
|
|
|
}
|