|
@@ -4108,6 +4108,7 @@ type MessageRecordsMutation struct {
|
|
|
content_type *int
|
|
|
addcontent_type *int
|
|
|
content *string
|
|
|
+ meta *custom_types.Meta
|
|
|
error_detail *string
|
|
|
send_time *time.Time
|
|
|
source_type *int
|
|
@@ -4688,6 +4689,55 @@ func (m *MessageRecordsMutation) ResetContent() {
|
|
|
m.content = nil
|
|
|
}
|
|
|
|
|
|
+// SetMeta sets the "meta" field.
|
|
|
+func (m *MessageRecordsMutation) SetMeta(ct custom_types.Meta) {
|
|
|
+ m.meta = &ct
|
|
|
+}
|
|
|
+
|
|
|
+// Meta returns the value of the "meta" field in the mutation.
|
|
|
+func (m *MessageRecordsMutation) Meta() (r custom_types.Meta, exists bool) {
|
|
|
+ v := m.meta
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldMeta returns the old "meta" field's value of the MessageRecords entity.
|
|
|
+// If the MessageRecords 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 *MessageRecordsMutation) OldMeta(ctx context.Context) (v custom_types.Meta, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldMeta is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldMeta requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldMeta: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Meta, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearMeta clears the value of the "meta" field.
|
|
|
+func (m *MessageRecordsMutation) ClearMeta() {
|
|
|
+ m.meta = nil
|
|
|
+ m.clearedFields[messagerecords.FieldMeta] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// MetaCleared returns if the "meta" field was cleared in this mutation.
|
|
|
+func (m *MessageRecordsMutation) MetaCleared() bool {
|
|
|
+ _, ok := m.clearedFields[messagerecords.FieldMeta]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetMeta resets all changes to the "meta" field.
|
|
|
+func (m *MessageRecordsMutation) ResetMeta() {
|
|
|
+ m.meta = nil
|
|
|
+ delete(m.clearedFields, messagerecords.FieldMeta)
|
|
|
+}
|
|
|
+
|
|
|
// SetErrorDetail sets the "error_detail" field.
|
|
|
func (m *MessageRecordsMutation) SetErrorDetail(s string) {
|
|
|
m.error_detail = &s
|
|
@@ -5081,7 +5131,7 @@ func (m *MessageRecordsMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *MessageRecordsMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 15)
|
|
|
+ fields := make([]string, 0, 16)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, messagerecords.FieldCreatedAt)
|
|
|
}
|
|
@@ -5112,6 +5162,9 @@ func (m *MessageRecordsMutation) Fields() []string {
|
|
|
if m.content != nil {
|
|
|
fields = append(fields, messagerecords.FieldContent)
|
|
|
}
|
|
|
+ if m.meta != nil {
|
|
|
+ fields = append(fields, messagerecords.FieldMeta)
|
|
|
+ }
|
|
|
if m.error_detail != nil {
|
|
|
fields = append(fields, messagerecords.FieldErrorDetail)
|
|
|
}
|
|
@@ -5155,6 +5208,8 @@ func (m *MessageRecordsMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.ContentType()
|
|
|
case messagerecords.FieldContent:
|
|
|
return m.Content()
|
|
|
+ case messagerecords.FieldMeta:
|
|
|
+ return m.Meta()
|
|
|
case messagerecords.FieldErrorDetail:
|
|
|
return m.ErrorDetail()
|
|
|
case messagerecords.FieldSendTime:
|
|
@@ -5194,6 +5249,8 @@ func (m *MessageRecordsMutation) OldField(ctx context.Context, name string) (ent
|
|
|
return m.OldContentType(ctx)
|
|
|
case messagerecords.FieldContent:
|
|
|
return m.OldContent(ctx)
|
|
|
+ case messagerecords.FieldMeta:
|
|
|
+ return m.OldMeta(ctx)
|
|
|
case messagerecords.FieldErrorDetail:
|
|
|
return m.OldErrorDetail(ctx)
|
|
|
case messagerecords.FieldSendTime:
|
|
@@ -5283,6 +5340,13 @@ func (m *MessageRecordsMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetContent(v)
|
|
|
return nil
|
|
|
+ case messagerecords.FieldMeta:
|
|
|
+ v, ok := value.(custom_types.Meta)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetMeta(v)
|
|
|
+ return nil
|
|
|
case messagerecords.FieldErrorDetail:
|
|
|
v, ok := value.(string)
|
|
|
if !ok {
|
|
@@ -5408,6 +5472,9 @@ func (m *MessageRecordsMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(messagerecords.FieldContactID) {
|
|
|
fields = append(fields, messagerecords.FieldContactID)
|
|
|
}
|
|
|
+ if m.FieldCleared(messagerecords.FieldMeta) {
|
|
|
+ fields = append(fields, messagerecords.FieldMeta)
|
|
|
+ }
|
|
|
if m.FieldCleared(messagerecords.FieldSendTime) {
|
|
|
fields = append(fields, messagerecords.FieldSendTime)
|
|
|
}
|
|
@@ -5440,6 +5507,9 @@ func (m *MessageRecordsMutation) ClearField(name string) error {
|
|
|
case messagerecords.FieldContactID:
|
|
|
m.ClearContactID()
|
|
|
return nil
|
|
|
+ case messagerecords.FieldMeta:
|
|
|
+ m.ClearMeta()
|
|
|
+ return nil
|
|
|
case messagerecords.FieldSendTime:
|
|
|
m.ClearSendTime()
|
|
|
return nil
|
|
@@ -5487,6 +5557,9 @@ func (m *MessageRecordsMutation) ResetField(name string) error {
|
|
|
case messagerecords.FieldContent:
|
|
|
m.ResetContent()
|
|
|
return nil
|
|
|
+ case messagerecords.FieldMeta:
|
|
|
+ m.ResetMeta()
|
|
|
+ return nil
|
|
|
case messagerecords.FieldErrorDetail:
|
|
|
m.ResetErrorDetail()
|
|
|
return nil
|
|
@@ -6500,34 +6573,36 @@ func (m *ServerMutation) ResetEdge(name string) error {
|
|
|
// SopNodeMutation represents an operation that mutates the SopNode nodes in the graph.
|
|
|
type SopNodeMutation struct {
|
|
|
config
|
|
|
- op Op
|
|
|
- typ string
|
|
|
- id *uint64
|
|
|
- created_at *time.Time
|
|
|
- updated_at *time.Time
|
|
|
- status *uint8
|
|
|
- addstatus *int8
|
|
|
- deleted_at *time.Time
|
|
|
- parent_id *uint64
|
|
|
- addparent_id *int64
|
|
|
- name *string
|
|
|
- condition_type *int
|
|
|
- addcondition_type *int
|
|
|
- condition_list *[]string
|
|
|
- appendcondition_list []string
|
|
|
- action_message *[]custom_types.Action
|
|
|
- appendaction_message []custom_types.Action
|
|
|
- action_label *[]uint64
|
|
|
- appendaction_label []uint64
|
|
|
- clearedFields map[string]struct{}
|
|
|
- sop_stage *uint64
|
|
|
- clearedsop_stage bool
|
|
|
- node_messages map[uint64]struct{}
|
|
|
- removednode_messages map[uint64]struct{}
|
|
|
- clearednode_messages bool
|
|
|
- done bool
|
|
|
- oldValue func(context.Context) (*SopNode, error)
|
|
|
- predicates []predicate.SopNode
|
|
|
+ op Op
|
|
|
+ typ string
|
|
|
+ id *uint64
|
|
|
+ created_at *time.Time
|
|
|
+ updated_at *time.Time
|
|
|
+ status *uint8
|
|
|
+ addstatus *int8
|
|
|
+ deleted_at *time.Time
|
|
|
+ parent_id *uint64
|
|
|
+ addparent_id *int64
|
|
|
+ name *string
|
|
|
+ condition_type *int
|
|
|
+ addcondition_type *int
|
|
|
+ condition_list *[]string
|
|
|
+ appendcondition_list []string
|
|
|
+ no_reply_condition *uint64
|
|
|
+ addno_reply_condition *int64
|
|
|
+ action_message *[]custom_types.Action
|
|
|
+ appendaction_message []custom_types.Action
|
|
|
+ action_label *[]uint64
|
|
|
+ appendaction_label []uint64
|
|
|
+ clearedFields map[string]struct{}
|
|
|
+ sop_stage *uint64
|
|
|
+ clearedsop_stage bool
|
|
|
+ node_messages map[uint64]struct{}
|
|
|
+ removednode_messages map[uint64]struct{}
|
|
|
+ clearednode_messages bool
|
|
|
+ done bool
|
|
|
+ oldValue func(context.Context) (*SopNode, error)
|
|
|
+ predicates []predicate.SopNode
|
|
|
}
|
|
|
|
|
|
var _ ent.Mutation = (*SopNodeMutation)(nil)
|
|
@@ -7074,6 +7149,62 @@ func (m *SopNodeMutation) ResetConditionList() {
|
|
|
delete(m.clearedFields, sopnode.FieldConditionList)
|
|
|
}
|
|
|
|
|
|
+// SetNoReplyCondition sets the "no_reply_condition" field.
|
|
|
+func (m *SopNodeMutation) SetNoReplyCondition(u uint64) {
|
|
|
+ m.no_reply_condition = &u
|
|
|
+ m.addno_reply_condition = nil
|
|
|
+}
|
|
|
+
|
|
|
+// NoReplyCondition returns the value of the "no_reply_condition" field in the mutation.
|
|
|
+func (m *SopNodeMutation) NoReplyCondition() (r uint64, exists bool) {
|
|
|
+ v := m.no_reply_condition
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldNoReplyCondition returns the old "no_reply_condition" field's value of the SopNode entity.
|
|
|
+// If the SopNode 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 *SopNodeMutation) OldNoReplyCondition(ctx context.Context) (v uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldNoReplyCondition is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldNoReplyCondition requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldNoReplyCondition: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.NoReplyCondition, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddNoReplyCondition adds u to the "no_reply_condition" field.
|
|
|
+func (m *SopNodeMutation) AddNoReplyCondition(u int64) {
|
|
|
+ if m.addno_reply_condition != nil {
|
|
|
+ *m.addno_reply_condition += u
|
|
|
+ } else {
|
|
|
+ m.addno_reply_condition = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedNoReplyCondition returns the value that was added to the "no_reply_condition" field in this mutation.
|
|
|
+func (m *SopNodeMutation) AddedNoReplyCondition() (r int64, exists bool) {
|
|
|
+ v := m.addno_reply_condition
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetNoReplyCondition resets all changes to the "no_reply_condition" field.
|
|
|
+func (m *SopNodeMutation) ResetNoReplyCondition() {
|
|
|
+ m.no_reply_condition = nil
|
|
|
+ m.addno_reply_condition = nil
|
|
|
+}
|
|
|
+
|
|
|
// SetActionMessage sets the "action_message" field.
|
|
|
func (m *SopNodeMutation) SetActionMessage(ct []custom_types.Action) {
|
|
|
m.action_message = &ct
|
|
@@ -7332,7 +7463,7 @@ func (m *SopNodeMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *SopNodeMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 11)
|
|
|
+ fields := make([]string, 0, 12)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, sopnode.FieldCreatedAt)
|
|
|
}
|
|
@@ -7360,6 +7491,9 @@ func (m *SopNodeMutation) Fields() []string {
|
|
|
if m.condition_list != nil {
|
|
|
fields = append(fields, sopnode.FieldConditionList)
|
|
|
}
|
|
|
+ if m.no_reply_condition != nil {
|
|
|
+ fields = append(fields, sopnode.FieldNoReplyCondition)
|
|
|
+ }
|
|
|
if m.action_message != nil {
|
|
|
fields = append(fields, sopnode.FieldActionMessage)
|
|
|
}
|
|
@@ -7392,6 +7526,8 @@ func (m *SopNodeMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.ConditionType()
|
|
|
case sopnode.FieldConditionList:
|
|
|
return m.ConditionList()
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ return m.NoReplyCondition()
|
|
|
case sopnode.FieldActionMessage:
|
|
|
return m.ActionMessage()
|
|
|
case sopnode.FieldActionLabel:
|
|
@@ -7423,6 +7559,8 @@ func (m *SopNodeMutation) OldField(ctx context.Context, name string) (ent.Value,
|
|
|
return m.OldConditionType(ctx)
|
|
|
case sopnode.FieldConditionList:
|
|
|
return m.OldConditionList(ctx)
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ return m.OldNoReplyCondition(ctx)
|
|
|
case sopnode.FieldActionMessage:
|
|
|
return m.OldActionMessage(ctx)
|
|
|
case sopnode.FieldActionLabel:
|
|
@@ -7499,6 +7637,13 @@ func (m *SopNodeMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetConditionList(v)
|
|
|
return nil
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ v, ok := value.(uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetNoReplyCondition(v)
|
|
|
+ return nil
|
|
|
case sopnode.FieldActionMessage:
|
|
|
v, ok := value.([]custom_types.Action)
|
|
|
if !ok {
|
|
@@ -7530,6 +7675,9 @@ func (m *SopNodeMutation) AddedFields() []string {
|
|
|
if m.addcondition_type != nil {
|
|
|
fields = append(fields, sopnode.FieldConditionType)
|
|
|
}
|
|
|
+ if m.addno_reply_condition != nil {
|
|
|
+ fields = append(fields, sopnode.FieldNoReplyCondition)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -7544,6 +7692,8 @@ func (m *SopNodeMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
return m.AddedParentID()
|
|
|
case sopnode.FieldConditionType:
|
|
|
return m.AddedConditionType()
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ return m.AddedNoReplyCondition()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -7574,6 +7724,13 @@ func (m *SopNodeMutation) AddField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.AddConditionType(v)
|
|
|
return nil
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddNoReplyCondition(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown SopNode numeric field %s", name)
|
|
|
}
|
|
@@ -7661,6 +7818,9 @@ func (m *SopNodeMutation) ResetField(name string) error {
|
|
|
case sopnode.FieldConditionList:
|
|
|
m.ResetConditionList()
|
|
|
return nil
|
|
|
+ case sopnode.FieldNoReplyCondition:
|
|
|
+ m.ResetNoReplyCondition()
|
|
|
+ return nil
|
|
|
case sopnode.FieldActionMessage:
|
|
|
m.ResetActionMessage()
|
|
|
return nil
|