2026-08-28 15:06:01 +08:00
|
|
|
package schema
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"entgo.io/ent"
|
|
|
|
|
"entgo.io/ent/schema/field"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Zone 库房区域
|
|
|
|
|
// 待检/合格/不合格/退货区 等
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|