feat: 新增 AgvPoint 点位表及客户端,支持点位编码与接驳台绑定
This commit is contained in:
@@ -609,6 +609,10 @@ var (
|
||||
{Name: "borrow_from", Type: field.TypeJSON, Nullable: true, Comment: "跨工位借料来源 stationNo→借用量(call 备料出库专用);空=本工位自取"},
|
||||
{Name: "inspection_no", Type: field.TypeString, Nullable: true, Comment: "检测单号(溯源关联检验单据)"},
|
||||
{Name: "product_work_no", Type: field.TypeString, Nullable: true, Comment: "产品工号(随库存带入,出库记录展示/筛选)"},
|
||||
{Name: "voided", Type: field.TypeBool, Comment: "是否已作废", Default: false},
|
||||
{Name: "void_reason", Type: field.TypeString, Comment: "作废原因(必填留痕)", Default: ""},
|
||||
{Name: "voided_by", Type: field.TypeString, Comment: "作废操作人", Default: ""},
|
||||
{Name: "voided_at", Type: field.TypeInt64, Nullable: true, Comment: "作废时间戳"},
|
||||
{Name: "created_at", Type: field.TypeInt64, Comment: "创建时间"},
|
||||
}
|
||||
// OutboundOrdersTable holds the schema information for the "outbound_orders" table.
|
||||
|
||||
@@ -17587,6 +17587,11 @@ type OutboundOrderMutation struct {
|
||||
borrowFrom *map[string]int
|
||||
inspection_no *string
|
||||
product_work_no *string
|
||||
voided *bool
|
||||
void_reason *string
|
||||
voided_by *string
|
||||
voided_at *int64
|
||||
addvoided_at *int64
|
||||
created_at *int64
|
||||
addcreated_at *int64
|
||||
clearedFields map[string]struct{}
|
||||
@@ -19070,6 +19075,184 @@ func (m *OutboundOrderMutation) ResetProductWorkNo() {
|
||||
delete(m.clearedFields, outboundorder.FieldProductWorkNo)
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (m *OutboundOrderMutation) SetVoided(b bool) {
|
||||
m.voided = &b
|
||||
}
|
||||
|
||||
// Voided returns the value of the "voided" field in the mutation.
|
||||
func (m *OutboundOrderMutation) Voided() (r bool, exists bool) {
|
||||
v := m.voided
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldVoided returns the old "voided" field's value of the OutboundOrder entity.
|
||||
// If the OutboundOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *OutboundOrderMutation) OldVoided(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldVoided is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldVoided requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldVoided: %w", err)
|
||||
}
|
||||
return oldValue.Voided, nil
|
||||
}
|
||||
|
||||
// ResetVoided resets all changes to the "voided" field.
|
||||
func (m *OutboundOrderMutation) ResetVoided() {
|
||||
m.voided = nil
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (m *OutboundOrderMutation) SetVoidReason(s string) {
|
||||
m.void_reason = &s
|
||||
}
|
||||
|
||||
// VoidReason returns the value of the "void_reason" field in the mutation.
|
||||
func (m *OutboundOrderMutation) VoidReason() (r string, exists bool) {
|
||||
v := m.void_reason
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldVoidReason returns the old "void_reason" field's value of the OutboundOrder entity.
|
||||
// If the OutboundOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *OutboundOrderMutation) OldVoidReason(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldVoidReason is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldVoidReason requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldVoidReason: %w", err)
|
||||
}
|
||||
return oldValue.VoidReason, nil
|
||||
}
|
||||
|
||||
// ResetVoidReason resets all changes to the "void_reason" field.
|
||||
func (m *OutboundOrderMutation) ResetVoidReason() {
|
||||
m.void_reason = nil
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (m *OutboundOrderMutation) SetVoidedBy(s string) {
|
||||
m.voided_by = &s
|
||||
}
|
||||
|
||||
// VoidedBy returns the value of the "voided_by" field in the mutation.
|
||||
func (m *OutboundOrderMutation) VoidedBy() (r string, exists bool) {
|
||||
v := m.voided_by
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldVoidedBy returns the old "voided_by" field's value of the OutboundOrder entity.
|
||||
// If the OutboundOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *OutboundOrderMutation) OldVoidedBy(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldVoidedBy is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldVoidedBy requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldVoidedBy: %w", err)
|
||||
}
|
||||
return oldValue.VoidedBy, nil
|
||||
}
|
||||
|
||||
// ResetVoidedBy resets all changes to the "voided_by" field.
|
||||
func (m *OutboundOrderMutation) ResetVoidedBy() {
|
||||
m.voided_by = nil
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (m *OutboundOrderMutation) SetVoidedAt(i int64) {
|
||||
m.voided_at = &i
|
||||
m.addvoided_at = nil
|
||||
}
|
||||
|
||||
// VoidedAt returns the value of the "voided_at" field in the mutation.
|
||||
func (m *OutboundOrderMutation) VoidedAt() (r int64, exists bool) {
|
||||
v := m.voided_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldVoidedAt returns the old "voided_at" field's value of the OutboundOrder entity.
|
||||
// If the OutboundOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *OutboundOrderMutation) OldVoidedAt(ctx context.Context) (v *int64, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldVoidedAt is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldVoidedAt requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldVoidedAt: %w", err)
|
||||
}
|
||||
return oldValue.VoidedAt, nil
|
||||
}
|
||||
|
||||
// AddVoidedAt adds i to the "voided_at" field.
|
||||
func (m *OutboundOrderMutation) AddVoidedAt(i int64) {
|
||||
if m.addvoided_at != nil {
|
||||
*m.addvoided_at += i
|
||||
} else {
|
||||
m.addvoided_at = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedVoidedAt returns the value that was added to the "voided_at" field in this mutation.
|
||||
func (m *OutboundOrderMutation) AddedVoidedAt() (r int64, exists bool) {
|
||||
v := m.addvoided_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (m *OutboundOrderMutation) ClearVoidedAt() {
|
||||
m.voided_at = nil
|
||||
m.addvoided_at = nil
|
||||
m.clearedFields[outboundorder.FieldVoidedAt] = struct{}{}
|
||||
}
|
||||
|
||||
// VoidedAtCleared returns if the "voided_at" field was cleared in this mutation.
|
||||
func (m *OutboundOrderMutation) VoidedAtCleared() bool {
|
||||
_, ok := m.clearedFields[outboundorder.FieldVoidedAt]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetVoidedAt resets all changes to the "voided_at" field.
|
||||
func (m *OutboundOrderMutation) ResetVoidedAt() {
|
||||
m.voided_at = nil
|
||||
m.addvoided_at = nil
|
||||
delete(m.clearedFields, outboundorder.FieldVoidedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (m *OutboundOrderMutation) SetCreatedAt(i int64) {
|
||||
m.created_at = &i
|
||||
@@ -19160,7 +19343,7 @@ func (m *OutboundOrderMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *OutboundOrderMutation) Fields() []string {
|
||||
fields := make([]string, 0, 30)
|
||||
fields := make([]string, 0, 34)
|
||||
if m.outbound_no != nil {
|
||||
fields = append(fields, outboundorder.FieldOutboundNo)
|
||||
}
|
||||
@@ -19248,6 +19431,18 @@ func (m *OutboundOrderMutation) Fields() []string {
|
||||
if m.product_work_no != nil {
|
||||
fields = append(fields, outboundorder.FieldProductWorkNo)
|
||||
}
|
||||
if m.voided != nil {
|
||||
fields = append(fields, outboundorder.FieldVoided)
|
||||
}
|
||||
if m.void_reason != nil {
|
||||
fields = append(fields, outboundorder.FieldVoidReason)
|
||||
}
|
||||
if m.voided_by != nil {
|
||||
fields = append(fields, outboundorder.FieldVoidedBy)
|
||||
}
|
||||
if m.voided_at != nil {
|
||||
fields = append(fields, outboundorder.FieldVoidedAt)
|
||||
}
|
||||
if m.created_at != nil {
|
||||
fields = append(fields, outboundorder.FieldCreatedAt)
|
||||
}
|
||||
@@ -19317,6 +19512,14 @@ func (m *OutboundOrderMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.InspectionNo()
|
||||
case outboundorder.FieldProductWorkNo:
|
||||
return m.ProductWorkNo()
|
||||
case outboundorder.FieldVoided:
|
||||
return m.Voided()
|
||||
case outboundorder.FieldVoidReason:
|
||||
return m.VoidReason()
|
||||
case outboundorder.FieldVoidedBy:
|
||||
return m.VoidedBy()
|
||||
case outboundorder.FieldVoidedAt:
|
||||
return m.VoidedAt()
|
||||
case outboundorder.FieldCreatedAt:
|
||||
return m.CreatedAt()
|
||||
}
|
||||
@@ -19386,6 +19589,14 @@ func (m *OutboundOrderMutation) OldField(ctx context.Context, name string) (ent.
|
||||
return m.OldInspectionNo(ctx)
|
||||
case outboundorder.FieldProductWorkNo:
|
||||
return m.OldProductWorkNo(ctx)
|
||||
case outboundorder.FieldVoided:
|
||||
return m.OldVoided(ctx)
|
||||
case outboundorder.FieldVoidReason:
|
||||
return m.OldVoidReason(ctx)
|
||||
case outboundorder.FieldVoidedBy:
|
||||
return m.OldVoidedBy(ctx)
|
||||
case outboundorder.FieldVoidedAt:
|
||||
return m.OldVoidedAt(ctx)
|
||||
case outboundorder.FieldCreatedAt:
|
||||
return m.OldCreatedAt(ctx)
|
||||
}
|
||||
@@ -19600,6 +19811,34 @@ func (m *OutboundOrderMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetProductWorkNo(v)
|
||||
return nil
|
||||
case outboundorder.FieldVoided:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetVoided(v)
|
||||
return nil
|
||||
case outboundorder.FieldVoidReason:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetVoidReason(v)
|
||||
return nil
|
||||
case outboundorder.FieldVoidedBy:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetVoidedBy(v)
|
||||
return nil
|
||||
case outboundorder.FieldVoidedAt:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetVoidedAt(v)
|
||||
return nil
|
||||
case outboundorder.FieldCreatedAt:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
@@ -19624,6 +19863,9 @@ func (m *OutboundOrderMutation) AddedFields() []string {
|
||||
if m.addquantity != nil {
|
||||
fields = append(fields, outboundorder.FieldQuantity)
|
||||
}
|
||||
if m.addvoided_at != nil {
|
||||
fields = append(fields, outboundorder.FieldVoidedAt)
|
||||
}
|
||||
if m.addcreated_at != nil {
|
||||
fields = append(fields, outboundorder.FieldCreatedAt)
|
||||
}
|
||||
@@ -19641,6 +19883,8 @@ func (m *OutboundOrderMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return m.AddedSnMode()
|
||||
case outboundorder.FieldQuantity:
|
||||
return m.AddedQuantity()
|
||||
case outboundorder.FieldVoidedAt:
|
||||
return m.AddedVoidedAt()
|
||||
case outboundorder.FieldCreatedAt:
|
||||
return m.AddedCreatedAt()
|
||||
}
|
||||
@@ -19673,6 +19917,13 @@ func (m *OutboundOrderMutation) AddField(name string, value ent.Value) error {
|
||||
}
|
||||
m.AddQuantity(v)
|
||||
return nil
|
||||
case outboundorder.FieldVoidedAt:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddVoidedAt(v)
|
||||
return nil
|
||||
case outboundorder.FieldCreatedAt:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
@@ -19751,6 +20002,9 @@ func (m *OutboundOrderMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(outboundorder.FieldProductWorkNo) {
|
||||
fields = append(fields, outboundorder.FieldProductWorkNo)
|
||||
}
|
||||
if m.FieldCleared(outboundorder.FieldVoidedAt) {
|
||||
fields = append(fields, outboundorder.FieldVoidedAt)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -19828,6 +20082,9 @@ func (m *OutboundOrderMutation) ClearField(name string) error {
|
||||
case outboundorder.FieldProductWorkNo:
|
||||
m.ClearProductWorkNo()
|
||||
return nil
|
||||
case outboundorder.FieldVoidedAt:
|
||||
m.ClearVoidedAt()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown OutboundOrder nullable field %s", name)
|
||||
}
|
||||
@@ -19923,6 +20180,18 @@ func (m *OutboundOrderMutation) ResetField(name string) error {
|
||||
case outboundorder.FieldProductWorkNo:
|
||||
m.ResetProductWorkNo()
|
||||
return nil
|
||||
case outboundorder.FieldVoided:
|
||||
m.ResetVoided()
|
||||
return nil
|
||||
case outboundorder.FieldVoidReason:
|
||||
m.ResetVoidReason()
|
||||
return nil
|
||||
case outboundorder.FieldVoidedBy:
|
||||
m.ResetVoidedBy()
|
||||
return nil
|
||||
case outboundorder.FieldVoidedAt:
|
||||
m.ResetVoidedAt()
|
||||
return nil
|
||||
case outboundorder.FieldCreatedAt:
|
||||
m.ResetCreatedAt()
|
||||
return nil
|
||||
|
||||
@@ -75,6 +75,14 @@ type OutboundOrder struct {
|
||||
InspectionNo string `json:"inspectionNo,omitempty"`
|
||||
// 产品工号(随库存带入,出库记录展示/筛选)
|
||||
ProductWorkNo string `json:"productWorkNo,omitempty"`
|
||||
// 是否已作废
|
||||
Voided bool `json:"voided,omitempty"`
|
||||
// 作废原因(必填留痕)
|
||||
VoidReason string `json:"voidReason,omitempty"`
|
||||
// 作废操作人
|
||||
VoidedBy string `json:"voidedBy,omitempty"`
|
||||
// 作废时间戳
|
||||
VoidedAt *int64 `json:"voidedAt,omitempty"`
|
||||
// 创建时间
|
||||
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
@@ -87,11 +95,11 @@ func (*OutboundOrder) scanValues(columns []string) ([]any, error) {
|
||||
switch columns[i] {
|
||||
case outboundorder.FieldBorrowFrom:
|
||||
values[i] = new([]byte)
|
||||
case outboundorder.FieldNeedAgv:
|
||||
case outboundorder.FieldNeedAgv, outboundorder.FieldVoided:
|
||||
values[i] = new(sql.NullBool)
|
||||
case outboundorder.FieldID, outboundorder.FieldManageMode, outboundorder.FieldSnMode, outboundorder.FieldQuantity, outboundorder.FieldCreatedAt:
|
||||
case outboundorder.FieldID, outboundorder.FieldManageMode, outboundorder.FieldSnMode, outboundorder.FieldQuantity, outboundorder.FieldVoidedAt, outboundorder.FieldCreatedAt:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case outboundorder.FieldOutboundNo, outboundorder.FieldOutboundType, outboundorder.FieldStatus, outboundorder.FieldOutboundCategory, outboundorder.FieldOwnershipType, outboundorder.FieldOwnershipNo, outboundorder.FieldTargetStation, outboundorder.FieldOrderNo, outboundorder.FieldMaterialCode, outboundorder.FieldMaterialName, outboundorder.FieldBatchNo, outboundorder.FieldZoneCode, outboundorder.FieldShelfNo, outboundorder.FieldLayerNo, outboundorder.FieldPositionNo, outboundorder.FieldOperator, outboundorder.FieldReviewer, outboundorder.FieldTargetDock, outboundorder.FieldRemark, outboundorder.FieldBoxNo, outboundorder.FieldBoxSnList, outboundorder.FieldContractNo, outboundorder.FieldInspectionNo, outboundorder.FieldProductWorkNo:
|
||||
case outboundorder.FieldOutboundNo, outboundorder.FieldOutboundType, outboundorder.FieldStatus, outboundorder.FieldOutboundCategory, outboundorder.FieldOwnershipType, outboundorder.FieldOwnershipNo, outboundorder.FieldTargetStation, outboundorder.FieldOrderNo, outboundorder.FieldMaterialCode, outboundorder.FieldMaterialName, outboundorder.FieldBatchNo, outboundorder.FieldZoneCode, outboundorder.FieldShelfNo, outboundorder.FieldLayerNo, outboundorder.FieldPositionNo, outboundorder.FieldOperator, outboundorder.FieldReviewer, outboundorder.FieldTargetDock, outboundorder.FieldRemark, outboundorder.FieldBoxNo, outboundorder.FieldBoxSnList, outboundorder.FieldContractNo, outboundorder.FieldInspectionNo, outboundorder.FieldProductWorkNo, outboundorder.FieldVoidReason, outboundorder.FieldVoidedBy:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -290,6 +298,31 @@ func (_m *OutboundOrder) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.ProductWorkNo = value.String
|
||||
}
|
||||
case outboundorder.FieldVoided:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field voided", values[i])
|
||||
} else if value.Valid {
|
||||
_m.Voided = value.Bool
|
||||
}
|
||||
case outboundorder.FieldVoidReason:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field void_reason", values[i])
|
||||
} else if value.Valid {
|
||||
_m.VoidReason = value.String
|
||||
}
|
||||
case outboundorder.FieldVoidedBy:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field voided_by", values[i])
|
||||
} else if value.Valid {
|
||||
_m.VoidedBy = value.String
|
||||
}
|
||||
case outboundorder.FieldVoidedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field voided_at", values[i])
|
||||
} else if value.Valid {
|
||||
_m.VoidedAt = new(int64)
|
||||
*_m.VoidedAt = value.Int64
|
||||
}
|
||||
case outboundorder.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field created_at", values[i])
|
||||
@@ -419,6 +452,20 @@ func (_m *OutboundOrder) String() string {
|
||||
builder.WriteString("product_work_no=")
|
||||
builder.WriteString(_m.ProductWorkNo)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("voided=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Voided))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("void_reason=")
|
||||
builder.WriteString(_m.VoidReason)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("voided_by=")
|
||||
builder.WriteString(_m.VoidedBy)
|
||||
builder.WriteString(", ")
|
||||
if v := _m.VoidedAt; v != nil {
|
||||
builder.WriteString("voided_at=")
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("created_at=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.CreatedAt))
|
||||
builder.WriteByte(')')
|
||||
|
||||
@@ -69,6 +69,14 @@ const (
|
||||
FieldInspectionNo = "inspection_no"
|
||||
// FieldProductWorkNo holds the string denoting the product_work_no field in the database.
|
||||
FieldProductWorkNo = "product_work_no"
|
||||
// FieldVoided holds the string denoting the voided field in the database.
|
||||
FieldVoided = "voided"
|
||||
// FieldVoidReason holds the string denoting the void_reason field in the database.
|
||||
FieldVoidReason = "void_reason"
|
||||
// FieldVoidedBy holds the string denoting the voided_by field in the database.
|
||||
FieldVoidedBy = "voided_by"
|
||||
// FieldVoidedAt holds the string denoting the voided_at field in the database.
|
||||
FieldVoidedAt = "voided_at"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// Table holds the table name of the outboundorder in the database.
|
||||
@@ -107,6 +115,10 @@ var Columns = []string{
|
||||
FieldBorrowFrom,
|
||||
FieldInspectionNo,
|
||||
FieldProductWorkNo,
|
||||
FieldVoided,
|
||||
FieldVoidReason,
|
||||
FieldVoidedBy,
|
||||
FieldVoidedAt,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
@@ -133,6 +145,12 @@ var (
|
||||
DefaultSnMode int
|
||||
// DefaultQuantity holds the default value on creation for the "quantity" field.
|
||||
DefaultQuantity int
|
||||
// DefaultVoided holds the default value on creation for the "voided" field.
|
||||
DefaultVoided bool
|
||||
// DefaultVoidReason holds the default value on creation for the "void_reason" field.
|
||||
DefaultVoidReason string
|
||||
// DefaultVoidedBy holds the default value on creation for the "voided_by" field.
|
||||
DefaultVoidedBy string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() int64
|
||||
)
|
||||
@@ -285,6 +303,26 @@ func ByProductWorkNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProductWorkNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVoided orders the results by the voided field.
|
||||
func ByVoided(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVoided, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVoidReason orders the results by the void_reason field.
|
||||
func ByVoidReason(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVoidReason, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVoidedBy orders the results by the voided_by field.
|
||||
func ByVoidedBy(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVoidedBy, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVoidedAt orders the results by the voided_at field.
|
||||
func ByVoidedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVoidedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -193,6 +193,26 @@ func ProductWorkNo(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldProductWorkNo, v))
|
||||
}
|
||||
|
||||
// Voided applies equality check predicate on the "voided" field. It's identical to VoidedEQ.
|
||||
func Voided(v bool) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoided, v))
|
||||
}
|
||||
|
||||
// VoidReason applies equality check predicate on the "void_reason" field. It's identical to VoidReasonEQ.
|
||||
func VoidReason(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidedBy applies equality check predicate on the "voided_by" field. It's identical to VoidedByEQ.
|
||||
func VoidedBy(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedAt applies equality check predicate on the "voided_at" field. It's identical to VoidedAtEQ.
|
||||
func VoidedAt(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -2098,6 +2118,196 @@ func ProductWorkNoContainsFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContainsFold(FieldProductWorkNo, v))
|
||||
}
|
||||
|
||||
// VoidedEQ applies the EQ predicate on the "voided" field.
|
||||
func VoidedEQ(v bool) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoided, v))
|
||||
}
|
||||
|
||||
// VoidedNEQ applies the NEQ predicate on the "voided" field.
|
||||
func VoidedNEQ(v bool) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNEQ(FieldVoided, v))
|
||||
}
|
||||
|
||||
// VoidReasonEQ applies the EQ predicate on the "void_reason" field.
|
||||
func VoidReasonEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonNEQ applies the NEQ predicate on the "void_reason" field.
|
||||
func VoidReasonNEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNEQ(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonIn applies the In predicate on the "void_reason" field.
|
||||
func VoidReasonIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIn(FieldVoidReason, vs...))
|
||||
}
|
||||
|
||||
// VoidReasonNotIn applies the NotIn predicate on the "void_reason" field.
|
||||
func VoidReasonNotIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotIn(FieldVoidReason, vs...))
|
||||
}
|
||||
|
||||
// VoidReasonGT applies the GT predicate on the "void_reason" field.
|
||||
func VoidReasonGT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGT(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonGTE applies the GTE predicate on the "void_reason" field.
|
||||
func VoidReasonGTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGTE(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonLT applies the LT predicate on the "void_reason" field.
|
||||
func VoidReasonLT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLT(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonLTE applies the LTE predicate on the "void_reason" field.
|
||||
func VoidReasonLTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLTE(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonContains applies the Contains predicate on the "void_reason" field.
|
||||
func VoidReasonContains(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContains(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonHasPrefix applies the HasPrefix predicate on the "void_reason" field.
|
||||
func VoidReasonHasPrefix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonHasSuffix applies the HasSuffix predicate on the "void_reason" field.
|
||||
func VoidReasonHasSuffix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonEqualFold applies the EqualFold predicate on the "void_reason" field.
|
||||
func VoidReasonEqualFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEqualFold(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidReasonContainsFold applies the ContainsFold predicate on the "void_reason" field.
|
||||
func VoidReasonContainsFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContainsFold(FieldVoidReason, v))
|
||||
}
|
||||
|
||||
// VoidedByEQ applies the EQ predicate on the "voided_by" field.
|
||||
func VoidedByEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByNEQ applies the NEQ predicate on the "voided_by" field.
|
||||
func VoidedByNEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNEQ(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByIn applies the In predicate on the "voided_by" field.
|
||||
func VoidedByIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIn(FieldVoidedBy, vs...))
|
||||
}
|
||||
|
||||
// VoidedByNotIn applies the NotIn predicate on the "voided_by" field.
|
||||
func VoidedByNotIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotIn(FieldVoidedBy, vs...))
|
||||
}
|
||||
|
||||
// VoidedByGT applies the GT predicate on the "voided_by" field.
|
||||
func VoidedByGT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGT(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByGTE applies the GTE predicate on the "voided_by" field.
|
||||
func VoidedByGTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGTE(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByLT applies the LT predicate on the "voided_by" field.
|
||||
func VoidedByLT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLT(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByLTE applies the LTE predicate on the "voided_by" field.
|
||||
func VoidedByLTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLTE(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByContains applies the Contains predicate on the "voided_by" field.
|
||||
func VoidedByContains(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContains(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByHasPrefix applies the HasPrefix predicate on the "voided_by" field.
|
||||
func VoidedByHasPrefix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByHasSuffix applies the HasSuffix predicate on the "voided_by" field.
|
||||
func VoidedByHasSuffix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByEqualFold applies the EqualFold predicate on the "voided_by" field.
|
||||
func VoidedByEqualFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEqualFold(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedByContainsFold applies the ContainsFold predicate on the "voided_by" field.
|
||||
func VoidedByContainsFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContainsFold(FieldVoidedBy, v))
|
||||
}
|
||||
|
||||
// VoidedAtEQ applies the EQ predicate on the "voided_at" field.
|
||||
func VoidedAtEQ(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtNEQ applies the NEQ predicate on the "voided_at" field.
|
||||
func VoidedAtNEQ(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNEQ(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtIn applies the In predicate on the "voided_at" field.
|
||||
func VoidedAtIn(vs ...int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIn(FieldVoidedAt, vs...))
|
||||
}
|
||||
|
||||
// VoidedAtNotIn applies the NotIn predicate on the "voided_at" field.
|
||||
func VoidedAtNotIn(vs ...int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotIn(FieldVoidedAt, vs...))
|
||||
}
|
||||
|
||||
// VoidedAtGT applies the GT predicate on the "voided_at" field.
|
||||
func VoidedAtGT(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGT(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtGTE applies the GTE predicate on the "voided_at" field.
|
||||
func VoidedAtGTE(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGTE(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtLT applies the LT predicate on the "voided_at" field.
|
||||
func VoidedAtLT(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLT(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtLTE applies the LTE predicate on the "voided_at" field.
|
||||
func VoidedAtLTE(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLTE(FieldVoidedAt, v))
|
||||
}
|
||||
|
||||
// VoidedAtIsNil applies the IsNil predicate on the "voided_at" field.
|
||||
func VoidedAtIsNil() predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIsNull(FieldVoidedAt))
|
||||
}
|
||||
|
||||
// VoidedAtNotNil applies the NotNil predicate on the "voided_at" field.
|
||||
func VoidedAtNotNil() predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotNull(FieldVoidedAt))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
@@ -403,6 +403,62 @@ func (_c *OutboundOrderCreate) SetNillableProductWorkNo(v *string) *OutboundOrde
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (_c *OutboundOrderCreate) SetVoided(v bool) *OutboundOrderCreate {
|
||||
_c.mutation.SetVoided(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableVoided sets the "voided" field if the given value is not nil.
|
||||
func (_c *OutboundOrderCreate) SetNillableVoided(v *bool) *OutboundOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetVoided(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (_c *OutboundOrderCreate) SetVoidReason(v string) *OutboundOrderCreate {
|
||||
_c.mutation.SetVoidReason(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableVoidReason sets the "void_reason" field if the given value is not nil.
|
||||
func (_c *OutboundOrderCreate) SetNillableVoidReason(v *string) *OutboundOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetVoidReason(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (_c *OutboundOrderCreate) SetVoidedBy(v string) *OutboundOrderCreate {
|
||||
_c.mutation.SetVoidedBy(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableVoidedBy sets the "voided_by" field if the given value is not nil.
|
||||
func (_c *OutboundOrderCreate) SetNillableVoidedBy(v *string) *OutboundOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetVoidedBy(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (_c *OutboundOrderCreate) SetVoidedAt(v int64) *OutboundOrderCreate {
|
||||
_c.mutation.SetVoidedAt(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
|
||||
func (_c *OutboundOrderCreate) SetNillableVoidedAt(v *int64) *OutboundOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetVoidedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *OutboundOrderCreate) SetCreatedAt(v int64) *OutboundOrderCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -476,6 +532,18 @@ func (_c *OutboundOrderCreate) defaults() {
|
||||
v := outboundorder.DefaultQuantity
|
||||
_c.mutation.SetQuantity(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Voided(); !ok {
|
||||
v := outboundorder.DefaultVoided
|
||||
_c.mutation.SetVoided(v)
|
||||
}
|
||||
if _, ok := _c.mutation.VoidReason(); !ok {
|
||||
v := outboundorder.DefaultVoidReason
|
||||
_c.mutation.SetVoidReason(v)
|
||||
}
|
||||
if _, ok := _c.mutation.VoidedBy(); !ok {
|
||||
v := outboundorder.DefaultVoidedBy
|
||||
_c.mutation.SetVoidedBy(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := outboundorder.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -508,6 +576,15 @@ func (_c *OutboundOrderCreate) check() error {
|
||||
if _, ok := _c.mutation.Quantity(); !ok {
|
||||
return &ValidationError{Name: "quantity", err: errors.New(`ent: missing required field "OutboundOrder.quantity"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.Voided(); !ok {
|
||||
return &ValidationError{Name: "voided", err: errors.New(`ent: missing required field "OutboundOrder.voided"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.VoidReason(); !ok {
|
||||
return &ValidationError{Name: "void_reason", err: errors.New(`ent: missing required field "OutboundOrder.void_reason"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.VoidedBy(); !ok {
|
||||
return &ValidationError{Name: "voided_by", err: errors.New(`ent: missing required field "OutboundOrder.voided_by"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "OutboundOrder.created_at"`)}
|
||||
}
|
||||
@@ -654,6 +731,22 @@ func (_c *OutboundOrderCreate) createSpec() (*OutboundOrder, *sqlgraph.CreateSpe
|
||||
_spec.SetField(outboundorder.FieldProductWorkNo, field.TypeString, value)
|
||||
_node.ProductWorkNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.Voided(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoided, field.TypeBool, value)
|
||||
_node.Voided = value
|
||||
}
|
||||
if value, ok := _c.mutation.VoidReason(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidReason, field.TypeString, value)
|
||||
_node.VoidReason = value
|
||||
}
|
||||
if value, ok := _c.mutation.VoidedBy(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedBy, field.TypeString, value)
|
||||
_node.VoidedBy = value
|
||||
}
|
||||
if value, ok := _c.mutation.VoidedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedAt, field.TypeInt64, value)
|
||||
_node.VoidedAt = &value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
_node.CreatedAt = value
|
||||
@@ -1202,6 +1295,66 @@ func (u *OutboundOrderUpsert) ClearProductWorkNo() *OutboundOrderUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (u *OutboundOrderUpsert) SetVoided(v bool) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldVoided, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateVoided sets the "voided" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsert) UpdateVoided() *OutboundOrderUpsert {
|
||||
u.SetExcluded(outboundorder.FieldVoided)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (u *OutboundOrderUpsert) SetVoidReason(v string) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldVoidReason, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateVoidReason sets the "void_reason" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsert) UpdateVoidReason() *OutboundOrderUpsert {
|
||||
u.SetExcluded(outboundorder.FieldVoidReason)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (u *OutboundOrderUpsert) SetVoidedBy(v string) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldVoidedBy, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateVoidedBy sets the "voided_by" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsert) UpdateVoidedBy() *OutboundOrderUpsert {
|
||||
u.SetExcluded(outboundorder.FieldVoidedBy)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (u *OutboundOrderUpsert) SetVoidedAt(v int64) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldVoidedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsert) UpdateVoidedAt() *OutboundOrderUpsert {
|
||||
u.SetExcluded(outboundorder.FieldVoidedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddVoidedAt adds v to the "voided_at" field.
|
||||
func (u *OutboundOrderUpsert) AddVoidedAt(v int64) *OutboundOrderUpsert {
|
||||
u.Add(outboundorder.FieldVoidedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (u *OutboundOrderUpsert) ClearVoidedAt() *OutboundOrderUpsert {
|
||||
u.SetNull(outboundorder.FieldVoidedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsert) SetCreatedAt(v int64) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldCreatedAt, v)
|
||||
@@ -1834,6 +1987,76 @@ func (u *OutboundOrderUpsertOne) ClearProductWorkNo() *OutboundOrderUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (u *OutboundOrderUpsertOne) SetVoided(v bool) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoided(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoided sets the "voided" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertOne) UpdateVoided() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoided()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (u *OutboundOrderUpsertOne) SetVoidReason(v string) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidReason(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidReason sets the "void_reason" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertOne) UpdateVoidReason() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidReason()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (u *OutboundOrderUpsertOne) SetVoidedBy(v string) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidedBy(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidedBy sets the "voided_by" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertOne) UpdateVoidedBy() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidedBy()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertOne) SetVoidedAt(v int64) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddVoidedAt adds v to the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertOne) AddVoidedAt(v int64) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.AddVoidedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertOne) UpdateVoidedAt() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertOne) ClearVoidedAt() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.ClearVoidedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsertOne) SetCreatedAt(v int64) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
@@ -2633,6 +2856,76 @@ func (u *OutboundOrderUpsertBulk) ClearProductWorkNo() *OutboundOrderUpsertBulk
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetVoided(v bool) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoided(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoided sets the "voided" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertBulk) UpdateVoided() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoided()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetVoidReason(v string) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidReason(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidReason sets the "void_reason" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertBulk) UpdateVoidReason() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidReason()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetVoidedBy(v string) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidedBy(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidedBy sets the "voided_by" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertBulk) UpdateVoidedBy() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidedBy()
|
||||
})
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetVoidedAt(v int64) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetVoidedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddVoidedAt adds v to the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertBulk) AddVoidedAt(v int64) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.AddVoidedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertBulk) UpdateVoidedAt() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateVoidedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (u *OutboundOrderUpsertBulk) ClearVoidedAt() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.ClearVoidedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetCreatedAt(v int64) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
|
||||
@@ -572,6 +572,75 @@ func (_u *OutboundOrderUpdate) ClearProductWorkNo() *OutboundOrderUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (_u *OutboundOrderUpdate) SetVoided(v bool) *OutboundOrderUpdate {
|
||||
_u.mutation.SetVoided(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoided sets the "voided" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdate) SetNillableVoided(v *bool) *OutboundOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetVoided(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (_u *OutboundOrderUpdate) SetVoidReason(v string) *OutboundOrderUpdate {
|
||||
_u.mutation.SetVoidReason(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidReason sets the "void_reason" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdate) SetNillableVoidReason(v *string) *OutboundOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetVoidReason(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (_u *OutboundOrderUpdate) SetVoidedBy(v string) *OutboundOrderUpdate {
|
||||
_u.mutation.SetVoidedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidedBy sets the "voided_by" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdate) SetNillableVoidedBy(v *string) *OutboundOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetVoidedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdate) SetVoidedAt(v int64) *OutboundOrderUpdate {
|
||||
_u.mutation.ResetVoidedAt()
|
||||
_u.mutation.SetVoidedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdate) SetNillableVoidedAt(v *int64) *OutboundOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetVoidedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddVoidedAt adds value to the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdate) AddVoidedAt(v int64) *OutboundOrderUpdate {
|
||||
_u.mutation.AddVoidedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdate) ClearVoidedAt() *OutboundOrderUpdate {
|
||||
_u.mutation.ClearVoidedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *OutboundOrderUpdate) SetCreatedAt(v int64) *OutboundOrderUpdate {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -793,6 +862,24 @@ func (_u *OutboundOrderUpdate) sqlSave(ctx context.Context) (_node int, err erro
|
||||
if _u.mutation.ProductWorkNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldProductWorkNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Voided(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoided, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidReason(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidReason, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidedBy(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedBy, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedVoidedAt(); ok {
|
||||
_spec.AddField(outboundorder.FieldVoidedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.VoidedAtCleared() {
|
||||
_spec.ClearField(outboundorder.FieldVoidedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
@@ -1364,6 +1451,75 @@ func (_u *OutboundOrderUpdateOne) ClearProductWorkNo() *OutboundOrderUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoided sets the "voided" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetVoided(v bool) *OutboundOrderUpdateOne {
|
||||
_u.mutation.SetVoided(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoided sets the "voided" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdateOne) SetNillableVoided(v *bool) *OutboundOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetVoided(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidReason sets the "void_reason" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetVoidReason(v string) *OutboundOrderUpdateOne {
|
||||
_u.mutation.SetVoidReason(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidReason sets the "void_reason" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdateOne) SetNillableVoidReason(v *string) *OutboundOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetVoidReason(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidedBy sets the "voided_by" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetVoidedBy(v string) *OutboundOrderUpdateOne {
|
||||
_u.mutation.SetVoidedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidedBy sets the "voided_by" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdateOne) SetNillableVoidedBy(v *string) *OutboundOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetVoidedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetVoidedAt sets the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetVoidedAt(v int64) *OutboundOrderUpdateOne {
|
||||
_u.mutation.ResetVoidedAt()
|
||||
_u.mutation.SetVoidedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdateOne) SetNillableVoidedAt(v *int64) *OutboundOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetVoidedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddVoidedAt adds value to the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdateOne) AddVoidedAt(v int64) *OutboundOrderUpdateOne {
|
||||
_u.mutation.AddVoidedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearVoidedAt clears the value of the "voided_at" field.
|
||||
func (_u *OutboundOrderUpdateOne) ClearVoidedAt() *OutboundOrderUpdateOne {
|
||||
_u.mutation.ClearVoidedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetCreatedAt(v int64) *OutboundOrderUpdateOne {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -1615,6 +1771,24 @@ func (_u *OutboundOrderUpdateOne) sqlSave(ctx context.Context) (_node *OutboundO
|
||||
if _u.mutation.ProductWorkNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldProductWorkNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Voided(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoided, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidReason(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidReason, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidedBy(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedBy, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.VoidedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldVoidedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedVoidedAt(); ok {
|
||||
_spec.AddField(outboundorder.FieldVoidedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.VoidedAtCleared() {
|
||||
_spec.ClearField(outboundorder.FieldVoidedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
|
||||
@@ -436,8 +436,20 @@ func init() {
|
||||
outboundorderDescQuantity := outboundorderFields[18].Descriptor()
|
||||
// outboundorder.DefaultQuantity holds the default value on creation for the quantity field.
|
||||
outboundorder.DefaultQuantity = outboundorderDescQuantity.Default.(int)
|
||||
// outboundorderDescVoided is the schema descriptor for voided field.
|
||||
outboundorderDescVoided := outboundorderFields[29].Descriptor()
|
||||
// outboundorder.DefaultVoided holds the default value on creation for the voided field.
|
||||
outboundorder.DefaultVoided = outboundorderDescVoided.Default.(bool)
|
||||
// outboundorderDescVoidReason is the schema descriptor for void_reason field.
|
||||
outboundorderDescVoidReason := outboundorderFields[30].Descriptor()
|
||||
// outboundorder.DefaultVoidReason holds the default value on creation for the void_reason field.
|
||||
outboundorder.DefaultVoidReason = outboundorderDescVoidReason.Default.(string)
|
||||
// outboundorderDescVoidedBy is the schema descriptor for voided_by field.
|
||||
outboundorderDescVoidedBy := outboundorderFields[31].Descriptor()
|
||||
// outboundorder.DefaultVoidedBy holds the default value on creation for the voided_by field.
|
||||
outboundorder.DefaultVoidedBy = outboundorderDescVoidedBy.Default.(string)
|
||||
// outboundorderDescCreatedAt is the schema descriptor for created_at field.
|
||||
outboundorderDescCreatedAt := outboundorderFields[29].Descriptor()
|
||||
outboundorderDescCreatedAt := outboundorderFields[33].Descriptor()
|
||||
// outboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
outboundorder.DefaultCreatedAt = outboundorderDescCreatedAt.Default.(func() int64)
|
||||
permissionFields := schema.Permission{}.Fields()
|
||||
|
||||
Reference in New Issue
Block a user