33 lines
823 B
Go
33 lines
823 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// OutboundDetail 出库明细
|
|
type OutboundDetail struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (OutboundDetail) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("outbound_no").Comment("出库单号"),
|
|
field.String("sn_code").Optional().Comment("SN(精密件)"),
|
|
field.String("batch_no").Optional().Comment("批次号(结构件)"),
|
|
field.String("material_code").Comment("物料编码"),
|
|
field.Int("quantity").Default(1).Comment("数量"),
|
|
field.String("order_no").Optional().Comment("关联工单号"),
|
|
field.Int64("created_at").DefaultFunc(nowUnix),
|
|
}
|
|
}
|
|
|
|
func (OutboundDetail) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("outbound_no"),
|
|
index.Fields("sn_code"),
|
|
index.Fields("order_no"),
|
|
}
|
|
}
|