|
@@ -177,6 +177,20 @@ func (wc *WhatsappCreate) SetNillablePhone(s *string) *WhatsappCreate {
|
|
|
return wc
|
|
|
}
|
|
|
|
|
|
+// SetCcPhone sets the "cc_phone" field.
|
|
|
+func (wc *WhatsappCreate) SetCcPhone(s string) *WhatsappCreate {
|
|
|
+ wc.mutation.SetCcPhone(s)
|
|
|
+ return wc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableCcPhone sets the "cc_phone" field if the given value is not nil.
|
|
|
+func (wc *WhatsappCreate) SetNillableCcPhone(s *string) *WhatsappCreate {
|
|
|
+ if s != nil {
|
|
|
+ wc.SetCcPhone(*s)
|
|
|
+ }
|
|
|
+ return wc
|
|
|
+}
|
|
|
+
|
|
|
// SetPhoneName sets the "phone_name" field.
|
|
|
func (wc *WhatsappCreate) SetPhoneName(s string) *WhatsappCreate {
|
|
|
wc.mutation.SetPhoneName(s)
|
|
@@ -365,6 +379,10 @@ func (wc *WhatsappCreate) defaults() error {
|
|
|
v := whatsapp.DefaultPhone
|
|
|
wc.mutation.SetPhone(v)
|
|
|
}
|
|
|
+ if _, ok := wc.mutation.CcPhone(); !ok {
|
|
|
+ v := whatsapp.DefaultCcPhone
|
|
|
+ wc.mutation.SetCcPhone(v)
|
|
|
+ }
|
|
|
if _, ok := wc.mutation.PhoneName(); !ok {
|
|
|
v := whatsapp.DefaultPhoneName
|
|
|
wc.mutation.SetPhoneName(v)
|
|
@@ -405,6 +423,9 @@ func (wc *WhatsappCreate) check() error {
|
|
|
if _, ok := wc.mutation.Phone(); !ok {
|
|
|
return &ValidationError{Name: "phone", err: errors.New(`ent: missing required field "Whatsapp.phone"`)}
|
|
|
}
|
|
|
+ if _, ok := wc.mutation.CcPhone(); !ok {
|
|
|
+ return &ValidationError{Name: "cc_phone", err: errors.New(`ent: missing required field "Whatsapp.cc_phone"`)}
|
|
|
+ }
|
|
|
if _, ok := wc.mutation.PhoneName(); !ok {
|
|
|
return &ValidationError{Name: "phone_name", err: errors.New(`ent: missing required field "Whatsapp.phone_name"`)}
|
|
|
}
|
|
@@ -487,6 +508,10 @@ func (wc *WhatsappCreate) createSpec() (*Whatsapp, *sqlgraph.CreateSpec) {
|
|
|
_spec.SetField(whatsapp.FieldPhone, field.TypeString, value)
|
|
|
_node.Phone = value
|
|
|
}
|
|
|
+ if value, ok := wc.mutation.CcPhone(); ok {
|
|
|
+ _spec.SetField(whatsapp.FieldCcPhone, field.TypeString, value)
|
|
|
+ _node.CcPhone = value
|
|
|
+ }
|
|
|
if value, ok := wc.mutation.PhoneName(); ok {
|
|
|
_spec.SetField(whatsapp.FieldPhoneName, field.TypeString, value)
|
|
|
_node.PhoneName = value
|
|
@@ -754,6 +779,18 @@ func (u *WhatsappUpsert) UpdatePhone() *WhatsappUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// SetCcPhone sets the "cc_phone" field.
|
|
|
+func (u *WhatsappUpsert) SetCcPhone(v string) *WhatsappUpsert {
|
|
|
+ u.Set(whatsapp.FieldCcPhone, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCcPhone sets the "cc_phone" field to the value that was provided on create.
|
|
|
+func (u *WhatsappUpsert) UpdateCcPhone() *WhatsappUpsert {
|
|
|
+ u.SetExcluded(whatsapp.FieldCcPhone)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetPhoneName sets the "phone_name" field.
|
|
|
func (u *WhatsappUpsert) SetPhoneName(v string) *WhatsappUpsert {
|
|
|
u.Set(whatsapp.FieldPhoneName, v)
|
|
@@ -1156,6 +1193,20 @@ func (u *WhatsappUpsertOne) UpdatePhone() *WhatsappUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// SetCcPhone sets the "cc_phone" field.
|
|
|
+func (u *WhatsappUpsertOne) SetCcPhone(v string) *WhatsappUpsertOne {
|
|
|
+ return u.Update(func(s *WhatsappUpsert) {
|
|
|
+ s.SetCcPhone(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCcPhone sets the "cc_phone" field to the value that was provided on create.
|
|
|
+func (u *WhatsappUpsertOne) UpdateCcPhone() *WhatsappUpsertOne {
|
|
|
+ return u.Update(func(s *WhatsappUpsert) {
|
|
|
+ s.UpdateCcPhone()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetPhoneName sets the "phone_name" field.
|
|
|
func (u *WhatsappUpsertOne) SetPhoneName(v string) *WhatsappUpsertOne {
|
|
|
return u.Update(func(s *WhatsappUpsert) {
|
|
@@ -1751,6 +1802,20 @@ func (u *WhatsappUpsertBulk) UpdatePhone() *WhatsappUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// SetCcPhone sets the "cc_phone" field.
|
|
|
+func (u *WhatsappUpsertBulk) SetCcPhone(v string) *WhatsappUpsertBulk {
|
|
|
+ return u.Update(func(s *WhatsappUpsert) {
|
|
|
+ s.SetCcPhone(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCcPhone sets the "cc_phone" field to the value that was provided on create.
|
|
|
+func (u *WhatsappUpsertBulk) UpdateCcPhone() *WhatsappUpsertBulk {
|
|
|
+ return u.Update(func(s *WhatsappUpsert) {
|
|
|
+ s.UpdateCcPhone()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetPhoneName sets the "phone_name" field.
|
|
|
func (u *WhatsappUpsertBulk) SetPhoneName(v string) *WhatsappUpsertBulk {
|
|
|
return u.Update(func(s *WhatsappUpsert) {
|