|
@@ -9345,6 +9345,7 @@ type EmployeeMutation struct {
|
|
|
ai_info *string
|
|
|
is_vip *int
|
|
|
addis_vip *int
|
|
|
+ chat_url *string
|
|
|
clearedFields map[string]struct{}
|
|
|
em_work_experiences map[uint64]struct{}
|
|
|
removedem_work_experiences map[uint64]struct{}
|
|
@@ -10399,6 +10400,42 @@ func (m *EmployeeMutation) ResetIsVip() {
|
|
|
m.addis_vip = nil
|
|
|
}
|
|
|
|
|
|
+// SetChatURL sets the "chat_url" field.
|
|
|
+func (m *EmployeeMutation) SetChatURL(s string) {
|
|
|
+ m.chat_url = &s
|
|
|
+}
|
|
|
+
|
|
|
+// ChatURL returns the value of the "chat_url" field in the mutation.
|
|
|
+func (m *EmployeeMutation) ChatURL() (r string, exists bool) {
|
|
|
+ v := m.chat_url
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldChatURL returns the old "chat_url" field's value of the Employee entity.
|
|
|
+// If the Employee 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 *EmployeeMutation) OldChatURL(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldChatURL is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldChatURL requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldChatURL: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.ChatURL, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetChatURL resets all changes to the "chat_url" field.
|
|
|
+func (m *EmployeeMutation) ResetChatURL() {
|
|
|
+ m.chat_url = nil
|
|
|
+}
|
|
|
+
|
|
|
// AddEmWorkExperienceIDs adds the "em_work_experiences" edge to the WorkExperience entity by ids.
|
|
|
func (m *EmployeeMutation) AddEmWorkExperienceIDs(ids ...uint64) {
|
|
|
if m.em_work_experiences == nil {
|
|
@@ -10541,7 +10578,7 @@ func (m *EmployeeMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *EmployeeMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 22)
|
|
|
+ fields := make([]string, 0, 23)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, employee.FieldCreatedAt)
|
|
|
}
|
|
@@ -10608,6 +10645,9 @@ func (m *EmployeeMutation) Fields() []string {
|
|
|
if m.is_vip != nil {
|
|
|
fields = append(fields, employee.FieldIsVip)
|
|
|
}
|
|
|
+ if m.chat_url != nil {
|
|
|
+ fields = append(fields, employee.FieldChatURL)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -10660,6 +10700,8 @@ func (m *EmployeeMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.AiInfo()
|
|
|
case employee.FieldIsVip:
|
|
|
return m.IsVip()
|
|
|
+ case employee.FieldChatURL:
|
|
|
+ return m.ChatURL()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -10713,6 +10755,8 @@ func (m *EmployeeMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldAiInfo(ctx)
|
|
|
case employee.FieldIsVip:
|
|
|
return m.OldIsVip(ctx)
|
|
|
+ case employee.FieldChatURL:
|
|
|
+ return m.OldChatURL(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|
|
@@ -10876,6 +10920,13 @@ func (m *EmployeeMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetIsVip(v)
|
|
|
return nil
|
|
|
+ case employee.FieldChatURL:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetChatURL(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|
|
@@ -11081,6 +11132,9 @@ func (m *EmployeeMutation) ResetField(name string) error {
|
|
|
case employee.FieldIsVip:
|
|
|
m.ResetIsVip()
|
|
|
return nil
|
|
|
+ case employee.FieldChatURL:
|
|
|
+ m.ResetChatURL()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|