Browse Source

fix:add whatsapp_channel APIs

jimmyyem 1 month ago
parent
commit
ec4a025105
45 changed files with 7649 additions and 684 deletions
  1. 2 1
      desc/all.api
  2. 14 9
      desc/wechat/whatsapp.api
  3. 98 0
      desc/wechat/whatsapp_channel.api
  4. 151 8
      ent/client.go
  5. 2 0
      ent/ent.go
  6. 12 0
      ent/hook/hook.go
  7. 30 0
      ent/intercept/intercept.go
  8. 32 5
      ent/migrate/schema.go
  9. 1475 138
      ent/mutation.go
  10. 82 0
      ent/pagination.go
  11. 3 0
      ent/predicate/predicate.go
  12. 78 16
      ent/runtime/runtime.go
  13. 8 8
      ent/schema/whatsapp.go
  14. 53 0
      ent/schema/whatsapp_channel.go
  15. 318 30
      ent/set_not_nil.go
  16. 3 0
      ent/tx.go
  17. 44 33
      ent/whatsapp.go
  18. 38 28
      ent/whatsapp/whatsapp.go
  19. 173 153
      ent/whatsapp/where.go
  20. 256 151
      ent/whatsapp_create.go
  21. 156 82
      ent/whatsapp_update.go
  22. 227 0
      ent/whatsappchannel.go
  23. 172 0
      ent/whatsappchannel/whatsappchannel.go
  24. 770 0
      ent/whatsappchannel/where.go
  25. 1391 0
      ent/whatsappchannel_create.go
  26. 88 0
      ent/whatsappchannel_delete.go
  27. 526 0
      ent/whatsappchannel_query.go
  28. 772 0
      ent/whatsappchannel_update.go
  29. 35 0
      internal/handler/routes.go
  30. 44 0
      internal/handler/whatsapp_channel/create_whatsapp_channel_handler.go
  31. 44 0
      internal/handler/whatsapp_channel/delete_whatsapp_channel_handler.go
  32. 44 0
      internal/handler/whatsapp_channel/get_whatsapp_channel_by_id_handler.go
  33. 44 0
      internal/handler/whatsapp_channel/get_whatsapp_channel_list_handler.go
  34. 44 0
      internal/handler/whatsapp_channel/update_whatsapp_channel_handler.go
  35. 62 0
      internal/logic/base/init_api_data.go
  36. 3 2
      internal/logic/whatsapp/create_whatsapp_logic.go
  37. 3 2
      internal/logic/whatsapp/get_whatsapp_by_id_logic.go
  38. 3 8
      internal/logic/whatsapp/get_whatsapp_list_logic.go
  39. 3 2
      internal/logic/whatsapp/update_whatsapp_logic.go
  40. 48 0
      internal/logic/whatsapp_channel/create_whatsapp_channel_logic.go
  41. 37 0
      internal/logic/whatsapp_channel/delete_whatsapp_channel_logic.go
  42. 64 0
      internal/logic/whatsapp_channel/get_whatsapp_channel_by_id_logic.go
  43. 81 0
      internal/logic/whatsapp_channel/get_whatsapp_channel_list_logic.go
  44. 46 0
      internal/logic/whatsapp_channel/update_whatsapp_channel_logic.go
  45. 70 8
      internal/types/types.go

+ 2 - 1
desc/all.api

@@ -40,4 +40,5 @@ import "./wechat/dashboard.api"
 import "./wechat/credit_balance.api"
 import "./wechat/credit_usage.api"
 import "./wechat/pay_recharge.api"
-import "./wechat/whatsapp.api"
+import "./wechat/whatsapp.api"
+import "./wechat/whatsapp_channel.api"

+ 14 - 9
desc/wechat/whatsapp.api

@@ -10,15 +10,15 @@ type (
         // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
         Status  *uint8 `json:"status,optional"`
 
-        // ak 
-        Ak  *string `json:"ak,optional"`
-
-        // 端口号 
-        Sk  *string `json:"sk,optional"`
+        WaId  *uint64 `json:"waId,optional"`
 
         // 回调地址 
         Callback  *string `json:"callback,optional"`
 
+		// 模式ID
+		AgentId  *uint64 `json:"agentId,optional"`
+		AgentInfo *AgentInfo `json:"agentInfo,optional"`
+
         // 微信账号 
         Account  *string `json:"account,optional"`
 
@@ -28,14 +28,19 @@ type (
         // 手机号 
         Phone  *string `json:"phone,optional"`
 
+		// 号码名称
+		PhoneName  *string `json:"phoneName,optional"`
+
+		// 号码状态
+		PhoneStatus  *int8 `json:"phoneStatus,optional"`
+	
+		Tokens *uint64 `json:"tokens,optional"`
+		Frequency *uint64 `json:"frequency,optional"`
+
         // 机构 ID 
         OrganizationId  *uint64 `json:"organizationId,optional"`
 		OrganizationName *string `json:"organizationName,optional"`
 
-        // 模式ID 
-        AgentId  *uint64 `json:"agentId,optional"`
-		AgentInfo *AgentInfo `json:"agentInfo,optional"`
-
         // 大模型服务地址 
         ApiBase  *string `json:"apiBase,optional"`
 

+ 98 - 0
desc/wechat/whatsapp_channel.api

@@ -0,0 +1,98 @@
+import "../base.api"
+
+type (
+    // The data of whatsapp channel information | WhatsappChannel信息
+    WhatsappChannelInfo {
+        BaseIDInfo
+
+        // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
+        Status  *uint8 `json:"status,optional"`
+
+        // ak 
+        Ak  *string `json:"ak,optional"`
+
+        // 端口号 
+        Sk  *string `json:"sk,optional"`
+
+        // 通道ID 
+        WaId  *uint64 `json:"waId,optional"`
+
+        // 通道名 
+        WaName  *string `json:"waName,optional"`
+
+        // WABA ID 
+        WabaId  *uint64 `json:"wabaId,optional"`
+
+        // 商业平台ID 
+        BusinessId  *uint64 `json:"businessId,optional"`
+
+        // 机构 ID 
+        OrganizationId  *uint64 `json:"organizationId,optional"`
+		OrganizationName  *string `json:"organizationName,optional"`
+
+        // 认证主体 
+        VerifyAccount  *string `json:"verifyAccount,optional"`
+    }
+
+    // The response data of whatsapp channel list | WhatsappChannel列表数据
+    WhatsappChannelListResp {
+        BaseDataInfo
+
+        // WhatsappChannel list data | WhatsappChannel列表数据
+        Data WhatsappChannelListInfo `json:"data"`
+    }
+
+    // WhatsappChannel list data | WhatsappChannel列表数据
+    WhatsappChannelListInfo {
+        BaseListInfo
+
+        // The API list data | WhatsappChannel列表数据
+        Data  []WhatsappChannelInfo  `json:"data"`
+    }
+
+    // Get whatsapp channel list request params | WhatsappChannel列表请求参数
+    WhatsappChannelListReq {
+        PageInfo
+
+		OrganizationId  *uint64 `json:"organizationId,optional"`
+		WaName  *string `json:"waName,optional"`
+		WabaId  *uint64 `json:"wabaId,optional"`
+		VerifyAccount  *string `json:"verifyAccount,optional"`
+    }
+
+    // WhatsappChannel information response | WhatsappChannel信息返回体
+    WhatsappChannelInfoResp {
+        BaseDataInfo
+
+        // WhatsappChannel information | WhatsappChannel数据
+        Data WhatsappChannelInfo `json:"data"`
+    }
+)
+
+@server(
+    jwt: Auth
+    group: whatsapp_channel
+    middleware: Authority
+)
+
+service Wechat {
+    // Create whatsapp channel information | 创建WhatsappChannel
+    @handler createWhatsappChannel
+    post /whatsapp_channel/create (WhatsappChannelInfo) returns (BaseMsgResp)
+
+    // Update whatsapp channel information | 更新WhatsappChannel
+    @handler updateWhatsappChannel
+    post /whatsapp_channel/update (WhatsappChannelInfo) returns (BaseMsgResp)
+
+    // Delete whatsapp channel information | 删除WhatsappChannel信息
+    @handler deleteWhatsappChannel
+    post /whatsapp_channel/delete (IDsReq) returns (BaseMsgResp)
+
+    // Get whatsapp channel list | 获取WhatsappChannel列表
+    @handler getWhatsappChannelList
+    post /whatsapp_channel/list (WhatsappChannelListReq) returns (WhatsappChannelListResp)
+
+    // Get whatsapp channel by ID | 通过ID获取WhatsappChannel
+    @handler getWhatsappChannelById
+    post /whatsapp_channel (IDReq) returns (WhatsappChannelInfoResp)
+}

+ 151 - 8
ent/client.go

@@ -43,6 +43,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -128,6 +129,8 @@ type Client struct {
 	UsageTotal *UsageTotalClient
 	// Whatsapp is the client for interacting with the Whatsapp builders.
 	Whatsapp *WhatsappClient
+	// WhatsappChannel is the client for interacting with the WhatsappChannel builders.
+	WhatsappChannel *WhatsappChannelClient
 	// WorkExperience is the client for interacting with the WorkExperience builders.
 	WorkExperience *WorkExperienceClient
 	// WpChatroom is the client for interacting with the WpChatroom builders.
@@ -185,6 +188,7 @@ func (c *Client) init() {
 	c.UsageStatisticMonth = NewUsageStatisticMonthClient(c.config)
 	c.UsageTotal = NewUsageTotalClient(c.config)
 	c.Whatsapp = NewWhatsappClient(c.config)
+	c.WhatsappChannel = NewWhatsappChannelClient(c.config)
 	c.WorkExperience = NewWorkExperienceClient(c.config)
 	c.WpChatroom = NewWpChatroomClient(c.config)
 	c.WpChatroomMember = NewWpChatroomMemberClient(c.config)
@@ -316,6 +320,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
 		UsageStatisticMonth: NewUsageStatisticMonthClient(cfg),
 		UsageTotal:          NewUsageTotalClient(cfg),
 		Whatsapp:            NewWhatsappClient(cfg),
+		WhatsappChannel:     NewWhatsappChannelClient(cfg),
 		WorkExperience:      NewWorkExperienceClient(cfg),
 		WpChatroom:          NewWpChatroomClient(cfg),
 		WpChatroomMember:    NewWpChatroomMemberClient(cfg),
@@ -374,6 +379,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
 		UsageStatisticMonth: NewUsageStatisticMonthClient(cfg),
 		UsageTotal:          NewUsageTotalClient(cfg),
 		Whatsapp:            NewWhatsappClient(cfg),
+		WhatsappChannel:     NewWhatsappChannelClient(cfg),
 		WorkExperience:      NewWorkExperienceClient(cfg),
 		WpChatroom:          NewWpChatroomClient(cfg),
 		WpChatroomMember:    NewWpChatroomMemberClient(cfg),
@@ -416,8 +422,8 @@ func (c *Client) Use(hooks ...Hook) {
 		c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server, c.SopNode,
 		c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail, c.UsageStatisticDay,
 		c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal, c.Whatsapp,
-		c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx, c.WxCard,
-		c.WxCardUser, c.WxCardVisit,
+		c.WhatsappChannel, c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx,
+		c.WxCard, c.WxCardUser, c.WxCardVisit,
 	} {
 		n.Use(hooks...)
 	}
@@ -433,8 +439,8 @@ func (c *Client) Intercept(interceptors ...Interceptor) {
 		c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server, c.SopNode,
 		c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail, c.UsageStatisticDay,
 		c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal, c.Whatsapp,
-		c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx, c.WxCard,
-		c.WxCardUser, c.WxCardVisit,
+		c.WhatsappChannel, c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx,
+		c.WxCard, c.WxCardUser, c.WxCardVisit,
 	} {
 		n.Intercept(interceptors...)
 	}
@@ -507,6 +513,8 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
 		return c.UsageTotal.mutate(ctx, m)
 	case *WhatsappMutation:
 		return c.Whatsapp.mutate(ctx, m)
+	case *WhatsappChannelMutation:
+		return c.WhatsappChannel.mutate(ctx, m)
 	case *WorkExperienceMutation:
 		return c.WorkExperience.mutate(ctx, m)
 	case *WpChatroomMutation:
@@ -5216,6 +5224,141 @@ func (c *WhatsappClient) mutate(ctx context.Context, m *WhatsappMutation) (Value
 	}
 }
 
+// WhatsappChannelClient is a client for the WhatsappChannel schema.
+type WhatsappChannelClient struct {
+	config
+}
+
+// NewWhatsappChannelClient returns a client for the WhatsappChannel from the given config.
+func NewWhatsappChannelClient(c config) *WhatsappChannelClient {
+	return &WhatsappChannelClient{config: c}
+}
+
+// Use adds a list of mutation hooks to the hooks stack.
+// A call to `Use(f, g, h)` equals to `whatsappchannel.Hooks(f(g(h())))`.
+func (c *WhatsappChannelClient) Use(hooks ...Hook) {
+	c.hooks.WhatsappChannel = append(c.hooks.WhatsappChannel, hooks...)
+}
+
+// Intercept adds a list of query interceptors to the interceptors stack.
+// A call to `Intercept(f, g, h)` equals to `whatsappchannel.Intercept(f(g(h())))`.
+func (c *WhatsappChannelClient) Intercept(interceptors ...Interceptor) {
+	c.inters.WhatsappChannel = append(c.inters.WhatsappChannel, interceptors...)
+}
+
+// Create returns a builder for creating a WhatsappChannel entity.
+func (c *WhatsappChannelClient) Create() *WhatsappChannelCreate {
+	mutation := newWhatsappChannelMutation(c.config, OpCreate)
+	return &WhatsappChannelCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// CreateBulk returns a builder for creating a bulk of WhatsappChannel entities.
+func (c *WhatsappChannelClient) CreateBulk(builders ...*WhatsappChannelCreate) *WhatsappChannelCreateBulk {
+	return &WhatsappChannelCreateBulk{config: c.config, builders: builders}
+}
+
+// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
+// a builder and applies setFunc on it.
+func (c *WhatsappChannelClient) MapCreateBulk(slice any, setFunc func(*WhatsappChannelCreate, int)) *WhatsappChannelCreateBulk {
+	rv := reflect.ValueOf(slice)
+	if rv.Kind() != reflect.Slice {
+		return &WhatsappChannelCreateBulk{err: fmt.Errorf("calling to WhatsappChannelClient.MapCreateBulk with wrong type %T, need slice", slice)}
+	}
+	builders := make([]*WhatsappChannelCreate, rv.Len())
+	for i := 0; i < rv.Len(); i++ {
+		builders[i] = c.Create()
+		setFunc(builders[i], i)
+	}
+	return &WhatsappChannelCreateBulk{config: c.config, builders: builders}
+}
+
+// Update returns an update builder for WhatsappChannel.
+func (c *WhatsappChannelClient) Update() *WhatsappChannelUpdate {
+	mutation := newWhatsappChannelMutation(c.config, OpUpdate)
+	return &WhatsappChannelUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOne returns an update builder for the given entity.
+func (c *WhatsappChannelClient) UpdateOne(wc *WhatsappChannel) *WhatsappChannelUpdateOne {
+	mutation := newWhatsappChannelMutation(c.config, OpUpdateOne, withWhatsappChannel(wc))
+	return &WhatsappChannelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOneID returns an update builder for the given id.
+func (c *WhatsappChannelClient) UpdateOneID(id uint64) *WhatsappChannelUpdateOne {
+	mutation := newWhatsappChannelMutation(c.config, OpUpdateOne, withWhatsappChannelID(id))
+	return &WhatsappChannelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// Delete returns a delete builder for WhatsappChannel.
+func (c *WhatsappChannelClient) Delete() *WhatsappChannelDelete {
+	mutation := newWhatsappChannelMutation(c.config, OpDelete)
+	return &WhatsappChannelDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// DeleteOne returns a builder for deleting the given entity.
+func (c *WhatsappChannelClient) DeleteOne(wc *WhatsappChannel) *WhatsappChannelDeleteOne {
+	return c.DeleteOneID(wc.ID)
+}
+
+// DeleteOneID returns a builder for deleting the given entity by its id.
+func (c *WhatsappChannelClient) DeleteOneID(id uint64) *WhatsappChannelDeleteOne {
+	builder := c.Delete().Where(whatsappchannel.ID(id))
+	builder.mutation.id = &id
+	builder.mutation.op = OpDeleteOne
+	return &WhatsappChannelDeleteOne{builder}
+}
+
+// Query returns a query builder for WhatsappChannel.
+func (c *WhatsappChannelClient) Query() *WhatsappChannelQuery {
+	return &WhatsappChannelQuery{
+		config: c.config,
+		ctx:    &QueryContext{Type: TypeWhatsappChannel},
+		inters: c.Interceptors(),
+	}
+}
+
+// Get returns a WhatsappChannel entity by its id.
+func (c *WhatsappChannelClient) Get(ctx context.Context, id uint64) (*WhatsappChannel, error) {
+	return c.Query().Where(whatsappchannel.ID(id)).Only(ctx)
+}
+
+// GetX is like Get, but panics if an error occurs.
+func (c *WhatsappChannelClient) GetX(ctx context.Context, id uint64) *WhatsappChannel {
+	obj, err := c.Get(ctx, id)
+	if err != nil {
+		panic(err)
+	}
+	return obj
+}
+
+// Hooks returns the client hooks.
+func (c *WhatsappChannelClient) Hooks() []Hook {
+	hooks := c.hooks.WhatsappChannel
+	return append(hooks[:len(hooks):len(hooks)], whatsappchannel.Hooks[:]...)
+}
+
+// Interceptors returns the client interceptors.
+func (c *WhatsappChannelClient) Interceptors() []Interceptor {
+	inters := c.inters.WhatsappChannel
+	return append(inters[:len(inters):len(inters)], whatsappchannel.Interceptors[:]...)
+}
+
+func (c *WhatsappChannelClient) mutate(ctx context.Context, m *WhatsappChannelMutation) (Value, error) {
+	switch m.Op() {
+	case OpCreate:
+		return (&WhatsappChannelCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdate:
+		return (&WhatsappChannelUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdateOne:
+		return (&WhatsappChannelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpDelete, OpDeleteOne:
+		return (&WhatsappChannelDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
+	default:
+		return nil, fmt.Errorf("ent: unknown WhatsappChannel mutation op: %q", m.Op())
+	}
+}
+
 // WorkExperienceClient is a client for the WorkExperience schema.
 type WorkExperienceClient struct {
 	config
@@ -6213,8 +6356,8 @@ type (
 		Label, LabelRelationship, LabelTagging, Message, MessageRecords, Msg,
 		PayRecharge, Server, SopNode, SopStage, SopTask, Token, Tutorial, UsageDetail,
 		UsageStatisticDay, UsageStatisticHour, UsageStatisticMonth, UsageTotal,
-		Whatsapp, WorkExperience, WpChatroom, WpChatroomMember, Wx, WxCard, WxCardUser,
-		WxCardVisit []ent.Hook
+		Whatsapp, WhatsappChannel, WorkExperience, WpChatroom, WpChatroomMember, Wx,
+		WxCard, WxCardUser, WxCardVisit []ent.Hook
 	}
 	inters struct {
 		Agent, AgentBase, AliyunAvatar, AllocAgent, BatchMsg, Category, ChatRecords,
@@ -6222,8 +6365,8 @@ type (
 		Label, LabelRelationship, LabelTagging, Message, MessageRecords, Msg,
 		PayRecharge, Server, SopNode, SopStage, SopTask, Token, Tutorial, UsageDetail,
 		UsageStatisticDay, UsageStatisticHour, UsageStatisticMonth, UsageTotal,
-		Whatsapp, WorkExperience, WpChatroom, WpChatroomMember, Wx, WxCard, WxCardUser,
-		WxCardVisit []ent.Interceptor
+		Whatsapp, WhatsappChannel, WorkExperience, WpChatroom, WpChatroomMember, Wx,
+		WxCard, WxCardUser, WxCardVisit []ent.Interceptor
 	}
 )
 

+ 2 - 0
ent/ent.go

@@ -40,6 +40,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -143,6 +144,7 @@ func checkColumn(table, column string) error {
 			usagestatisticmonth.Table: usagestatisticmonth.ValidColumn,
 			usagetotal.Table:          usagetotal.ValidColumn,
 			whatsapp.Table:            whatsapp.ValidColumn,
+			whatsappchannel.Table:     whatsappchannel.ValidColumn,
 			workexperience.Table:      workexperience.ValidColumn,
 			wpchatroom.Table:          wpchatroom.ValidColumn,
 			wpchatroommember.Table:    wpchatroommember.ValidColumn,

+ 12 - 0
ent/hook/hook.go

@@ -392,6 +392,18 @@ func (f WhatsappFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er
 	return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.WhatsappMutation", m)
 }
 
+// The WhatsappChannelFunc type is an adapter to allow the use of ordinary
+// function as WhatsappChannel mutator.
+type WhatsappChannelFunc func(context.Context, *ent.WhatsappChannelMutation) (ent.Value, error)
+
+// Mutate calls f(ctx, m).
+func (f WhatsappChannelFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
+	if mv, ok := m.(*ent.WhatsappChannelMutation); ok {
+		return f(ctx, mv)
+	}
+	return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.WhatsappChannelMutation", m)
+}
+
 // The WorkExperienceFunc type is an adapter to allow the use of ordinary
 // function as WorkExperience mutator.
 type WorkExperienceFunc func(context.Context, *ent.WorkExperienceMutation) (ent.Value, error)

+ 30 - 0
ent/intercept/intercept.go

@@ -39,6 +39,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -970,6 +971,33 @@ func (f TraverseWhatsapp) Traverse(ctx context.Context, q ent.Query) error {
 	return fmt.Errorf("unexpected query type %T. expect *ent.WhatsappQuery", q)
 }
 
+// The WhatsappChannelFunc type is an adapter to allow the use of ordinary function as a Querier.
+type WhatsappChannelFunc func(context.Context, *ent.WhatsappChannelQuery) (ent.Value, error)
+
+// Query calls f(ctx, q).
+func (f WhatsappChannelFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
+	if q, ok := q.(*ent.WhatsappChannelQuery); ok {
+		return f(ctx, q)
+	}
+	return nil, fmt.Errorf("unexpected query type %T. expect *ent.WhatsappChannelQuery", q)
+}
+
+// The TraverseWhatsappChannel type is an adapter to allow the use of ordinary function as Traverser.
+type TraverseWhatsappChannel func(context.Context, *ent.WhatsappChannelQuery) error
+
+// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
+func (f TraverseWhatsappChannel) Intercept(next ent.Querier) ent.Querier {
+	return next
+}
+
+// Traverse calls f(ctx, q).
+func (f TraverseWhatsappChannel) Traverse(ctx context.Context, q ent.Query) error {
+	if q, ok := q.(*ent.WhatsappChannelQuery); ok {
+		return f(ctx, q)
+	}
+	return fmt.Errorf("unexpected query type %T. expect *ent.WhatsappChannelQuery", q)
+}
+
 // The WorkExperienceFunc type is an adapter to allow the use of ordinary function as a Querier.
 type WorkExperienceFunc func(context.Context, *ent.WorkExperienceQuery) (ent.Value, error)
 
@@ -1226,6 +1254,8 @@ func NewQuery(q ent.Query) (Query, error) {
 		return &query[*ent.UsageTotalQuery, predicate.UsageTotal, usagetotal.OrderOption]{typ: ent.TypeUsageTotal, tq: q}, nil
 	case *ent.WhatsappQuery:
 		return &query[*ent.WhatsappQuery, predicate.Whatsapp, whatsapp.OrderOption]{typ: ent.TypeWhatsapp, tq: q}, nil
+	case *ent.WhatsappChannelQuery:
+		return &query[*ent.WhatsappChannelQuery, predicate.WhatsappChannel, whatsappchannel.OrderOption]{typ: ent.TypeWhatsappChannel, tq: q}, nil
 	case *ent.WorkExperienceQuery:
 		return &query[*ent.WorkExperienceQuery, predicate.WorkExperience, workexperience.OrderOption]{typ: ent.TypeWorkExperience, tq: q}, nil
 	case *ent.WpChatroomQuery:

+ 32 - 5
ent/migrate/schema.go

@@ -1040,12 +1040,13 @@ var (
 		{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
 		{Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
 		{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
-		{Name: "ak", Type: field.TypeString, Nullable: true, Default: ""},
-		{Name: "sk", Type: field.TypeString, Default: ""},
+		{Name: "wa_id", Type: field.TypeUint64, Nullable: true, Default: 0},
 		{Name: "callback", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "account", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "nickname", Type: field.TypeString, Default: ""},
 		{Name: "phone", Type: field.TypeString, Default: ""},
+		{Name: "phone_name", Type: field.TypeString, Default: ""},
+		{Name: "phone_status", Type: field.TypeInt8, Default: 0},
 		{Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
 		{Name: "api_base", Type: field.TypeString, Nullable: true, Default: ""},
 		{Name: "api_key", Type: field.TypeString, Nullable: true, Default: ""},
@@ -1063,16 +1064,38 @@ var (
 		ForeignKeys: []*schema.ForeignKey{
 			{
 				Symbol:     "whatsapp_agent_wa_agent",
-				Columns:    []*schema.Column{WhatsappColumns[18]},
+				Columns:    []*schema.Column{WhatsappColumns[19]},
 				RefColumns: []*schema.Column{AgentColumns[0]},
 				OnDelete:   schema.NoAction,
 			},
 		},
+	}
+	// WhatsappChannelColumns holds the columns for the "whatsapp_channel" table.
+	WhatsappChannelColumns = []*schema.Column{
+		{Name: "id", Type: field.TypeUint64, Increment: true},
+		{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
+		{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
+		{Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
+		{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
+		{Name: "ak", Type: field.TypeString, Nullable: true, Default: ""},
+		{Name: "sk", Type: field.TypeString, Default: ""},
+		{Name: "wa_id", Type: field.TypeUint64, Nullable: true, Default: 0},
+		{Name: "wa_name", Type: field.TypeString, Nullable: true, Default: ""},
+		{Name: "waba_id", Type: field.TypeUint64, Default: 0},
+		{Name: "business_id", Type: field.TypeUint64, Default: 0},
+		{Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
+		{Name: "verify_account", Type: field.TypeString, Default: ""},
+	}
+	// WhatsappChannelTable holds the schema information for the "whatsapp_channel" table.
+	WhatsappChannelTable = &schema.Table{
+		Name:       "whatsapp_channel",
+		Columns:    WhatsappChannelColumns,
+		PrimaryKey: []*schema.Column{WhatsappChannelColumns[0]},
 		Indexes: []*schema.Index{
 			{
-				Name:    "whatsapp_ak_sk",
+				Name:    "whatsappchannel_ak_sk",
 				Unique:  false,
-				Columns: []*schema.Column{WhatsappColumns[5], WhatsappColumns[6]},
+				Columns: []*schema.Column{WhatsappChannelColumns[5], WhatsappChannelColumns[6]},
 			},
 		},
 	}
@@ -1371,6 +1394,7 @@ var (
 		UsageStatisticMonthTable,
 		UsageTotalTable,
 		WhatsappTable,
+		WhatsappChannelTable,
 		WorkExperienceTable,
 		WpChatroomTable,
 		WpChatroomMemberTable,
@@ -1488,6 +1512,9 @@ func init() {
 	WhatsappTable.Annotation = &entsql.Annotation{
 		Table: "whatsapp",
 	}
+	WhatsappChannelTable.Annotation = &entsql.Annotation{
+		Table: "whatsapp_channel",
+	}
 	WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
 	WorkExperienceTable.Annotation = &entsql.Annotation{
 		Table: "work_experience",

+ 1475 - 138
ent/mutation.go

@@ -42,6 +42,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -95,6 +96,7 @@ const (
 	TypeUsageStatisticMonth = "UsageStatisticMonth"
 	TypeUsageTotal          = "UsageTotal"
 	TypeWhatsapp            = "Whatsapp"
+	TypeWhatsappChannel     = "WhatsappChannel"
 	TypeWorkExperience      = "WorkExperience"
 	TypeWpChatroom          = "WpChatroom"
 	TypeWpChatroomMember    = "WpChatroomMember"
@@ -36957,12 +36959,15 @@ type WhatsappMutation struct {
 	status                 *uint8
 	addstatus              *int8
 	deleted_at             *time.Time
-	ak                     *string
-	sk                     *string
+	wa_id                  *uint64
+	addwa_id               *int64
 	callback               *string
 	account                *string
 	nickname               *string
 	phone                  *string
+	phone_name             *string
+	phone_status           *int8
+	addphone_status        *int8
 	organization_id        *uint64
 	addorganization_id     *int64
 	api_base               *string
@@ -37278,89 +37283,74 @@ func (m *WhatsappMutation) ResetDeletedAt() {
 	delete(m.clearedFields, whatsapp.FieldDeletedAt)
 }
 
-// SetAk sets the "ak" field.
-func (m *WhatsappMutation) SetAk(s string) {
-	m.ak = &s
+// SetWaID sets the "wa_id" field.
+func (m *WhatsappMutation) SetWaID(u uint64) {
+	m.wa_id = &u
+	m.addwa_id = nil
 }
 
-// Ak returns the value of the "ak" field in the mutation.
-func (m *WhatsappMutation) Ak() (r string, exists bool) {
-	v := m.ak
+// WaID returns the value of the "wa_id" field in the mutation.
+func (m *WhatsappMutation) WaID() (r uint64, exists bool) {
+	v := m.wa_id
 	if v == nil {
 		return
 	}
 	return *v, true
 }
 
-// OldAk returns the old "ak" field's value of the Whatsapp entity.
+// OldWaID returns the old "wa_id" field's value of the Whatsapp entity.
 // If the Whatsapp 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 *WhatsappMutation) OldAk(ctx context.Context) (v string, err error) {
+func (m *WhatsappMutation) OldWaID(ctx context.Context) (v uint64, err error) {
 	if !m.op.Is(OpUpdateOne) {
-		return v, errors.New("OldAk is only allowed on UpdateOne operations")
+		return v, errors.New("OldWaID is only allowed on UpdateOne operations")
 	}
 	if m.id == nil || m.oldValue == nil {
-		return v, errors.New("OldAk requires an ID field in the mutation")
+		return v, errors.New("OldWaID requires an ID field in the mutation")
 	}
 	oldValue, err := m.oldValue(ctx)
 	if err != nil {
-		return v, fmt.Errorf("querying old value for OldAk: %w", err)
+		return v, fmt.Errorf("querying old value for OldWaID: %w", err)
 	}
-	return oldValue.Ak, nil
-}
-
-// ClearAk clears the value of the "ak" field.
-func (m *WhatsappMutation) ClearAk() {
-	m.ak = nil
-	m.clearedFields[whatsapp.FieldAk] = struct{}{}
-}
-
-// AkCleared returns if the "ak" field was cleared in this mutation.
-func (m *WhatsappMutation) AkCleared() bool {
-	_, ok := m.clearedFields[whatsapp.FieldAk]
-	return ok
+	return oldValue.WaID, nil
 }
 
-// ResetAk resets all changes to the "ak" field.
-func (m *WhatsappMutation) ResetAk() {
-	m.ak = nil
-	delete(m.clearedFields, whatsapp.FieldAk)
-}
-
-// SetSk sets the "sk" field.
-func (m *WhatsappMutation) SetSk(s string) {
-	m.sk = &s
+// AddWaID adds u to the "wa_id" field.
+func (m *WhatsappMutation) AddWaID(u int64) {
+	if m.addwa_id != nil {
+		*m.addwa_id += u
+	} else {
+		m.addwa_id = &u
+	}
 }
 
-// Sk returns the value of the "sk" field in the mutation.
-func (m *WhatsappMutation) Sk() (r string, exists bool) {
-	v := m.sk
+// AddedWaID returns the value that was added to the "wa_id" field in this mutation.
+func (m *WhatsappMutation) AddedWaID() (r int64, exists bool) {
+	v := m.addwa_id
 	if v == nil {
 		return
 	}
 	return *v, true
 }
 
-// OldSk returns the old "sk" field's value of the Whatsapp entity.
-// If the Whatsapp 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 *WhatsappMutation) OldSk(ctx context.Context) (v string, err error) {
-	if !m.op.Is(OpUpdateOne) {
-		return v, errors.New("OldSk is only allowed on UpdateOne operations")
-	}
-	if m.id == nil || m.oldValue == nil {
-		return v, errors.New("OldSk requires an ID field in the mutation")
-	}
-	oldValue, err := m.oldValue(ctx)
-	if err != nil {
-		return v, fmt.Errorf("querying old value for OldSk: %w", err)
-	}
-	return oldValue.Sk, nil
+// ClearWaID clears the value of the "wa_id" field.
+func (m *WhatsappMutation) ClearWaID() {
+	m.wa_id = nil
+	m.addwa_id = nil
+	m.clearedFields[whatsapp.FieldWaID] = struct{}{}
 }
 
-// ResetSk resets all changes to the "sk" field.
-func (m *WhatsappMutation) ResetSk() {
-	m.sk = nil
+// WaIDCleared returns if the "wa_id" field was cleared in this mutation.
+func (m *WhatsappMutation) WaIDCleared() bool {
+	_, ok := m.clearedFields[whatsapp.FieldWaID]
+	return ok
+}
+
+// ResetWaID resets all changes to the "wa_id" field.
+func (m *WhatsappMutation) ResetWaID() {
+	m.wa_id = nil
+	m.addwa_id = nil
+	delete(m.clearedFields, whatsapp.FieldWaID)
 }
 
 // SetCallback sets the "callback" field.
@@ -37412,6 +37402,42 @@ func (m *WhatsappMutation) ResetCallback() {
 	delete(m.clearedFields, whatsapp.FieldCallback)
 }
 
+// SetAgentID sets the "agent_id" field.
+func (m *WhatsappMutation) SetAgentID(u uint64) {
+	m.agent = &u
+}
+
+// AgentID returns the value of the "agent_id" field in the mutation.
+func (m *WhatsappMutation) AgentID() (r uint64, exists bool) {
+	v := m.agent
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldAgentID returns the old "agent_id" field's value of the Whatsapp entity.
+// If the Whatsapp 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 *WhatsappMutation) OldAgentID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldAgentID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldAgentID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldAgentID: %w", err)
+	}
+	return oldValue.AgentID, nil
+}
+
+// ResetAgentID resets all changes to the "agent_id" field.
+func (m *WhatsappMutation) ResetAgentID() {
+	m.agent = nil
+}
+
 // SetAccount sets the "account" field.
 func (m *WhatsappMutation) SetAccount(s string) {
 	m.account = &s
@@ -37533,6 +37559,98 @@ func (m *WhatsappMutation) ResetPhone() {
 	m.phone = nil
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (m *WhatsappMutation) SetPhoneName(s string) {
+	m.phone_name = &s
+}
+
+// PhoneName returns the value of the "phone_name" field in the mutation.
+func (m *WhatsappMutation) PhoneName() (r string, exists bool) {
+	v := m.phone_name
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldPhoneName returns the old "phone_name" field's value of the Whatsapp entity.
+// If the Whatsapp 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 *WhatsappMutation) OldPhoneName(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldPhoneName is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldPhoneName requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldPhoneName: %w", err)
+	}
+	return oldValue.PhoneName, nil
+}
+
+// ResetPhoneName resets all changes to the "phone_name" field.
+func (m *WhatsappMutation) ResetPhoneName() {
+	m.phone_name = nil
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (m *WhatsappMutation) SetPhoneStatus(i int8) {
+	m.phone_status = &i
+	m.addphone_status = nil
+}
+
+// PhoneStatus returns the value of the "phone_status" field in the mutation.
+func (m *WhatsappMutation) PhoneStatus() (r int8, exists bool) {
+	v := m.phone_status
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldPhoneStatus returns the old "phone_status" field's value of the Whatsapp entity.
+// If the Whatsapp 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 *WhatsappMutation) OldPhoneStatus(ctx context.Context) (v int8, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldPhoneStatus is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldPhoneStatus requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldPhoneStatus: %w", err)
+	}
+	return oldValue.PhoneStatus, nil
+}
+
+// AddPhoneStatus adds i to the "phone_status" field.
+func (m *WhatsappMutation) AddPhoneStatus(i int8) {
+	if m.addphone_status != nil {
+		*m.addphone_status += i
+	} else {
+		m.addphone_status = &i
+	}
+}
+
+// AddedPhoneStatus returns the value that was added to the "phone_status" field in this mutation.
+func (m *WhatsappMutation) AddedPhoneStatus() (r int8, exists bool) {
+	v := m.addphone_status
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetPhoneStatus resets all changes to the "phone_status" field.
+func (m *WhatsappMutation) ResetPhoneStatus() {
+	m.phone_status = nil
+	m.addphone_status = nil
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (m *WhatsappMutation) SetOrganizationID(u uint64) {
 	m.organization_id = &u
@@ -37603,42 +37721,6 @@ func (m *WhatsappMutation) ResetOrganizationID() {
 	delete(m.clearedFields, whatsapp.FieldOrganizationID)
 }
 
-// SetAgentID sets the "agent_id" field.
-func (m *WhatsappMutation) SetAgentID(u uint64) {
-	m.agent = &u
-}
-
-// AgentID returns the value of the "agent_id" field in the mutation.
-func (m *WhatsappMutation) AgentID() (r uint64, exists bool) {
-	v := m.agent
-	if v == nil {
-		return
-	}
-	return *v, true
-}
-
-// OldAgentID returns the old "agent_id" field's value of the Whatsapp entity.
-// If the Whatsapp 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 *WhatsappMutation) OldAgentID(ctx context.Context) (v uint64, err error) {
-	if !m.op.Is(OpUpdateOne) {
-		return v, errors.New("OldAgentID is only allowed on UpdateOne operations")
-	}
-	if m.id == nil || m.oldValue == nil {
-		return v, errors.New("OldAgentID requires an ID field in the mutation")
-	}
-	oldValue, err := m.oldValue(ctx)
-	if err != nil {
-		return v, fmt.Errorf("querying old value for OldAgentID: %w", err)
-	}
-	return oldValue.AgentID, nil
-}
-
-// ResetAgentID resets all changes to the "agent_id" field.
-func (m *WhatsappMutation) ResetAgentID() {
-	m.agent = nil
-}
-
 // SetAPIBase sets the "api_base" field.
 func (m *WhatsappMutation) SetAPIBase(s string) {
 	m.api_base = &s
@@ -38058,7 +38140,7 @@ func (m *WhatsappMutation) Type() string {
 // order to get all numeric fields that were incremented/decremented, call
 // AddedFields().
 func (m *WhatsappMutation) Fields() []string {
-	fields := make([]string, 0, 18)
+	fields := make([]string, 0, 19)
 	if m.created_at != nil {
 		fields = append(fields, whatsapp.FieldCreatedAt)
 	}
@@ -38071,15 +38153,15 @@ func (m *WhatsappMutation) Fields() []string {
 	if m.deleted_at != nil {
 		fields = append(fields, whatsapp.FieldDeletedAt)
 	}
-	if m.ak != nil {
-		fields = append(fields, whatsapp.FieldAk)
-	}
-	if m.sk != nil {
-		fields = append(fields, whatsapp.FieldSk)
+	if m.wa_id != nil {
+		fields = append(fields, whatsapp.FieldWaID)
 	}
 	if m.callback != nil {
 		fields = append(fields, whatsapp.FieldCallback)
 	}
+	if m.agent != nil {
+		fields = append(fields, whatsapp.FieldAgentID)
+	}
 	if m.account != nil {
 		fields = append(fields, whatsapp.FieldAccount)
 	}
@@ -38089,12 +38171,15 @@ func (m *WhatsappMutation) Fields() []string {
 	if m.phone != nil {
 		fields = append(fields, whatsapp.FieldPhone)
 	}
+	if m.phone_name != nil {
+		fields = append(fields, whatsapp.FieldPhoneName)
+	}
+	if m.phone_status != nil {
+		fields = append(fields, whatsapp.FieldPhoneStatus)
+	}
 	if m.organization_id != nil {
 		fields = append(fields, whatsapp.FieldOrganizationID)
 	}
-	if m.agent != nil {
-		fields = append(fields, whatsapp.FieldAgentID)
-	}
 	if m.api_base != nil {
 		fields = append(fields, whatsapp.FieldAPIBase)
 	}
@@ -38129,22 +38214,24 @@ func (m *WhatsappMutation) Field(name string) (ent.Value, bool) {
 		return m.Status()
 	case whatsapp.FieldDeletedAt:
 		return m.DeletedAt()
-	case whatsapp.FieldAk:
-		return m.Ak()
-	case whatsapp.FieldSk:
-		return m.Sk()
+	case whatsapp.FieldWaID:
+		return m.WaID()
 	case whatsapp.FieldCallback:
 		return m.Callback()
+	case whatsapp.FieldAgentID:
+		return m.AgentID()
 	case whatsapp.FieldAccount:
 		return m.Account()
 	case whatsapp.FieldNickname:
 		return m.Nickname()
 	case whatsapp.FieldPhone:
 		return m.Phone()
+	case whatsapp.FieldPhoneName:
+		return m.PhoneName()
+	case whatsapp.FieldPhoneStatus:
+		return m.PhoneStatus()
 	case whatsapp.FieldOrganizationID:
 		return m.OrganizationID()
-	case whatsapp.FieldAgentID:
-		return m.AgentID()
 	case whatsapp.FieldAPIBase:
 		return m.APIBase()
 	case whatsapp.FieldAPIKey:
@@ -38174,22 +38261,24 @@ func (m *WhatsappMutation) OldField(ctx context.Context, name string) (ent.Value
 		return m.OldStatus(ctx)
 	case whatsapp.FieldDeletedAt:
 		return m.OldDeletedAt(ctx)
-	case whatsapp.FieldAk:
-		return m.OldAk(ctx)
-	case whatsapp.FieldSk:
-		return m.OldSk(ctx)
+	case whatsapp.FieldWaID:
+		return m.OldWaID(ctx)
 	case whatsapp.FieldCallback:
 		return m.OldCallback(ctx)
+	case whatsapp.FieldAgentID:
+		return m.OldAgentID(ctx)
 	case whatsapp.FieldAccount:
 		return m.OldAccount(ctx)
 	case whatsapp.FieldNickname:
 		return m.OldNickname(ctx)
 	case whatsapp.FieldPhone:
 		return m.OldPhone(ctx)
+	case whatsapp.FieldPhoneName:
+		return m.OldPhoneName(ctx)
+	case whatsapp.FieldPhoneStatus:
+		return m.OldPhoneStatus(ctx)
 	case whatsapp.FieldOrganizationID:
 		return m.OldOrganizationID(ctx)
-	case whatsapp.FieldAgentID:
-		return m.OldAgentID(ctx)
 	case whatsapp.FieldAPIBase:
 		return m.OldAPIBase(ctx)
 	case whatsapp.FieldAPIKey:
@@ -38239,26 +38328,26 @@ func (m *WhatsappMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetDeletedAt(v)
 		return nil
-	case whatsapp.FieldAk:
-		v, ok := value.(string)
+	case whatsapp.FieldWaID:
+		v, ok := value.(uint64)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}
-		m.SetAk(v)
+		m.SetWaID(v)
 		return nil
-	case whatsapp.FieldSk:
+	case whatsapp.FieldCallback:
 		v, ok := value.(string)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}
-		m.SetSk(v)
+		m.SetCallback(v)
 		return nil
-	case whatsapp.FieldCallback:
-		v, ok := value.(string)
+	case whatsapp.FieldAgentID:
+		v, ok := value.(uint64)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}
-		m.SetCallback(v)
+		m.SetAgentID(v)
 		return nil
 	case whatsapp.FieldAccount:
 		v, ok := value.(string)
@@ -38281,19 +38370,26 @@ func (m *WhatsappMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetPhone(v)
 		return nil
-	case whatsapp.FieldOrganizationID:
-		v, ok := value.(uint64)
+	case whatsapp.FieldPhoneName:
+		v, ok := value.(string)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}
-		m.SetOrganizationID(v)
+		m.SetPhoneName(v)
 		return nil
-	case whatsapp.FieldAgentID:
+	case whatsapp.FieldPhoneStatus:
+		v, ok := value.(int8)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetPhoneStatus(v)
+		return nil
+	case whatsapp.FieldOrganizationID:
 		v, ok := value.(uint64)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}
-		m.SetAgentID(v)
+		m.SetOrganizationID(v)
 		return nil
 	case whatsapp.FieldAPIBase:
 		v, ok := value.(string)
@@ -38348,6 +38444,12 @@ func (m *WhatsappMutation) AddedFields() []string {
 	if m.addstatus != nil {
 		fields = append(fields, whatsapp.FieldStatus)
 	}
+	if m.addwa_id != nil {
+		fields = append(fields, whatsapp.FieldWaID)
+	}
+	if m.addphone_status != nil {
+		fields = append(fields, whatsapp.FieldPhoneStatus)
+	}
 	if m.addorganization_id != nil {
 		fields = append(fields, whatsapp.FieldOrganizationID)
 	}
@@ -38361,6 +38463,10 @@ func (m *WhatsappMutation) AddedField(name string) (ent.Value, bool) {
 	switch name {
 	case whatsapp.FieldStatus:
 		return m.AddedStatus()
+	case whatsapp.FieldWaID:
+		return m.AddedWaID()
+	case whatsapp.FieldPhoneStatus:
+		return m.AddedPhoneStatus()
 	case whatsapp.FieldOrganizationID:
 		return m.AddedOrganizationID()
 	}
@@ -38379,6 +38485,20 @@ func (m *WhatsappMutation) AddField(name string, value ent.Value) error {
 		}
 		m.AddStatus(v)
 		return nil
+	case whatsapp.FieldWaID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddWaID(v)
+		return nil
+	case whatsapp.FieldPhoneStatus:
+		v, ok := value.(int8)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddPhoneStatus(v)
+		return nil
 	case whatsapp.FieldOrganizationID:
 		v, ok := value.(int64)
 		if !ok {
@@ -38400,8 +38520,8 @@ func (m *WhatsappMutation) ClearedFields() []string {
 	if m.FieldCleared(whatsapp.FieldDeletedAt) {
 		fields = append(fields, whatsapp.FieldDeletedAt)
 	}
-	if m.FieldCleared(whatsapp.FieldAk) {
-		fields = append(fields, whatsapp.FieldAk)
+	if m.FieldCleared(whatsapp.FieldWaID) {
+		fields = append(fields, whatsapp.FieldWaID)
 	}
 	if m.FieldCleared(whatsapp.FieldCallback) {
 		fields = append(fields, whatsapp.FieldCallback)
@@ -38450,8 +38570,8 @@ func (m *WhatsappMutation) ClearField(name string) error {
 	case whatsapp.FieldDeletedAt:
 		m.ClearDeletedAt()
 		return nil
-	case whatsapp.FieldAk:
-		m.ClearAk()
+	case whatsapp.FieldWaID:
+		m.ClearWaID()
 		return nil
 	case whatsapp.FieldCallback:
 		m.ClearCallback()
@@ -38500,15 +38620,15 @@ func (m *WhatsappMutation) ResetField(name string) error {
 	case whatsapp.FieldDeletedAt:
 		m.ResetDeletedAt()
 		return nil
-	case whatsapp.FieldAk:
-		m.ResetAk()
-		return nil
-	case whatsapp.FieldSk:
-		m.ResetSk()
+	case whatsapp.FieldWaID:
+		m.ResetWaID()
 		return nil
 	case whatsapp.FieldCallback:
 		m.ResetCallback()
 		return nil
+	case whatsapp.FieldAgentID:
+		m.ResetAgentID()
+		return nil
 	case whatsapp.FieldAccount:
 		m.ResetAccount()
 		return nil
@@ -38518,12 +38638,15 @@ func (m *WhatsappMutation) ResetField(name string) error {
 	case whatsapp.FieldPhone:
 		m.ResetPhone()
 		return nil
+	case whatsapp.FieldPhoneName:
+		m.ResetPhoneName()
+		return nil
+	case whatsapp.FieldPhoneStatus:
+		m.ResetPhoneStatus()
+		return nil
 	case whatsapp.FieldOrganizationID:
 		m.ResetOrganizationID()
 		return nil
-	case whatsapp.FieldAgentID:
-		m.ResetAgentID()
-		return nil
 	case whatsapp.FieldAPIBase:
 		m.ResetAPIBase()
 		return nil
@@ -38620,6 +38743,1220 @@ func (m *WhatsappMutation) ResetEdge(name string) error {
 	return fmt.Errorf("unknown Whatsapp edge %s", name)
 }
 
+// WhatsappChannelMutation represents an operation that mutates the WhatsappChannel nodes in the graph.
+type WhatsappChannelMutation struct {
+	config
+	op                 Op
+	typ                string
+	id                 *uint64
+	created_at         *time.Time
+	updated_at         *time.Time
+	status             *uint8
+	addstatus          *int8
+	deleted_at         *time.Time
+	ak                 *string
+	sk                 *string
+	wa_id              *uint64
+	addwa_id           *int64
+	wa_name            *string
+	waba_id            *uint64
+	addwaba_id         *int64
+	business_id        *uint64
+	addbusiness_id     *int64
+	organization_id    *uint64
+	addorganization_id *int64
+	verify_account     *string
+	clearedFields      map[string]struct{}
+	done               bool
+	oldValue           func(context.Context) (*WhatsappChannel, error)
+	predicates         []predicate.WhatsappChannel
+}
+
+var _ ent.Mutation = (*WhatsappChannelMutation)(nil)
+
+// whatsappchannelOption allows management of the mutation configuration using functional options.
+type whatsappchannelOption func(*WhatsappChannelMutation)
+
+// newWhatsappChannelMutation creates new mutation for the WhatsappChannel entity.
+func newWhatsappChannelMutation(c config, op Op, opts ...whatsappchannelOption) *WhatsappChannelMutation {
+	m := &WhatsappChannelMutation{
+		config:        c,
+		op:            op,
+		typ:           TypeWhatsappChannel,
+		clearedFields: make(map[string]struct{}),
+	}
+	for _, opt := range opts {
+		opt(m)
+	}
+	return m
+}
+
+// withWhatsappChannelID sets the ID field of the mutation.
+func withWhatsappChannelID(id uint64) whatsappchannelOption {
+	return func(m *WhatsappChannelMutation) {
+		var (
+			err   error
+			once  sync.Once
+			value *WhatsappChannel
+		)
+		m.oldValue = func(ctx context.Context) (*WhatsappChannel, error) {
+			once.Do(func() {
+				if m.done {
+					err = errors.New("querying old values post mutation is not allowed")
+				} else {
+					value, err = m.Client().WhatsappChannel.Get(ctx, id)
+				}
+			})
+			return value, err
+		}
+		m.id = &id
+	}
+}
+
+// withWhatsappChannel sets the old WhatsappChannel of the mutation.
+func withWhatsappChannel(node *WhatsappChannel) whatsappchannelOption {
+	return func(m *WhatsappChannelMutation) {
+		m.oldValue = func(context.Context) (*WhatsappChannel, error) {
+			return node, nil
+		}
+		m.id = &node.ID
+	}
+}
+
+// Client returns a new `ent.Client` from the mutation. If the mutation was
+// executed in a transaction (ent.Tx), a transactional client is returned.
+func (m WhatsappChannelMutation) Client() *Client {
+	client := &Client{config: m.config}
+	client.init()
+	return client
+}
+
+// Tx returns an `ent.Tx` for mutations that were executed in transactions;
+// it returns an error otherwise.
+func (m WhatsappChannelMutation) Tx() (*Tx, error) {
+	if _, ok := m.driver.(*txDriver); !ok {
+		return nil, errors.New("ent: mutation is not running in a transaction")
+	}
+	tx := &Tx{config: m.config}
+	tx.init()
+	return tx, nil
+}
+
+// SetID sets the value of the id field. Note that this
+// operation is only accepted on creation of WhatsappChannel entities.
+func (m *WhatsappChannelMutation) SetID(id uint64) {
+	m.id = &id
+}
+
+// ID returns the ID value in the mutation. Note that the ID is only available
+// if it was provided to the builder or after it was returned from the database.
+func (m *WhatsappChannelMutation) ID() (id uint64, exists bool) {
+	if m.id == nil {
+		return
+	}
+	return *m.id, true
+}
+
+// IDs queries the database and returns the entity ids that match the mutation's predicate.
+// That means, if the mutation is applied within a transaction with an isolation level such
+// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
+// or updated by the mutation.
+func (m *WhatsappChannelMutation) IDs(ctx context.Context) ([]uint64, error) {
+	switch {
+	case m.op.Is(OpUpdateOne | OpDeleteOne):
+		id, exists := m.ID()
+		if exists {
+			return []uint64{id}, nil
+		}
+		fallthrough
+	case m.op.Is(OpUpdate | OpDelete):
+		return m.Client().WhatsappChannel.Query().Where(m.predicates...).IDs(ctx)
+	default:
+		return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
+	}
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (m *WhatsappChannelMutation) SetCreatedAt(t time.Time) {
+	m.created_at = &t
+}
+
+// CreatedAt returns the value of the "created_at" field in the mutation.
+func (m *WhatsappChannelMutation) CreatedAt() (r time.Time, exists bool) {
+	v := m.created_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldCreatedAt returns the old "created_at" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldCreatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
+	}
+	return oldValue.CreatedAt, nil
+}
+
+// ResetCreatedAt resets all changes to the "created_at" field.
+func (m *WhatsappChannelMutation) ResetCreatedAt() {
+	m.created_at = nil
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (m *WhatsappChannelMutation) SetUpdatedAt(t time.Time) {
+	m.updated_at = &t
+}
+
+// UpdatedAt returns the value of the "updated_at" field in the mutation.
+func (m *WhatsappChannelMutation) UpdatedAt() (r time.Time, exists bool) {
+	v := m.updated_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldUpdatedAt returns the old "updated_at" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
+	}
+	return oldValue.UpdatedAt, nil
+}
+
+// ResetUpdatedAt resets all changes to the "updated_at" field.
+func (m *WhatsappChannelMutation) ResetUpdatedAt() {
+	m.updated_at = nil
+}
+
+// SetStatus sets the "status" field.
+func (m *WhatsappChannelMutation) SetStatus(u uint8) {
+	m.status = &u
+	m.addstatus = nil
+}
+
+// Status returns the value of the "status" field in the mutation.
+func (m *WhatsappChannelMutation) Status() (r uint8, exists bool) {
+	v := m.status
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldStatus returns the old "status" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldStatus(ctx context.Context) (v uint8, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldStatus is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldStatus requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldStatus: %w", err)
+	}
+	return oldValue.Status, nil
+}
+
+// AddStatus adds u to the "status" field.
+func (m *WhatsappChannelMutation) AddStatus(u int8) {
+	if m.addstatus != nil {
+		*m.addstatus += u
+	} else {
+		m.addstatus = &u
+	}
+}
+
+// AddedStatus returns the value that was added to the "status" field in this mutation.
+func (m *WhatsappChannelMutation) AddedStatus() (r int8, exists bool) {
+	v := m.addstatus
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ClearStatus clears the value of the "status" field.
+func (m *WhatsappChannelMutation) ClearStatus() {
+	m.status = nil
+	m.addstatus = nil
+	m.clearedFields[whatsappchannel.FieldStatus] = struct{}{}
+}
+
+// StatusCleared returns if the "status" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) StatusCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldStatus]
+	return ok
+}
+
+// ResetStatus resets all changes to the "status" field.
+func (m *WhatsappChannelMutation) ResetStatus() {
+	m.status = nil
+	m.addstatus = nil
+	delete(m.clearedFields, whatsappchannel.FieldStatus)
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (m *WhatsappChannelMutation) SetDeletedAt(t time.Time) {
+	m.deleted_at = &t
+}
+
+// DeletedAt returns the value of the "deleted_at" field in the mutation.
+func (m *WhatsappChannelMutation) DeletedAt() (r time.Time, exists bool) {
+	v := m.deleted_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldDeletedAt returns the old "deleted_at" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldDeletedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err)
+	}
+	return oldValue.DeletedAt, nil
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (m *WhatsappChannelMutation) ClearDeletedAt() {
+	m.deleted_at = nil
+	m.clearedFields[whatsappchannel.FieldDeletedAt] = struct{}{}
+}
+
+// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) DeletedAtCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldDeletedAt]
+	return ok
+}
+
+// ResetDeletedAt resets all changes to the "deleted_at" field.
+func (m *WhatsappChannelMutation) ResetDeletedAt() {
+	m.deleted_at = nil
+	delete(m.clearedFields, whatsappchannel.FieldDeletedAt)
+}
+
+// SetAk sets the "ak" field.
+func (m *WhatsappChannelMutation) SetAk(s string) {
+	m.ak = &s
+}
+
+// Ak returns the value of the "ak" field in the mutation.
+func (m *WhatsappChannelMutation) Ak() (r string, exists bool) {
+	v := m.ak
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldAk returns the old "ak" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldAk(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldAk is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldAk requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldAk: %w", err)
+	}
+	return oldValue.Ak, nil
+}
+
+// ClearAk clears the value of the "ak" field.
+func (m *WhatsappChannelMutation) ClearAk() {
+	m.ak = nil
+	m.clearedFields[whatsappchannel.FieldAk] = struct{}{}
+}
+
+// AkCleared returns if the "ak" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) AkCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldAk]
+	return ok
+}
+
+// ResetAk resets all changes to the "ak" field.
+func (m *WhatsappChannelMutation) ResetAk() {
+	m.ak = nil
+	delete(m.clearedFields, whatsappchannel.FieldAk)
+}
+
+// SetSk sets the "sk" field.
+func (m *WhatsappChannelMutation) SetSk(s string) {
+	m.sk = &s
+}
+
+// Sk returns the value of the "sk" field in the mutation.
+func (m *WhatsappChannelMutation) Sk() (r string, exists bool) {
+	v := m.sk
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldSk returns the old "sk" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldSk(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldSk is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldSk requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldSk: %w", err)
+	}
+	return oldValue.Sk, nil
+}
+
+// ResetSk resets all changes to the "sk" field.
+func (m *WhatsappChannelMutation) ResetSk() {
+	m.sk = nil
+}
+
+// SetWaID sets the "wa_id" field.
+func (m *WhatsappChannelMutation) SetWaID(u uint64) {
+	m.wa_id = &u
+	m.addwa_id = nil
+}
+
+// WaID returns the value of the "wa_id" field in the mutation.
+func (m *WhatsappChannelMutation) WaID() (r uint64, exists bool) {
+	v := m.wa_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldWaID returns the old "wa_id" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldWaID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldWaID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldWaID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldWaID: %w", err)
+	}
+	return oldValue.WaID, nil
+}
+
+// AddWaID adds u to the "wa_id" field.
+func (m *WhatsappChannelMutation) AddWaID(u int64) {
+	if m.addwa_id != nil {
+		*m.addwa_id += u
+	} else {
+		m.addwa_id = &u
+	}
+}
+
+// AddedWaID returns the value that was added to the "wa_id" field in this mutation.
+func (m *WhatsappChannelMutation) AddedWaID() (r int64, exists bool) {
+	v := m.addwa_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (m *WhatsappChannelMutation) ClearWaID() {
+	m.wa_id = nil
+	m.addwa_id = nil
+	m.clearedFields[whatsappchannel.FieldWaID] = struct{}{}
+}
+
+// WaIDCleared returns if the "wa_id" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) WaIDCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldWaID]
+	return ok
+}
+
+// ResetWaID resets all changes to the "wa_id" field.
+func (m *WhatsappChannelMutation) ResetWaID() {
+	m.wa_id = nil
+	m.addwa_id = nil
+	delete(m.clearedFields, whatsappchannel.FieldWaID)
+}
+
+// SetWaName sets the "wa_name" field.
+func (m *WhatsappChannelMutation) SetWaName(s string) {
+	m.wa_name = &s
+}
+
+// WaName returns the value of the "wa_name" field in the mutation.
+func (m *WhatsappChannelMutation) WaName() (r string, exists bool) {
+	v := m.wa_name
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldWaName returns the old "wa_name" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldWaName(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldWaName is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldWaName requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldWaName: %w", err)
+	}
+	return oldValue.WaName, nil
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (m *WhatsappChannelMutation) ClearWaName() {
+	m.wa_name = nil
+	m.clearedFields[whatsappchannel.FieldWaName] = struct{}{}
+}
+
+// WaNameCleared returns if the "wa_name" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) WaNameCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldWaName]
+	return ok
+}
+
+// ResetWaName resets all changes to the "wa_name" field.
+func (m *WhatsappChannelMutation) ResetWaName() {
+	m.wa_name = nil
+	delete(m.clearedFields, whatsappchannel.FieldWaName)
+}
+
+// SetWabaID sets the "waba_id" field.
+func (m *WhatsappChannelMutation) SetWabaID(u uint64) {
+	m.waba_id = &u
+	m.addwaba_id = nil
+}
+
+// WabaID returns the value of the "waba_id" field in the mutation.
+func (m *WhatsappChannelMutation) WabaID() (r uint64, exists bool) {
+	v := m.waba_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldWabaID returns the old "waba_id" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldWabaID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldWabaID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldWabaID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldWabaID: %w", err)
+	}
+	return oldValue.WabaID, nil
+}
+
+// AddWabaID adds u to the "waba_id" field.
+func (m *WhatsappChannelMutation) AddWabaID(u int64) {
+	if m.addwaba_id != nil {
+		*m.addwaba_id += u
+	} else {
+		m.addwaba_id = &u
+	}
+}
+
+// AddedWabaID returns the value that was added to the "waba_id" field in this mutation.
+func (m *WhatsappChannelMutation) AddedWabaID() (r int64, exists bool) {
+	v := m.addwaba_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetWabaID resets all changes to the "waba_id" field.
+func (m *WhatsappChannelMutation) ResetWabaID() {
+	m.waba_id = nil
+	m.addwaba_id = nil
+}
+
+// SetBusinessID sets the "business_id" field.
+func (m *WhatsappChannelMutation) SetBusinessID(u uint64) {
+	m.business_id = &u
+	m.addbusiness_id = nil
+}
+
+// BusinessID returns the value of the "business_id" field in the mutation.
+func (m *WhatsappChannelMutation) BusinessID() (r uint64, exists bool) {
+	v := m.business_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldBusinessID returns the old "business_id" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldBusinessID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldBusinessID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldBusinessID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldBusinessID: %w", err)
+	}
+	return oldValue.BusinessID, nil
+}
+
+// AddBusinessID adds u to the "business_id" field.
+func (m *WhatsappChannelMutation) AddBusinessID(u int64) {
+	if m.addbusiness_id != nil {
+		*m.addbusiness_id += u
+	} else {
+		m.addbusiness_id = &u
+	}
+}
+
+// AddedBusinessID returns the value that was added to the "business_id" field in this mutation.
+func (m *WhatsappChannelMutation) AddedBusinessID() (r int64, exists bool) {
+	v := m.addbusiness_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetBusinessID resets all changes to the "business_id" field.
+func (m *WhatsappChannelMutation) ResetBusinessID() {
+	m.business_id = nil
+	m.addbusiness_id = nil
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (m *WhatsappChannelMutation) SetOrganizationID(u uint64) {
+	m.organization_id = &u
+	m.addorganization_id = nil
+}
+
+// OrganizationID returns the value of the "organization_id" field in the mutation.
+func (m *WhatsappChannelMutation) OrganizationID() (r uint64, exists bool) {
+	v := m.organization_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldOrganizationID returns the old "organization_id" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldOrganizationID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldOrganizationID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err)
+	}
+	return oldValue.OrganizationID, nil
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (m *WhatsappChannelMutation) AddOrganizationID(u int64) {
+	if m.addorganization_id != nil {
+		*m.addorganization_id += u
+	} else {
+		m.addorganization_id = &u
+	}
+}
+
+// AddedOrganizationID returns the value that was added to the "organization_id" field in this mutation.
+func (m *WhatsappChannelMutation) AddedOrganizationID() (r int64, exists bool) {
+	v := m.addorganization_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (m *WhatsappChannelMutation) ClearOrganizationID() {
+	m.organization_id = nil
+	m.addorganization_id = nil
+	m.clearedFields[whatsappchannel.FieldOrganizationID] = struct{}{}
+}
+
+// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation.
+func (m *WhatsappChannelMutation) OrganizationIDCleared() bool {
+	_, ok := m.clearedFields[whatsappchannel.FieldOrganizationID]
+	return ok
+}
+
+// ResetOrganizationID resets all changes to the "organization_id" field.
+func (m *WhatsappChannelMutation) ResetOrganizationID() {
+	m.organization_id = nil
+	m.addorganization_id = nil
+	delete(m.clearedFields, whatsappchannel.FieldOrganizationID)
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (m *WhatsappChannelMutation) SetVerifyAccount(s string) {
+	m.verify_account = &s
+}
+
+// VerifyAccount returns the value of the "verify_account" field in the mutation.
+func (m *WhatsappChannelMutation) VerifyAccount() (r string, exists bool) {
+	v := m.verify_account
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldVerifyAccount returns the old "verify_account" field's value of the WhatsappChannel entity.
+// If the WhatsappChannel 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 *WhatsappChannelMutation) OldVerifyAccount(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldVerifyAccount is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldVerifyAccount requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldVerifyAccount: %w", err)
+	}
+	return oldValue.VerifyAccount, nil
+}
+
+// ResetVerifyAccount resets all changes to the "verify_account" field.
+func (m *WhatsappChannelMutation) ResetVerifyAccount() {
+	m.verify_account = nil
+}
+
+// Where appends a list predicates to the WhatsappChannelMutation builder.
+func (m *WhatsappChannelMutation) Where(ps ...predicate.WhatsappChannel) {
+	m.predicates = append(m.predicates, ps...)
+}
+
+// WhereP appends storage-level predicates to the WhatsappChannelMutation builder. Using this method,
+// users can use type-assertion to append predicates that do not depend on any generated package.
+func (m *WhatsappChannelMutation) WhereP(ps ...func(*sql.Selector)) {
+	p := make([]predicate.WhatsappChannel, len(ps))
+	for i := range ps {
+		p[i] = ps[i]
+	}
+	m.Where(p...)
+}
+
+// Op returns the operation name.
+func (m *WhatsappChannelMutation) Op() Op {
+	return m.op
+}
+
+// SetOp allows setting the mutation operation.
+func (m *WhatsappChannelMutation) SetOp(op Op) {
+	m.op = op
+}
+
+// Type returns the node type of this mutation (WhatsappChannel).
+func (m *WhatsappChannelMutation) Type() string {
+	return m.typ
+}
+
+// Fields returns all fields that were changed during this mutation. Note that in
+// order to get all numeric fields that were incremented/decremented, call
+// AddedFields().
+func (m *WhatsappChannelMutation) Fields() []string {
+	fields := make([]string, 0, 12)
+	if m.created_at != nil {
+		fields = append(fields, whatsappchannel.FieldCreatedAt)
+	}
+	if m.updated_at != nil {
+		fields = append(fields, whatsappchannel.FieldUpdatedAt)
+	}
+	if m.status != nil {
+		fields = append(fields, whatsappchannel.FieldStatus)
+	}
+	if m.deleted_at != nil {
+		fields = append(fields, whatsappchannel.FieldDeletedAt)
+	}
+	if m.ak != nil {
+		fields = append(fields, whatsappchannel.FieldAk)
+	}
+	if m.sk != nil {
+		fields = append(fields, whatsappchannel.FieldSk)
+	}
+	if m.wa_id != nil {
+		fields = append(fields, whatsappchannel.FieldWaID)
+	}
+	if m.wa_name != nil {
+		fields = append(fields, whatsappchannel.FieldWaName)
+	}
+	if m.waba_id != nil {
+		fields = append(fields, whatsappchannel.FieldWabaID)
+	}
+	if m.business_id != nil {
+		fields = append(fields, whatsappchannel.FieldBusinessID)
+	}
+	if m.organization_id != nil {
+		fields = append(fields, whatsappchannel.FieldOrganizationID)
+	}
+	if m.verify_account != nil {
+		fields = append(fields, whatsappchannel.FieldVerifyAccount)
+	}
+	return fields
+}
+
+// Field returns the value of a field with the given name. The second boolean
+// return value indicates that this field was not set, or was not defined in the
+// schema.
+func (m *WhatsappChannelMutation) Field(name string) (ent.Value, bool) {
+	switch name {
+	case whatsappchannel.FieldCreatedAt:
+		return m.CreatedAt()
+	case whatsappchannel.FieldUpdatedAt:
+		return m.UpdatedAt()
+	case whatsappchannel.FieldStatus:
+		return m.Status()
+	case whatsappchannel.FieldDeletedAt:
+		return m.DeletedAt()
+	case whatsappchannel.FieldAk:
+		return m.Ak()
+	case whatsappchannel.FieldSk:
+		return m.Sk()
+	case whatsappchannel.FieldWaID:
+		return m.WaID()
+	case whatsappchannel.FieldWaName:
+		return m.WaName()
+	case whatsappchannel.FieldWabaID:
+		return m.WabaID()
+	case whatsappchannel.FieldBusinessID:
+		return m.BusinessID()
+	case whatsappchannel.FieldOrganizationID:
+		return m.OrganizationID()
+	case whatsappchannel.FieldVerifyAccount:
+		return m.VerifyAccount()
+	}
+	return nil, false
+}
+
+// OldField returns the old value of the field from the database. An error is
+// returned if the mutation operation is not UpdateOne, or the query to the
+// database failed.
+func (m *WhatsappChannelMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
+	switch name {
+	case whatsappchannel.FieldCreatedAt:
+		return m.OldCreatedAt(ctx)
+	case whatsappchannel.FieldUpdatedAt:
+		return m.OldUpdatedAt(ctx)
+	case whatsappchannel.FieldStatus:
+		return m.OldStatus(ctx)
+	case whatsappchannel.FieldDeletedAt:
+		return m.OldDeletedAt(ctx)
+	case whatsappchannel.FieldAk:
+		return m.OldAk(ctx)
+	case whatsappchannel.FieldSk:
+		return m.OldSk(ctx)
+	case whatsappchannel.FieldWaID:
+		return m.OldWaID(ctx)
+	case whatsappchannel.FieldWaName:
+		return m.OldWaName(ctx)
+	case whatsappchannel.FieldWabaID:
+		return m.OldWabaID(ctx)
+	case whatsappchannel.FieldBusinessID:
+		return m.OldBusinessID(ctx)
+	case whatsappchannel.FieldOrganizationID:
+		return m.OldOrganizationID(ctx)
+	case whatsappchannel.FieldVerifyAccount:
+		return m.OldVerifyAccount(ctx)
+	}
+	return nil, fmt.Errorf("unknown WhatsappChannel field %s", name)
+}
+
+// SetField sets the value of a field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *WhatsappChannelMutation) SetField(name string, value ent.Value) error {
+	switch name {
+	case whatsappchannel.FieldCreatedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetCreatedAt(v)
+		return nil
+	case whatsappchannel.FieldUpdatedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetUpdatedAt(v)
+		return nil
+	case whatsappchannel.FieldStatus:
+		v, ok := value.(uint8)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetStatus(v)
+		return nil
+	case whatsappchannel.FieldDeletedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetDeletedAt(v)
+		return nil
+	case whatsappchannel.FieldAk:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetAk(v)
+		return nil
+	case whatsappchannel.FieldSk:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetSk(v)
+		return nil
+	case whatsappchannel.FieldWaID:
+		v, ok := value.(uint64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetWaID(v)
+		return nil
+	case whatsappchannel.FieldWaName:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetWaName(v)
+		return nil
+	case whatsappchannel.FieldWabaID:
+		v, ok := value.(uint64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetWabaID(v)
+		return nil
+	case whatsappchannel.FieldBusinessID:
+		v, ok := value.(uint64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetBusinessID(v)
+		return nil
+	case whatsappchannel.FieldOrganizationID:
+		v, ok := value.(uint64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetOrganizationID(v)
+		return nil
+	case whatsappchannel.FieldVerifyAccount:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetVerifyAccount(v)
+		return nil
+	}
+	return fmt.Errorf("unknown WhatsappChannel field %s", name)
+}
+
+// AddedFields returns all numeric fields that were incremented/decremented during
+// this mutation.
+func (m *WhatsappChannelMutation) AddedFields() []string {
+	var fields []string
+	if m.addstatus != nil {
+		fields = append(fields, whatsappchannel.FieldStatus)
+	}
+	if m.addwa_id != nil {
+		fields = append(fields, whatsappchannel.FieldWaID)
+	}
+	if m.addwaba_id != nil {
+		fields = append(fields, whatsappchannel.FieldWabaID)
+	}
+	if m.addbusiness_id != nil {
+		fields = append(fields, whatsappchannel.FieldBusinessID)
+	}
+	if m.addorganization_id != nil {
+		fields = append(fields, whatsappchannel.FieldOrganizationID)
+	}
+	return fields
+}
+
+// AddedField returns the numeric value that was incremented/decremented on a field
+// with the given name. The second boolean return value indicates that this field
+// was not set, or was not defined in the schema.
+func (m *WhatsappChannelMutation) AddedField(name string) (ent.Value, bool) {
+	switch name {
+	case whatsappchannel.FieldStatus:
+		return m.AddedStatus()
+	case whatsappchannel.FieldWaID:
+		return m.AddedWaID()
+	case whatsappchannel.FieldWabaID:
+		return m.AddedWabaID()
+	case whatsappchannel.FieldBusinessID:
+		return m.AddedBusinessID()
+	case whatsappchannel.FieldOrganizationID:
+		return m.AddedOrganizationID()
+	}
+	return nil, false
+}
+
+// AddField adds the value to the field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *WhatsappChannelMutation) AddField(name string, value ent.Value) error {
+	switch name {
+	case whatsappchannel.FieldStatus:
+		v, ok := value.(int8)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddStatus(v)
+		return nil
+	case whatsappchannel.FieldWaID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddWaID(v)
+		return nil
+	case whatsappchannel.FieldWabaID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddWabaID(v)
+		return nil
+	case whatsappchannel.FieldBusinessID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddBusinessID(v)
+		return nil
+	case whatsappchannel.FieldOrganizationID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddOrganizationID(v)
+		return nil
+	}
+	return fmt.Errorf("unknown WhatsappChannel numeric field %s", name)
+}
+
+// ClearedFields returns all nullable fields that were cleared during this
+// mutation.
+func (m *WhatsappChannelMutation) ClearedFields() []string {
+	var fields []string
+	if m.FieldCleared(whatsappchannel.FieldStatus) {
+		fields = append(fields, whatsappchannel.FieldStatus)
+	}
+	if m.FieldCleared(whatsappchannel.FieldDeletedAt) {
+		fields = append(fields, whatsappchannel.FieldDeletedAt)
+	}
+	if m.FieldCleared(whatsappchannel.FieldAk) {
+		fields = append(fields, whatsappchannel.FieldAk)
+	}
+	if m.FieldCleared(whatsappchannel.FieldWaID) {
+		fields = append(fields, whatsappchannel.FieldWaID)
+	}
+	if m.FieldCleared(whatsappchannel.FieldWaName) {
+		fields = append(fields, whatsappchannel.FieldWaName)
+	}
+	if m.FieldCleared(whatsappchannel.FieldOrganizationID) {
+		fields = append(fields, whatsappchannel.FieldOrganizationID)
+	}
+	return fields
+}
+
+// FieldCleared returns a boolean indicating if a field with the given name was
+// cleared in this mutation.
+func (m *WhatsappChannelMutation) FieldCleared(name string) bool {
+	_, ok := m.clearedFields[name]
+	return ok
+}
+
+// ClearField clears the value of the field with the given name. It returns an
+// error if the field is not defined in the schema.
+func (m *WhatsappChannelMutation) ClearField(name string) error {
+	switch name {
+	case whatsappchannel.FieldStatus:
+		m.ClearStatus()
+		return nil
+	case whatsappchannel.FieldDeletedAt:
+		m.ClearDeletedAt()
+		return nil
+	case whatsappchannel.FieldAk:
+		m.ClearAk()
+		return nil
+	case whatsappchannel.FieldWaID:
+		m.ClearWaID()
+		return nil
+	case whatsappchannel.FieldWaName:
+		m.ClearWaName()
+		return nil
+	case whatsappchannel.FieldOrganizationID:
+		m.ClearOrganizationID()
+		return nil
+	}
+	return fmt.Errorf("unknown WhatsappChannel nullable field %s", name)
+}
+
+// ResetField resets all changes in the mutation for the field with the given name.
+// It returns an error if the field is not defined in the schema.
+func (m *WhatsappChannelMutation) ResetField(name string) error {
+	switch name {
+	case whatsappchannel.FieldCreatedAt:
+		m.ResetCreatedAt()
+		return nil
+	case whatsappchannel.FieldUpdatedAt:
+		m.ResetUpdatedAt()
+		return nil
+	case whatsappchannel.FieldStatus:
+		m.ResetStatus()
+		return nil
+	case whatsappchannel.FieldDeletedAt:
+		m.ResetDeletedAt()
+		return nil
+	case whatsappchannel.FieldAk:
+		m.ResetAk()
+		return nil
+	case whatsappchannel.FieldSk:
+		m.ResetSk()
+		return nil
+	case whatsappchannel.FieldWaID:
+		m.ResetWaID()
+		return nil
+	case whatsappchannel.FieldWaName:
+		m.ResetWaName()
+		return nil
+	case whatsappchannel.FieldWabaID:
+		m.ResetWabaID()
+		return nil
+	case whatsappchannel.FieldBusinessID:
+		m.ResetBusinessID()
+		return nil
+	case whatsappchannel.FieldOrganizationID:
+		m.ResetOrganizationID()
+		return nil
+	case whatsappchannel.FieldVerifyAccount:
+		m.ResetVerifyAccount()
+		return nil
+	}
+	return fmt.Errorf("unknown WhatsappChannel field %s", name)
+}
+
+// AddedEdges returns all edge names that were set/added in this mutation.
+func (m *WhatsappChannelMutation) AddedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// AddedIDs returns all IDs (to other nodes) that were added for the given edge
+// name in this mutation.
+func (m *WhatsappChannelMutation) AddedIDs(name string) []ent.Value {
+	return nil
+}
+
+// RemovedEdges returns all edge names that were removed in this mutation.
+func (m *WhatsappChannelMutation) RemovedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
+// the given name in this mutation.
+func (m *WhatsappChannelMutation) RemovedIDs(name string) []ent.Value {
+	return nil
+}
+
+// ClearedEdges returns all edge names that were cleared in this mutation.
+func (m *WhatsappChannelMutation) ClearedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// EdgeCleared returns a boolean which indicates if the edge with the given name
+// was cleared in this mutation.
+func (m *WhatsappChannelMutation) EdgeCleared(name string) bool {
+	return false
+}
+
+// ClearEdge clears the value of the edge with the given name. It returns an error
+// if that edge is not defined in the schema.
+func (m *WhatsappChannelMutation) ClearEdge(name string) error {
+	return fmt.Errorf("unknown WhatsappChannel unique edge %s", name)
+}
+
+// ResetEdge resets all changes to the edge with the given name in this mutation.
+// It returns an error if the edge is not defined in the schema.
+func (m *WhatsappChannelMutation) ResetEdge(name string) error {
+	return fmt.Errorf("unknown WhatsappChannel edge %s", name)
+}
+
 // WorkExperienceMutation represents an operation that mutates the WorkExperience nodes in the graph.
 type WorkExperienceMutation struct {
 	config

+ 82 - 0
ent/pagination.go

@@ -37,6 +37,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -2684,6 +2685,87 @@ func (w *WhatsappQuery) Page(
 	return ret, nil
 }
 
+type WhatsappChannelPager struct {
+	Order  whatsappchannel.OrderOption
+	Filter func(*WhatsappChannelQuery) (*WhatsappChannelQuery, error)
+}
+
+// WhatsappChannelPaginateOption enables pagination customization.
+type WhatsappChannelPaginateOption func(*WhatsappChannelPager)
+
+// DefaultWhatsappChannelOrder is the default ordering of WhatsappChannel.
+var DefaultWhatsappChannelOrder = Desc(whatsappchannel.FieldID)
+
+func newWhatsappChannelPager(opts []WhatsappChannelPaginateOption) (*WhatsappChannelPager, error) {
+	pager := &WhatsappChannelPager{}
+	for _, opt := range opts {
+		opt(pager)
+	}
+	if pager.Order == nil {
+		pager.Order = DefaultWhatsappChannelOrder
+	}
+	return pager, nil
+}
+
+func (p *WhatsappChannelPager) ApplyFilter(query *WhatsappChannelQuery) (*WhatsappChannelQuery, error) {
+	if p.Filter != nil {
+		return p.Filter(query)
+	}
+	return query, nil
+}
+
+// WhatsappChannelPageList is WhatsappChannel PageList result.
+type WhatsappChannelPageList struct {
+	List        []*WhatsappChannel `json:"list"`
+	PageDetails *PageDetails       `json:"pageDetails"`
+}
+
+func (wc *WhatsappChannelQuery) Page(
+	ctx context.Context, pageNum uint64, pageSize uint64, opts ...WhatsappChannelPaginateOption,
+) (*WhatsappChannelPageList, error) {
+
+	pager, err := newWhatsappChannelPager(opts)
+	if err != nil {
+		return nil, err
+	}
+
+	if wc, err = pager.ApplyFilter(wc); err != nil {
+		return nil, err
+	}
+
+	ret := &WhatsappChannelPageList{}
+
+	ret.PageDetails = &PageDetails{
+		Page: pageNum,
+		Size: pageSize,
+	}
+
+	query := wc.Clone()
+	query.ctx.Fields = nil
+	count, err := query.Count(ctx)
+
+	if err != nil {
+		return nil, err
+	}
+
+	ret.PageDetails.Total = uint64(count)
+
+	if pager.Order != nil {
+		wc = wc.Order(pager.Order)
+	} else {
+		wc = wc.Order(DefaultWhatsappChannelOrder)
+	}
+
+	wc = wc.Offset(int((pageNum - 1) * pageSize)).Limit(int(pageSize))
+	list, err := wc.All(ctx)
+	if err != nil {
+		return nil, err
+	}
+	ret.List = list
+
+	return ret, nil
+}
+
 type WorkExperiencePager struct {
 	Order  workexperience.OrderOption
 	Filter func(*WorkExperienceQuery) (*WorkExperienceQuery, error)

+ 3 - 0
ent/predicate/predicate.go

@@ -102,6 +102,9 @@ type UsageTotal func(*sql.Selector)
 // Whatsapp is the predicate function for whatsapp builders.
 type Whatsapp func(*sql.Selector)
 
+// WhatsappChannel is the predicate function for whatsappchannel builders.
+type WhatsappChannel func(*sql.Selector)
+
 // WorkExperience is the predicate function for workexperience builders.
 type WorkExperience func(*sql.Selector)
 

+ 78 - 16
ent/runtime/runtime.go

@@ -37,6 +37,7 @@ import (
 	"wechat-api/ent/usagestatisticmonth"
 	"wechat-api/ent/usagetotal"
 	"wechat-api/ent/whatsapp"
+	"wechat-api/ent/whatsappchannel"
 	"wechat-api/ent/workexperience"
 	"wechat-api/ent/wpchatroom"
 	"wechat-api/ent/wpchatroommember"
@@ -1296,18 +1297,18 @@ func init() {
 	whatsappDescStatus := whatsappMixinFields1[0].Descriptor()
 	// whatsapp.DefaultStatus holds the default value on creation for the status field.
 	whatsapp.DefaultStatus = whatsappDescStatus.Default.(uint8)
-	// whatsappDescAk is the schema descriptor for ak field.
-	whatsappDescAk := whatsappFields[0].Descriptor()
-	// whatsapp.DefaultAk holds the default value on creation for the ak field.
-	whatsapp.DefaultAk = whatsappDescAk.Default.(string)
-	// whatsappDescSk is the schema descriptor for sk field.
-	whatsappDescSk := whatsappFields[1].Descriptor()
-	// whatsapp.DefaultSk holds the default value on creation for the sk field.
-	whatsapp.DefaultSk = whatsappDescSk.Default.(string)
+	// whatsappDescWaID is the schema descriptor for wa_id field.
+	whatsappDescWaID := whatsappFields[0].Descriptor()
+	// whatsapp.DefaultWaID holds the default value on creation for the wa_id field.
+	whatsapp.DefaultWaID = whatsappDescWaID.Default.(uint64)
 	// whatsappDescCallback is the schema descriptor for callback field.
-	whatsappDescCallback := whatsappFields[2].Descriptor()
+	whatsappDescCallback := whatsappFields[1].Descriptor()
 	// whatsapp.DefaultCallback holds the default value on creation for the callback field.
 	whatsapp.DefaultCallback = whatsappDescCallback.Default.(string)
+	// whatsappDescAgentID is the schema descriptor for agent_id field.
+	whatsappDescAgentID := whatsappFields[2].Descriptor()
+	// whatsapp.DefaultAgentID holds the default value on creation for the agent_id field.
+	whatsapp.DefaultAgentID = whatsappDescAgentID.Default.(uint64)
 	// whatsappDescAccount is the schema descriptor for account field.
 	whatsappDescAccount := whatsappFields[3].Descriptor()
 	// whatsapp.DefaultAccount holds the default value on creation for the account field.
@@ -1320,22 +1321,83 @@ func init() {
 	whatsappDescPhone := whatsappFields[5].Descriptor()
 	// whatsapp.DefaultPhone holds the default value on creation for the phone field.
 	whatsapp.DefaultPhone = whatsappDescPhone.Default.(string)
+	// whatsappDescPhoneName is the schema descriptor for phone_name field.
+	whatsappDescPhoneName := whatsappFields[6].Descriptor()
+	// whatsapp.DefaultPhoneName holds the default value on creation for the phone_name field.
+	whatsapp.DefaultPhoneName = whatsappDescPhoneName.Default.(string)
+	// whatsappDescPhoneStatus is the schema descriptor for phone_status field.
+	whatsappDescPhoneStatus := whatsappFields[7].Descriptor()
+	// whatsapp.DefaultPhoneStatus holds the default value on creation for the phone_status field.
+	whatsapp.DefaultPhoneStatus = whatsappDescPhoneStatus.Default.(int8)
 	// whatsappDescOrganizationID is the schema descriptor for organization_id field.
-	whatsappDescOrganizationID := whatsappFields[6].Descriptor()
+	whatsappDescOrganizationID := whatsappFields[8].Descriptor()
 	// whatsapp.DefaultOrganizationID holds the default value on creation for the organization_id field.
 	whatsapp.DefaultOrganizationID = whatsappDescOrganizationID.Default.(uint64)
-	// whatsappDescAgentID is the schema descriptor for agent_id field.
-	whatsappDescAgentID := whatsappFields[7].Descriptor()
-	// whatsapp.DefaultAgentID holds the default value on creation for the agent_id field.
-	whatsapp.DefaultAgentID = whatsappDescAgentID.Default.(uint64)
 	// whatsappDescAPIBase is the schema descriptor for api_base field.
-	whatsappDescAPIBase := whatsappFields[8].Descriptor()
+	whatsappDescAPIBase := whatsappFields[9].Descriptor()
 	// whatsapp.DefaultAPIBase holds the default value on creation for the api_base field.
 	whatsapp.DefaultAPIBase = whatsappDescAPIBase.Default.(string)
 	// whatsappDescAPIKey is the schema descriptor for api_key field.
-	whatsappDescAPIKey := whatsappFields[9].Descriptor()
+	whatsappDescAPIKey := whatsappFields[10].Descriptor()
 	// whatsapp.DefaultAPIKey holds the default value on creation for the api_key field.
 	whatsapp.DefaultAPIKey = whatsappDescAPIKey.Default.(string)
+	whatsappchannelMixin := schema.WhatsappChannel{}.Mixin()
+	whatsappchannelMixinHooks2 := whatsappchannelMixin[2].Hooks()
+	whatsappchannel.Hooks[0] = whatsappchannelMixinHooks2[0]
+	whatsappchannelMixinInters2 := whatsappchannelMixin[2].Interceptors()
+	whatsappchannel.Interceptors[0] = whatsappchannelMixinInters2[0]
+	whatsappchannelMixinFields0 := whatsappchannelMixin[0].Fields()
+	_ = whatsappchannelMixinFields0
+	whatsappchannelMixinFields1 := whatsappchannelMixin[1].Fields()
+	_ = whatsappchannelMixinFields1
+	whatsappchannelFields := schema.WhatsappChannel{}.Fields()
+	_ = whatsappchannelFields
+	// whatsappchannelDescCreatedAt is the schema descriptor for created_at field.
+	whatsappchannelDescCreatedAt := whatsappchannelMixinFields0[1].Descriptor()
+	// whatsappchannel.DefaultCreatedAt holds the default value on creation for the created_at field.
+	whatsappchannel.DefaultCreatedAt = whatsappchannelDescCreatedAt.Default.(func() time.Time)
+	// whatsappchannelDescUpdatedAt is the schema descriptor for updated_at field.
+	whatsappchannelDescUpdatedAt := whatsappchannelMixinFields0[2].Descriptor()
+	// whatsappchannel.DefaultUpdatedAt holds the default value on creation for the updated_at field.
+	whatsappchannel.DefaultUpdatedAt = whatsappchannelDescUpdatedAt.Default.(func() time.Time)
+	// whatsappchannel.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
+	whatsappchannel.UpdateDefaultUpdatedAt = whatsappchannelDescUpdatedAt.UpdateDefault.(func() time.Time)
+	// whatsappchannelDescStatus is the schema descriptor for status field.
+	whatsappchannelDescStatus := whatsappchannelMixinFields1[0].Descriptor()
+	// whatsappchannel.DefaultStatus holds the default value on creation for the status field.
+	whatsappchannel.DefaultStatus = whatsappchannelDescStatus.Default.(uint8)
+	// whatsappchannelDescAk is the schema descriptor for ak field.
+	whatsappchannelDescAk := whatsappchannelFields[0].Descriptor()
+	// whatsappchannel.DefaultAk holds the default value on creation for the ak field.
+	whatsappchannel.DefaultAk = whatsappchannelDescAk.Default.(string)
+	// whatsappchannelDescSk is the schema descriptor for sk field.
+	whatsappchannelDescSk := whatsappchannelFields[1].Descriptor()
+	// whatsappchannel.DefaultSk holds the default value on creation for the sk field.
+	whatsappchannel.DefaultSk = whatsappchannelDescSk.Default.(string)
+	// whatsappchannelDescWaID is the schema descriptor for wa_id field.
+	whatsappchannelDescWaID := whatsappchannelFields[2].Descriptor()
+	// whatsappchannel.DefaultWaID holds the default value on creation for the wa_id field.
+	whatsappchannel.DefaultWaID = whatsappchannelDescWaID.Default.(uint64)
+	// whatsappchannelDescWaName is the schema descriptor for wa_name field.
+	whatsappchannelDescWaName := whatsappchannelFields[3].Descriptor()
+	// whatsappchannel.DefaultWaName holds the default value on creation for the wa_name field.
+	whatsappchannel.DefaultWaName = whatsappchannelDescWaName.Default.(string)
+	// whatsappchannelDescWabaID is the schema descriptor for waba_id field.
+	whatsappchannelDescWabaID := whatsappchannelFields[4].Descriptor()
+	// whatsappchannel.DefaultWabaID holds the default value on creation for the waba_id field.
+	whatsappchannel.DefaultWabaID = whatsappchannelDescWabaID.Default.(uint64)
+	// whatsappchannelDescBusinessID is the schema descriptor for business_id field.
+	whatsappchannelDescBusinessID := whatsappchannelFields[5].Descriptor()
+	// whatsappchannel.DefaultBusinessID holds the default value on creation for the business_id field.
+	whatsappchannel.DefaultBusinessID = whatsappchannelDescBusinessID.Default.(uint64)
+	// whatsappchannelDescOrganizationID is the schema descriptor for organization_id field.
+	whatsappchannelDescOrganizationID := whatsappchannelFields[6].Descriptor()
+	// whatsappchannel.DefaultOrganizationID holds the default value on creation for the organization_id field.
+	whatsappchannel.DefaultOrganizationID = whatsappchannelDescOrganizationID.Default.(uint64)
+	// whatsappchannelDescVerifyAccount is the schema descriptor for verify_account field.
+	whatsappchannelDescVerifyAccount := whatsappchannelFields[7].Descriptor()
+	// whatsappchannel.DefaultVerifyAccount holds the default value on creation for the verify_account field.
+	whatsappchannel.DefaultVerifyAccount = whatsappchannelDescVerifyAccount.Default.(string)
 	workexperienceMixin := schema.WorkExperience{}.Mixin()
 	workexperienceMixinHooks1 := workexperienceMixin[1].Hooks()
 	workexperience.Hooks[0] = workexperienceMixinHooks1[0]

+ 8 - 8
ent/schema/whatsapp.go

@@ -8,7 +8,6 @@ import (
 	"entgo.io/ent/dialect/entsql"
 	"entgo.io/ent/schema"
 	"entgo.io/ent/schema/field"
-	"entgo.io/ent/schema/index"
 	"github.com/suyuan32/simple-admin-common/orm/ent/mixins"
 )
 
@@ -18,15 +17,18 @@ type Whatsapp struct {
 
 func (Whatsapp) Fields() []ent.Field {
 	return []ent.Field{
-		field.String("ak").Optional().Default("").Comment("ak"),
-		field.String("sk").Default("").Comment("端口号"),
+		field.Uint64("wa_id").Optional().Default(0).Comment("通道ID"),
 		field.String("callback").Optional().Default("").Comment("回调地址"),
+		field.Uint64("agent_id").Default(0).Comment("AI角色ID"),
 		field.String("account").Optional().Default("").Comment("微信账号"),
 		field.String("nickname").Default("").Comment("昵称"),
 		field.String("phone").Default("").Comment("手机号"),
+		field.String("phone_name").Default("").Comment("号码名称"),
+		field.Int8("phone_status").Default(0).Comment("号码状态"),
 		field.Uint64("organization_id").Optional().Default(0).Comment("机构 ID"),
-		field.Uint64("agent_id").Default(0).Comment("模式ID"),
-		field.String("api_base").Optional().Default("").Comment("大模型服务地址"),
+		//field.Uint64("tokens").Default(0).Comment("令牌用量"),
+		//field.Uint64("frequency").Optional().Default(0).Comment("限制频率"),
+		field.String("api_base").Optional().Default("").Comment("大模型服务账号"),
 		field.String("api_key").Optional().Default("").Comment("大模型服务密钥"),
 		field.JSON("allow_list", []string{}).Optional().Comment("白名单"),
 		field.JSON("group_allow_list", []string{}).Optional().Comment("群白名单"),
@@ -44,9 +46,7 @@ func (Whatsapp) Mixin() []ent.Mixin {
 }
 
 func (Whatsapp) Indexes() []ent.Index {
-	return []ent.Index{
-		index.Fields("ak", "sk"),
-	}
+	return []ent.Index{}
 }
 
 func (Whatsapp) Edges() []ent.Edge {

+ 53 - 0
ent/schema/whatsapp_channel.go

@@ -0,0 +1,53 @@
+package schema
+
+import (
+	"wechat-api/ent/schema/localmixin"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/entsql"
+	"entgo.io/ent/schema"
+	"entgo.io/ent/schema/field"
+	"entgo.io/ent/schema/index"
+	"github.com/suyuan32/simple-admin-common/orm/ent/mixins"
+)
+
+type WhatsappChannel struct {
+	ent.Schema
+}
+
+func (WhatsappChannel) Fields() []ent.Field {
+	return []ent.Field{
+		field.String("ak").Optional().Default("").Comment("ak"),
+		field.String("sk").Default("").Comment("端口号"),
+		field.Uint64("wa_id").Optional().Default(0).Comment("通道ID"),
+		field.String("wa_name").Optional().Default("").Comment("通道名"),
+		field.Uint64("waba_id").Default(0).Comment("WABA ID"),
+		field.Uint64("business_id").Default(0).Comment("商业平台ID"),
+		field.Uint64("organization_id").Optional().Default(0).Comment("机构 ID"),
+		field.String("verify_account").Default("").Comment("认证主体"),
+	}
+}
+
+func (WhatsappChannel) Mixin() []ent.Mixin {
+	return []ent.Mixin{
+		mixins.IDMixin{},
+		mixins.StatusMixin{},
+		localmixin.SoftDeleteMixin{},
+	}
+}
+
+func (WhatsappChannel) Indexes() []ent.Index {
+	return []ent.Index{
+		index.Fields("ak", "sk"),
+	}
+}
+
+func (WhatsappChannel) Edges() []ent.Edge {
+	return []ent.Edge{}
+}
+
+func (WhatsappChannel) Annotations() []schema.Annotation {
+	return []schema.Annotation{
+		entsql.Annotation{Table: "whatsapp_channel"},
+	}
+}

+ 318 - 30
ent/set_not_nil.go

@@ -7832,73 +7832,73 @@ func (w *WhatsappCreate) SetNotNilDeletedAt(value *time.Time) *WhatsappCreate {
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdate) SetNotNilAk(value *string) *WhatsappUpdate {
+func (w *WhatsappUpdate) SetNotNilWaID(value *uint64) *WhatsappUpdate {
 	if value != nil {
-		return w.SetAk(*value)
+		return w.SetWaID(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdateOne) SetNotNilAk(value *string) *WhatsappUpdateOne {
+func (w *WhatsappUpdateOne) SetNotNilWaID(value *uint64) *WhatsappUpdateOne {
 	if value != nil {
-		return w.SetAk(*value)
+		return w.SetWaID(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappCreate) SetNotNilAk(value *string) *WhatsappCreate {
+func (w *WhatsappCreate) SetNotNilWaID(value *uint64) *WhatsappCreate {
 	if value != nil {
-		return w.SetAk(*value)
+		return w.SetWaID(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdate) SetNotNilSk(value *string) *WhatsappUpdate {
+func (w *WhatsappUpdate) SetNotNilCallback(value *string) *WhatsappUpdate {
 	if value != nil {
-		return w.SetSk(*value)
+		return w.SetCallback(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdateOne) SetNotNilSk(value *string) *WhatsappUpdateOne {
+func (w *WhatsappUpdateOne) SetNotNilCallback(value *string) *WhatsappUpdateOne {
 	if value != nil {
-		return w.SetSk(*value)
+		return w.SetCallback(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappCreate) SetNotNilSk(value *string) *WhatsappCreate {
+func (w *WhatsappCreate) SetNotNilCallback(value *string) *WhatsappCreate {
 	if value != nil {
-		return w.SetSk(*value)
+		return w.SetCallback(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdate) SetNotNilCallback(value *string) *WhatsappUpdate {
+func (w *WhatsappUpdate) SetNotNilAgentID(value *uint64) *WhatsappUpdate {
 	if value != nil {
-		return w.SetCallback(*value)
+		return w.SetAgentID(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdateOne) SetNotNilCallback(value *string) *WhatsappUpdateOne {
+func (w *WhatsappUpdateOne) SetNotNilAgentID(value *uint64) *WhatsappUpdateOne {
 	if value != nil {
-		return w.SetCallback(*value)
+		return w.SetAgentID(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappCreate) SetNotNilCallback(value *string) *WhatsappCreate {
+func (w *WhatsappCreate) SetNotNilAgentID(value *uint64) *WhatsappCreate {
 	if value != nil {
-		return w.SetCallback(*value)
+		return w.SetAgentID(*value)
 	}
 	return w
 }
@@ -7976,49 +7976,73 @@ func (w *WhatsappCreate) SetNotNilPhone(value *string) *WhatsappCreate {
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdate) SetNotNilOrganizationID(value *uint64) *WhatsappUpdate {
+func (w *WhatsappUpdate) SetNotNilPhoneName(value *string) *WhatsappUpdate {
 	if value != nil {
-		return w.SetOrganizationID(*value)
+		return w.SetPhoneName(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdateOne) SetNotNilOrganizationID(value *uint64) *WhatsappUpdateOne {
+func (w *WhatsappUpdateOne) SetNotNilPhoneName(value *string) *WhatsappUpdateOne {
 	if value != nil {
-		return w.SetOrganizationID(*value)
+		return w.SetPhoneName(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappCreate) SetNotNilOrganizationID(value *uint64) *WhatsappCreate {
+func (w *WhatsappCreate) SetNotNilPhoneName(value *string) *WhatsappCreate {
 	if value != nil {
-		return w.SetOrganizationID(*value)
+		return w.SetPhoneName(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdate) SetNotNilAgentID(value *uint64) *WhatsappUpdate {
+func (w *WhatsappUpdate) SetNotNilPhoneStatus(value *int8) *WhatsappUpdate {
 	if value != nil {
-		return w.SetAgentID(*value)
+		return w.SetPhoneStatus(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappUpdateOne) SetNotNilAgentID(value *uint64) *WhatsappUpdateOne {
+func (w *WhatsappUpdateOne) SetNotNilPhoneStatus(value *int8) *WhatsappUpdateOne {
 	if value != nil {
-		return w.SetAgentID(*value)
+		return w.SetPhoneStatus(*value)
 	}
 	return w
 }
 
 // set field if value's pointer is not nil.
-func (w *WhatsappCreate) SetNotNilAgentID(value *uint64) *WhatsappCreate {
+func (w *WhatsappCreate) SetNotNilPhoneStatus(value *int8) *WhatsappCreate {
 	if value != nil {
-		return w.SetAgentID(*value)
+		return w.SetPhoneStatus(*value)
+	}
+	return w
+}
+
+// set field if value's pointer is not nil.
+func (w *WhatsappUpdate) SetNotNilOrganizationID(value *uint64) *WhatsappUpdate {
+	if value != nil {
+		return w.SetOrganizationID(*value)
+	}
+	return w
+}
+
+// set field if value's pointer is not nil.
+func (w *WhatsappUpdateOne) SetNotNilOrganizationID(value *uint64) *WhatsappUpdateOne {
+	if value != nil {
+		return w.SetOrganizationID(*value)
+	}
+	return w
+}
+
+// set field if value's pointer is not nil.
+func (w *WhatsappCreate) SetNotNilOrganizationID(value *uint64) *WhatsappCreate {
+	if value != nil {
+		return w.SetOrganizationID(*value)
 	}
 	return w
 }
@@ -8168,6 +8192,270 @@ func (w *WhatsappCreate) SetNotNilGroupBlockList(value []string) *WhatsappCreate
 }
 
 // set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilUpdatedAt(value *time.Time) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetUpdatedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilUpdatedAt(value *time.Time) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetUpdatedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilUpdatedAt(value *time.Time) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetUpdatedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilStatus(value *uint8) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetStatus(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilStatus(value *uint8) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetStatus(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilStatus(value *uint8) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetStatus(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilDeletedAt(value *time.Time) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetDeletedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilDeletedAt(value *time.Time) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetDeletedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilDeletedAt(value *time.Time) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetDeletedAt(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilAk(value *string) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetAk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilAk(value *string) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetAk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilAk(value *string) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetAk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilSk(value *string) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetSk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilSk(value *string) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetSk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilSk(value *string) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetSk(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilWaID(value *uint64) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetWaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilWaID(value *uint64) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetWaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilWaID(value *uint64) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetWaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilWaName(value *string) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetWaName(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilWaName(value *string) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetWaName(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilWaName(value *string) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetWaName(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilWabaID(value *uint64) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetWabaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilWabaID(value *uint64) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetWabaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilWabaID(value *uint64) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetWabaID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilBusinessID(value *uint64) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetBusinessID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilBusinessID(value *uint64) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetBusinessID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilBusinessID(value *uint64) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetBusinessID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilOrganizationID(value *uint64) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetOrganizationID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilOrganizationID(value *uint64) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetOrganizationID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilOrganizationID(value *uint64) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetOrganizationID(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdate) SetNotNilVerifyAccount(value *string) *WhatsappChannelUpdate {
+	if value != nil {
+		return wc.SetVerifyAccount(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelUpdateOne) SetNotNilVerifyAccount(value *string) *WhatsappChannelUpdateOne {
+	if value != nil {
+		return wc.SetVerifyAccount(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
+func (wc *WhatsappChannelCreate) SetNotNilVerifyAccount(value *string) *WhatsappChannelCreate {
+	if value != nil {
+		return wc.SetVerifyAccount(*value)
+	}
+	return wc
+}
+
+// set field if value's pointer is not nil.
 func (we *WorkExperienceUpdate) SetNotNilUpdatedAt(value *time.Time) *WorkExperienceUpdate {
 	if value != nil {
 		return we.SetUpdatedAt(*value)

+ 3 - 0
ent/tx.go

@@ -78,6 +78,8 @@ type Tx struct {
 	UsageTotal *UsageTotalClient
 	// Whatsapp is the client for interacting with the Whatsapp builders.
 	Whatsapp *WhatsappClient
+	// WhatsappChannel is the client for interacting with the WhatsappChannel builders.
+	WhatsappChannel *WhatsappChannelClient
 	// WorkExperience is the client for interacting with the WorkExperience builders.
 	WorkExperience *WorkExperienceClient
 	// WpChatroom is the client for interacting with the WpChatroom builders.
@@ -255,6 +257,7 @@ func (tx *Tx) init() {
 	tx.UsageStatisticMonth = NewUsageStatisticMonthClient(tx.config)
 	tx.UsageTotal = NewUsageTotalClient(tx.config)
 	tx.Whatsapp = NewWhatsappClient(tx.config)
+	tx.WhatsappChannel = NewWhatsappChannelClient(tx.config)
 	tx.WorkExperience = NewWorkExperienceClient(tx.config)
 	tx.WpChatroom = NewWpChatroomClient(tx.config)
 	tx.WpChatroomMember = NewWpChatroomMemberClient(tx.config)

+ 44 - 33
ent/whatsapp.go

@@ -27,23 +27,25 @@ type Whatsapp struct {
 	Status uint8 `json:"status,omitempty"`
 	// Delete Time | 删除日期
 	DeletedAt time.Time `json:"deleted_at,omitempty"`
-	// ak
-	Ak string `json:"ak,omitempty"`
-	// 端口号
-	Sk string `json:"sk,omitempty"`
+	// 通道ID
+	WaID uint64 `json:"wa_id,omitempty"`
 	// 回调地址
 	Callback string `json:"callback,omitempty"`
+	// AI角色ID
+	AgentID uint64 `json:"agent_id,omitempty"`
 	// 微信账号
 	Account string `json:"account,omitempty"`
 	// 昵称
 	Nickname string `json:"nickname,omitempty"`
 	// 手机号
 	Phone string `json:"phone,omitempty"`
+	// 号码名称
+	PhoneName string `json:"phone_name,omitempty"`
+	// 号码状态
+	PhoneStatus int8 `json:"phone_status,omitempty"`
 	// 机构 ID
 	OrganizationID uint64 `json:"organization_id,omitempty"`
-	// 模式ID
-	AgentID uint64 `json:"agent_id,omitempty"`
-	// 大模型服务地址
+	// 大模型服务账号
 	APIBase string `json:"api_base,omitempty"`
 	// 大模型服务密钥
 	APIKey string `json:"api_key,omitempty"`
@@ -88,9 +90,9 @@ func (*Whatsapp) scanValues(columns []string) ([]any, error) {
 		switch columns[i] {
 		case whatsapp.FieldAllowList, whatsapp.FieldGroupAllowList, whatsapp.FieldBlockList, whatsapp.FieldGroupBlockList:
 			values[i] = new([]byte)
-		case whatsapp.FieldID, whatsapp.FieldStatus, whatsapp.FieldOrganizationID, whatsapp.FieldAgentID:
+		case whatsapp.FieldID, whatsapp.FieldStatus, whatsapp.FieldWaID, whatsapp.FieldAgentID, whatsapp.FieldPhoneStatus, whatsapp.FieldOrganizationID:
 			values[i] = new(sql.NullInt64)
-		case whatsapp.FieldAk, whatsapp.FieldSk, whatsapp.FieldCallback, whatsapp.FieldAccount, whatsapp.FieldNickname, whatsapp.FieldPhone, whatsapp.FieldAPIBase, whatsapp.FieldAPIKey:
+		case whatsapp.FieldCallback, whatsapp.FieldAccount, whatsapp.FieldNickname, whatsapp.FieldPhone, whatsapp.FieldPhoneName, whatsapp.FieldAPIBase, whatsapp.FieldAPIKey:
 			values[i] = new(sql.NullString)
 		case whatsapp.FieldCreatedAt, whatsapp.FieldUpdatedAt, whatsapp.FieldDeletedAt:
 			values[i] = new(sql.NullTime)
@@ -139,17 +141,11 @@ func (w *Whatsapp) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				w.DeletedAt = value.Time
 			}
-		case whatsapp.FieldAk:
-			if value, ok := values[i].(*sql.NullString); !ok {
-				return fmt.Errorf("unexpected type %T for field ak", values[i])
-			} else if value.Valid {
-				w.Ak = value.String
-			}
-		case whatsapp.FieldSk:
-			if value, ok := values[i].(*sql.NullString); !ok {
-				return fmt.Errorf("unexpected type %T for field sk", values[i])
+		case whatsapp.FieldWaID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field wa_id", values[i])
 			} else if value.Valid {
-				w.Sk = value.String
+				w.WaID = uint64(value.Int64)
 			}
 		case whatsapp.FieldCallback:
 			if value, ok := values[i].(*sql.NullString); !ok {
@@ -157,6 +153,12 @@ func (w *Whatsapp) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				w.Callback = value.String
 			}
+		case whatsapp.FieldAgentID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field agent_id", values[i])
+			} else if value.Valid {
+				w.AgentID = uint64(value.Int64)
+			}
 		case whatsapp.FieldAccount:
 			if value, ok := values[i].(*sql.NullString); !ok {
 				return fmt.Errorf("unexpected type %T for field account", values[i])
@@ -175,17 +177,23 @@ func (w *Whatsapp) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				w.Phone = value.String
 			}
-		case whatsapp.FieldOrganizationID:
+		case whatsapp.FieldPhoneName:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field phone_name", values[i])
+			} else if value.Valid {
+				w.PhoneName = value.String
+			}
+		case whatsapp.FieldPhoneStatus:
 			if value, ok := values[i].(*sql.NullInt64); !ok {
-				return fmt.Errorf("unexpected type %T for field organization_id", values[i])
+				return fmt.Errorf("unexpected type %T for field phone_status", values[i])
 			} else if value.Valid {
-				w.OrganizationID = uint64(value.Int64)
+				w.PhoneStatus = int8(value.Int64)
 			}
-		case whatsapp.FieldAgentID:
+		case whatsapp.FieldOrganizationID:
 			if value, ok := values[i].(*sql.NullInt64); !ok {
-				return fmt.Errorf("unexpected type %T for field agent_id", values[i])
+				return fmt.Errorf("unexpected type %T for field organization_id", values[i])
 			} else if value.Valid {
-				w.AgentID = uint64(value.Int64)
+				w.OrganizationID = uint64(value.Int64)
 			}
 		case whatsapp.FieldAPIBase:
 			if value, ok := values[i].(*sql.NullString); !ok {
@@ -284,15 +292,15 @@ func (w *Whatsapp) String() string {
 	builder.WriteString("deleted_at=")
 	builder.WriteString(w.DeletedAt.Format(time.ANSIC))
 	builder.WriteString(", ")
-	builder.WriteString("ak=")
-	builder.WriteString(w.Ak)
-	builder.WriteString(", ")
-	builder.WriteString("sk=")
-	builder.WriteString(w.Sk)
+	builder.WriteString("wa_id=")
+	builder.WriteString(fmt.Sprintf("%v", w.WaID))
 	builder.WriteString(", ")
 	builder.WriteString("callback=")
 	builder.WriteString(w.Callback)
 	builder.WriteString(", ")
+	builder.WriteString("agent_id=")
+	builder.WriteString(fmt.Sprintf("%v", w.AgentID))
+	builder.WriteString(", ")
 	builder.WriteString("account=")
 	builder.WriteString(w.Account)
 	builder.WriteString(", ")
@@ -302,12 +310,15 @@ func (w *Whatsapp) String() string {
 	builder.WriteString("phone=")
 	builder.WriteString(w.Phone)
 	builder.WriteString(", ")
+	builder.WriteString("phone_name=")
+	builder.WriteString(w.PhoneName)
+	builder.WriteString(", ")
+	builder.WriteString("phone_status=")
+	builder.WriteString(fmt.Sprintf("%v", w.PhoneStatus))
+	builder.WriteString(", ")
 	builder.WriteString("organization_id=")
 	builder.WriteString(fmt.Sprintf("%v", w.OrganizationID))
 	builder.WriteString(", ")
-	builder.WriteString("agent_id=")
-	builder.WriteString(fmt.Sprintf("%v", w.AgentID))
-	builder.WriteString(", ")
 	builder.WriteString("api_base=")
 	builder.WriteString(w.APIBase)
 	builder.WriteString(", ")

+ 38 - 28
ent/whatsapp/whatsapp.go

@@ -23,22 +23,24 @@ const (
 	FieldStatus = "status"
 	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
 	FieldDeletedAt = "deleted_at"
-	// FieldAk holds the string denoting the ak field in the database.
-	FieldAk = "ak"
-	// FieldSk holds the string denoting the sk field in the database.
-	FieldSk = "sk"
+	// FieldWaID holds the string denoting the wa_id field in the database.
+	FieldWaID = "wa_id"
 	// FieldCallback holds the string denoting the callback field in the database.
 	FieldCallback = "callback"
+	// FieldAgentID holds the string denoting the agent_id field in the database.
+	FieldAgentID = "agent_id"
 	// FieldAccount holds the string denoting the account field in the database.
 	FieldAccount = "account"
 	// FieldNickname holds the string denoting the nickname field in the database.
 	FieldNickname = "nickname"
 	// FieldPhone holds the string denoting the phone field in the database.
 	FieldPhone = "phone"
+	// FieldPhoneName holds the string denoting the phone_name field in the database.
+	FieldPhoneName = "phone_name"
+	// FieldPhoneStatus holds the string denoting the phone_status field in the database.
+	FieldPhoneStatus = "phone_status"
 	// FieldOrganizationID holds the string denoting the organization_id field in the database.
 	FieldOrganizationID = "organization_id"
-	// FieldAgentID holds the string denoting the agent_id field in the database.
-	FieldAgentID = "agent_id"
 	// FieldAPIBase holds the string denoting the api_base field in the database.
 	FieldAPIBase = "api_base"
 	// FieldAPIKey holds the string denoting the api_key field in the database.
@@ -71,14 +73,15 @@ var Columns = []string{
 	FieldUpdatedAt,
 	FieldStatus,
 	FieldDeletedAt,
-	FieldAk,
-	FieldSk,
+	FieldWaID,
 	FieldCallback,
+	FieldAgentID,
 	FieldAccount,
 	FieldNickname,
 	FieldPhone,
+	FieldPhoneName,
+	FieldPhoneStatus,
 	FieldOrganizationID,
-	FieldAgentID,
 	FieldAPIBase,
 	FieldAPIKey,
 	FieldAllowList,
@@ -113,22 +116,24 @@ var (
 	UpdateDefaultUpdatedAt func() time.Time
 	// DefaultStatus holds the default value on creation for the "status" field.
 	DefaultStatus uint8
-	// DefaultAk holds the default value on creation for the "ak" field.
-	DefaultAk string
-	// DefaultSk holds the default value on creation for the "sk" field.
-	DefaultSk string
+	// DefaultWaID holds the default value on creation for the "wa_id" field.
+	DefaultWaID uint64
 	// DefaultCallback holds the default value on creation for the "callback" field.
 	DefaultCallback string
+	// DefaultAgentID holds the default value on creation for the "agent_id" field.
+	DefaultAgentID uint64
 	// DefaultAccount holds the default value on creation for the "account" field.
 	DefaultAccount string
 	// DefaultNickname holds the default value on creation for the "nickname" field.
 	DefaultNickname string
 	// DefaultPhone holds the default value on creation for the "phone" field.
 	DefaultPhone string
+	// DefaultPhoneName holds the default value on creation for the "phone_name" field.
+	DefaultPhoneName string
+	// DefaultPhoneStatus holds the default value on creation for the "phone_status" field.
+	DefaultPhoneStatus int8
 	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
 	DefaultOrganizationID uint64
-	// DefaultAgentID holds the default value on creation for the "agent_id" field.
-	DefaultAgentID uint64
 	// DefaultAPIBase holds the default value on creation for the "api_base" field.
 	DefaultAPIBase string
 	// DefaultAPIKey holds the default value on creation for the "api_key" field.
@@ -163,14 +168,9 @@ func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
 }
 
-// ByAk orders the results by the ak field.
-func ByAk(opts ...sql.OrderTermOption) OrderOption {
-	return sql.OrderByField(FieldAk, opts...).ToFunc()
-}
-
-// BySk orders the results by the sk field.
-func BySk(opts ...sql.OrderTermOption) OrderOption {
-	return sql.OrderByField(FieldSk, opts...).ToFunc()
+// ByWaID orders the results by the wa_id field.
+func ByWaID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldWaID, opts...).ToFunc()
 }
 
 // ByCallback orders the results by the callback field.
@@ -178,6 +178,11 @@ func ByCallback(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldCallback, opts...).ToFunc()
 }
 
+// ByAgentID orders the results by the agent_id field.
+func ByAgentID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldAgentID, opts...).ToFunc()
+}
+
 // ByAccount orders the results by the account field.
 func ByAccount(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldAccount, opts...).ToFunc()
@@ -193,16 +198,21 @@ func ByPhone(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldPhone, opts...).ToFunc()
 }
 
+// ByPhoneName orders the results by the phone_name field.
+func ByPhoneName(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldPhoneName, opts...).ToFunc()
+}
+
+// ByPhoneStatus orders the results by the phone_status field.
+func ByPhoneStatus(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldPhoneStatus, opts...).ToFunc()
+}
+
 // ByOrganizationID orders the results by the organization_id field.
 func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
 }
 
-// ByAgentID orders the results by the agent_id field.
-func ByAgentID(opts ...sql.OrderTermOption) OrderOption {
-	return sql.OrderByField(FieldAgentID, opts...).ToFunc()
-}
-
 // ByAPIBase orders the results by the api_base field.
 func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldAPIBase, opts...).ToFunc()

+ 173 - 153
ent/whatsapp/where.go

@@ -75,14 +75,9 @@ func DeletedAt(v time.Time) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldDeletedAt, v))
 }
 
-// Ak applies equality check predicate on the "ak" field. It's identical to AkEQ.
-func Ak(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldAk, v))
-}
-
-// Sk applies equality check predicate on the "sk" field. It's identical to SkEQ.
-func Sk(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldSk, v))
+// WaID applies equality check predicate on the "wa_id" field. It's identical to WaIDEQ.
+func WaID(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldWaID, v))
 }
 
 // Callback applies equality check predicate on the "callback" field. It's identical to CallbackEQ.
@@ -90,6 +85,11 @@ func Callback(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldCallback, v))
 }
 
+// AgentID applies equality check predicate on the "agent_id" field. It's identical to AgentIDEQ.
+func AgentID(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldAgentID, v))
+}
+
 // Account applies equality check predicate on the "account" field. It's identical to AccountEQ.
 func Account(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldAccount, v))
@@ -105,16 +105,21 @@ func Phone(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldPhone, v))
 }
 
+// PhoneName applies equality check predicate on the "phone_name" field. It's identical to PhoneNameEQ.
+func PhoneName(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldPhoneName, v))
+}
+
+// PhoneStatus applies equality check predicate on the "phone_status" field. It's identical to PhoneStatusEQ.
+func PhoneStatus(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldPhoneStatus, v))
+}
+
 // OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ.
 func OrganizationID(v uint64) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldOrganizationID, v))
 }
 
-// AgentID applies equality check predicate on the "agent_id" field. It's identical to AgentIDEQ.
-func AgentID(v uint64) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldAgentID, v))
-}
-
 // APIBase applies equality check predicate on the "api_base" field. It's identical to APIBaseEQ.
 func APIBase(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldAPIBase, v))
@@ -305,144 +310,54 @@ func DeletedAtNotNil() predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldNotNull(FieldDeletedAt))
 }
 
-// AkEQ applies the EQ predicate on the "ak" field.
-func AkEQ(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldAk, v))
-}
-
-// AkNEQ applies the NEQ predicate on the "ak" field.
-func AkNEQ(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNEQ(FieldAk, v))
-}
-
-// AkIn applies the In predicate on the "ak" field.
-func AkIn(vs ...string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldIn(FieldAk, vs...))
-}
-
-// AkNotIn applies the NotIn predicate on the "ak" field.
-func AkNotIn(vs ...string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNotIn(FieldAk, vs...))
-}
-
-// AkGT applies the GT predicate on the "ak" field.
-func AkGT(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldGT(FieldAk, v))
-}
-
-// AkGTE applies the GTE predicate on the "ak" field.
-func AkGTE(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldGTE(FieldAk, v))
-}
-
-// AkLT applies the LT predicate on the "ak" field.
-func AkLT(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldLT(FieldAk, v))
-}
-
-// AkLTE applies the LTE predicate on the "ak" field.
-func AkLTE(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldLTE(FieldAk, v))
-}
-
-// AkContains applies the Contains predicate on the "ak" field.
-func AkContains(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldContains(FieldAk, v))
-}
-
-// AkHasPrefix applies the HasPrefix predicate on the "ak" field.
-func AkHasPrefix(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldHasPrefix(FieldAk, v))
+// WaIDEQ applies the EQ predicate on the "wa_id" field.
+func WaIDEQ(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldWaID, v))
 }
 
-// AkHasSuffix applies the HasSuffix predicate on the "ak" field.
-func AkHasSuffix(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldHasSuffix(FieldAk, v))
+// WaIDNEQ applies the NEQ predicate on the "wa_id" field.
+func WaIDNEQ(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNEQ(FieldWaID, v))
 }
 
-// AkIsNil applies the IsNil predicate on the "ak" field.
-func AkIsNil() predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldIsNull(FieldAk))
+// WaIDIn applies the In predicate on the "wa_id" field.
+func WaIDIn(vs ...uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIn(FieldWaID, vs...))
 }
 
-// AkNotNil applies the NotNil predicate on the "ak" field.
-func AkNotNil() predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNotNull(FieldAk))
+// WaIDNotIn applies the NotIn predicate on the "wa_id" field.
+func WaIDNotIn(vs ...uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotIn(FieldWaID, vs...))
 }
 
-// AkEqualFold applies the EqualFold predicate on the "ak" field.
-func AkEqualFold(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEqualFold(FieldAk, v))
+// WaIDGT applies the GT predicate on the "wa_id" field.
+func WaIDGT(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGT(FieldWaID, v))
 }
 
-// AkContainsFold applies the ContainsFold predicate on the "ak" field.
-func AkContainsFold(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldContainsFold(FieldAk, v))
+// WaIDGTE applies the GTE predicate on the "wa_id" field.
+func WaIDGTE(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGTE(FieldWaID, v))
 }
 
-// SkEQ applies the EQ predicate on the "sk" field.
-func SkEQ(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldSk, v))
+// WaIDLT applies the LT predicate on the "wa_id" field.
+func WaIDLT(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLT(FieldWaID, v))
 }
 
-// SkNEQ applies the NEQ predicate on the "sk" field.
-func SkNEQ(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNEQ(FieldSk, v))
+// WaIDLTE applies the LTE predicate on the "wa_id" field.
+func WaIDLTE(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLTE(FieldWaID, v))
 }
 
-// SkIn applies the In predicate on the "sk" field.
-func SkIn(vs ...string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldIn(FieldSk, vs...))
+// WaIDIsNil applies the IsNil predicate on the "wa_id" field.
+func WaIDIsNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIsNull(FieldWaID))
 }
 
-// SkNotIn applies the NotIn predicate on the "sk" field.
-func SkNotIn(vs ...string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNotIn(FieldSk, vs...))
-}
-
-// SkGT applies the GT predicate on the "sk" field.
-func SkGT(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldGT(FieldSk, v))
-}
-
-// SkGTE applies the GTE predicate on the "sk" field.
-func SkGTE(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldGTE(FieldSk, v))
-}
-
-// SkLT applies the LT predicate on the "sk" field.
-func SkLT(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldLT(FieldSk, v))
-}
-
-// SkLTE applies the LTE predicate on the "sk" field.
-func SkLTE(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldLTE(FieldSk, v))
-}
-
-// SkContains applies the Contains predicate on the "sk" field.
-func SkContains(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldContains(FieldSk, v))
-}
-
-// SkHasPrefix applies the HasPrefix predicate on the "sk" field.
-func SkHasPrefix(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldHasPrefix(FieldSk, v))
-}
-
-// SkHasSuffix applies the HasSuffix predicate on the "sk" field.
-func SkHasSuffix(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldHasSuffix(FieldSk, v))
-}
-
-// SkEqualFold applies the EqualFold predicate on the "sk" field.
-func SkEqualFold(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEqualFold(FieldSk, v))
-}
-
-// SkContainsFold applies the ContainsFold predicate on the "sk" field.
-func SkContainsFold(v string) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldContainsFold(FieldSk, v))
+// WaIDNotNil applies the NotNil predicate on the "wa_id" field.
+func WaIDNotNil() predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotNull(FieldWaID))
 }
 
 // CallbackEQ applies the EQ predicate on the "callback" field.
@@ -520,6 +435,26 @@ func CallbackContainsFold(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldContainsFold(FieldCallback, v))
 }
 
+// AgentIDEQ applies the EQ predicate on the "agent_id" field.
+func AgentIDEQ(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldAgentID, v))
+}
+
+// AgentIDNEQ applies the NEQ predicate on the "agent_id" field.
+func AgentIDNEQ(v uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNEQ(FieldAgentID, v))
+}
+
+// AgentIDIn applies the In predicate on the "agent_id" field.
+func AgentIDIn(vs ...uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIn(FieldAgentID, vs...))
+}
+
+// AgentIDNotIn applies the NotIn predicate on the "agent_id" field.
+func AgentIDNotIn(vs ...uint64) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotIn(FieldAgentID, vs...))
+}
+
 // AccountEQ applies the EQ predicate on the "account" field.
 func AccountEQ(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldAccount, v))
@@ -725,6 +660,111 @@ func PhoneContainsFold(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldContainsFold(FieldPhone, v))
 }
 
+// PhoneNameEQ applies the EQ predicate on the "phone_name" field.
+func PhoneNameEQ(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldPhoneName, v))
+}
+
+// PhoneNameNEQ applies the NEQ predicate on the "phone_name" field.
+func PhoneNameNEQ(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNEQ(FieldPhoneName, v))
+}
+
+// PhoneNameIn applies the In predicate on the "phone_name" field.
+func PhoneNameIn(vs ...string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIn(FieldPhoneName, vs...))
+}
+
+// PhoneNameNotIn applies the NotIn predicate on the "phone_name" field.
+func PhoneNameNotIn(vs ...string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotIn(FieldPhoneName, vs...))
+}
+
+// PhoneNameGT applies the GT predicate on the "phone_name" field.
+func PhoneNameGT(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGT(FieldPhoneName, v))
+}
+
+// PhoneNameGTE applies the GTE predicate on the "phone_name" field.
+func PhoneNameGTE(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGTE(FieldPhoneName, v))
+}
+
+// PhoneNameLT applies the LT predicate on the "phone_name" field.
+func PhoneNameLT(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLT(FieldPhoneName, v))
+}
+
+// PhoneNameLTE applies the LTE predicate on the "phone_name" field.
+func PhoneNameLTE(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLTE(FieldPhoneName, v))
+}
+
+// PhoneNameContains applies the Contains predicate on the "phone_name" field.
+func PhoneNameContains(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldContains(FieldPhoneName, v))
+}
+
+// PhoneNameHasPrefix applies the HasPrefix predicate on the "phone_name" field.
+func PhoneNameHasPrefix(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldHasPrefix(FieldPhoneName, v))
+}
+
+// PhoneNameHasSuffix applies the HasSuffix predicate on the "phone_name" field.
+func PhoneNameHasSuffix(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldHasSuffix(FieldPhoneName, v))
+}
+
+// PhoneNameEqualFold applies the EqualFold predicate on the "phone_name" field.
+func PhoneNameEqualFold(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEqualFold(FieldPhoneName, v))
+}
+
+// PhoneNameContainsFold applies the ContainsFold predicate on the "phone_name" field.
+func PhoneNameContainsFold(v string) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldContainsFold(FieldPhoneName, v))
+}
+
+// PhoneStatusEQ applies the EQ predicate on the "phone_status" field.
+func PhoneStatusEQ(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldEQ(FieldPhoneStatus, v))
+}
+
+// PhoneStatusNEQ applies the NEQ predicate on the "phone_status" field.
+func PhoneStatusNEQ(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNEQ(FieldPhoneStatus, v))
+}
+
+// PhoneStatusIn applies the In predicate on the "phone_status" field.
+func PhoneStatusIn(vs ...int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldIn(FieldPhoneStatus, vs...))
+}
+
+// PhoneStatusNotIn applies the NotIn predicate on the "phone_status" field.
+func PhoneStatusNotIn(vs ...int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldNotIn(FieldPhoneStatus, vs...))
+}
+
+// PhoneStatusGT applies the GT predicate on the "phone_status" field.
+func PhoneStatusGT(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGT(FieldPhoneStatus, v))
+}
+
+// PhoneStatusGTE applies the GTE predicate on the "phone_status" field.
+func PhoneStatusGTE(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldGTE(FieldPhoneStatus, v))
+}
+
+// PhoneStatusLT applies the LT predicate on the "phone_status" field.
+func PhoneStatusLT(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLT(FieldPhoneStatus, v))
+}
+
+// PhoneStatusLTE applies the LTE predicate on the "phone_status" field.
+func PhoneStatusLTE(v int8) predicate.Whatsapp {
+	return predicate.Whatsapp(sql.FieldLTE(FieldPhoneStatus, v))
+}
+
 // OrganizationIDEQ applies the EQ predicate on the "organization_id" field.
 func OrganizationIDEQ(v uint64) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldOrganizationID, v))
@@ -775,26 +815,6 @@ func OrganizationIDNotNil() predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldNotNull(FieldOrganizationID))
 }
 
-// AgentIDEQ applies the EQ predicate on the "agent_id" field.
-func AgentIDEQ(v uint64) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldEQ(FieldAgentID, v))
-}
-
-// AgentIDNEQ applies the NEQ predicate on the "agent_id" field.
-func AgentIDNEQ(v uint64) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNEQ(FieldAgentID, v))
-}
-
-// AgentIDIn applies the In predicate on the "agent_id" field.
-func AgentIDIn(vs ...uint64) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldIn(FieldAgentID, vs...))
-}
-
-// AgentIDNotIn applies the NotIn predicate on the "agent_id" field.
-func AgentIDNotIn(vs ...uint64) predicate.Whatsapp {
-	return predicate.Whatsapp(sql.FieldNotIn(FieldAgentID, vs...))
-}
-
 // APIBaseEQ applies the EQ predicate on the "api_base" field.
 func APIBaseEQ(v string) predicate.Whatsapp {
 	return predicate.Whatsapp(sql.FieldEQ(FieldAPIBase, v))

+ 256 - 151
ent/whatsapp_create.go

@@ -79,44 +79,44 @@ func (wc *WhatsappCreate) SetNillableDeletedAt(t *time.Time) *WhatsappCreate {
 	return wc
 }
 
-// SetAk sets the "ak" field.
-func (wc *WhatsappCreate) SetAk(s string) *WhatsappCreate {
-	wc.mutation.SetAk(s)
+// SetWaID sets the "wa_id" field.
+func (wc *WhatsappCreate) SetWaID(u uint64) *WhatsappCreate {
+	wc.mutation.SetWaID(u)
 	return wc
 }
 
-// SetNillableAk sets the "ak" field if the given value is not nil.
-func (wc *WhatsappCreate) SetNillableAk(s *string) *WhatsappCreate {
-	if s != nil {
-		wc.SetAk(*s)
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillableWaID(u *uint64) *WhatsappCreate {
+	if u != nil {
+		wc.SetWaID(*u)
 	}
 	return wc
 }
 
-// SetSk sets the "sk" field.
-func (wc *WhatsappCreate) SetSk(s string) *WhatsappCreate {
-	wc.mutation.SetSk(s)
+// SetCallback sets the "callback" field.
+func (wc *WhatsappCreate) SetCallback(s string) *WhatsappCreate {
+	wc.mutation.SetCallback(s)
 	return wc
 }
 
-// SetNillableSk sets the "sk" field if the given value is not nil.
-func (wc *WhatsappCreate) SetNillableSk(s *string) *WhatsappCreate {
+// SetNillableCallback sets the "callback" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillableCallback(s *string) *WhatsappCreate {
 	if s != nil {
-		wc.SetSk(*s)
+		wc.SetCallback(*s)
 	}
 	return wc
 }
 
-// SetCallback sets the "callback" field.
-func (wc *WhatsappCreate) SetCallback(s string) *WhatsappCreate {
-	wc.mutation.SetCallback(s)
+// SetAgentID sets the "agent_id" field.
+func (wc *WhatsappCreate) SetAgentID(u uint64) *WhatsappCreate {
+	wc.mutation.SetAgentID(u)
 	return wc
 }
 
-// SetNillableCallback sets the "callback" field if the given value is not nil.
-func (wc *WhatsappCreate) SetNillableCallback(s *string) *WhatsappCreate {
-	if s != nil {
-		wc.SetCallback(*s)
+// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillableAgentID(u *uint64) *WhatsappCreate {
+	if u != nil {
+		wc.SetAgentID(*u)
 	}
 	return wc
 }
@@ -163,30 +163,44 @@ func (wc *WhatsappCreate) SetNillablePhone(s *string) *WhatsappCreate {
 	return wc
 }
 
-// SetOrganizationID sets the "organization_id" field.
-func (wc *WhatsappCreate) SetOrganizationID(u uint64) *WhatsappCreate {
-	wc.mutation.SetOrganizationID(u)
+// SetPhoneName sets the "phone_name" field.
+func (wc *WhatsappCreate) SetPhoneName(s string) *WhatsappCreate {
+	wc.mutation.SetPhoneName(s)
 	return wc
 }
 
-// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
-func (wc *WhatsappCreate) SetNillableOrganizationID(u *uint64) *WhatsappCreate {
-	if u != nil {
-		wc.SetOrganizationID(*u)
+// SetNillablePhoneName sets the "phone_name" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillablePhoneName(s *string) *WhatsappCreate {
+	if s != nil {
+		wc.SetPhoneName(*s)
 	}
 	return wc
 }
 
-// SetAgentID sets the "agent_id" field.
-func (wc *WhatsappCreate) SetAgentID(u uint64) *WhatsappCreate {
-	wc.mutation.SetAgentID(u)
+// SetPhoneStatus sets the "phone_status" field.
+func (wc *WhatsappCreate) SetPhoneStatus(i int8) *WhatsappCreate {
+	wc.mutation.SetPhoneStatus(i)
 	return wc
 }
 
-// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
-func (wc *WhatsappCreate) SetNillableAgentID(u *uint64) *WhatsappCreate {
+// SetNillablePhoneStatus sets the "phone_status" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillablePhoneStatus(i *int8) *WhatsappCreate {
+	if i != nil {
+		wc.SetPhoneStatus(*i)
+	}
+	return wc
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (wc *WhatsappCreate) SetOrganizationID(u uint64) *WhatsappCreate {
+	wc.mutation.SetOrganizationID(u)
+	return wc
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (wc *WhatsappCreate) SetNillableOrganizationID(u *uint64) *WhatsappCreate {
 	if u != nil {
-		wc.SetAgentID(*u)
+		wc.SetOrganizationID(*u)
 	}
 	return wc
 }
@@ -309,18 +323,18 @@ func (wc *WhatsappCreate) defaults() error {
 		v := whatsapp.DefaultStatus
 		wc.mutation.SetStatus(v)
 	}
-	if _, ok := wc.mutation.Ak(); !ok {
-		v := whatsapp.DefaultAk
-		wc.mutation.SetAk(v)
-	}
-	if _, ok := wc.mutation.Sk(); !ok {
-		v := whatsapp.DefaultSk
-		wc.mutation.SetSk(v)
+	if _, ok := wc.mutation.WaID(); !ok {
+		v := whatsapp.DefaultWaID
+		wc.mutation.SetWaID(v)
 	}
 	if _, ok := wc.mutation.Callback(); !ok {
 		v := whatsapp.DefaultCallback
 		wc.mutation.SetCallback(v)
 	}
+	if _, ok := wc.mutation.AgentID(); !ok {
+		v := whatsapp.DefaultAgentID
+		wc.mutation.SetAgentID(v)
+	}
 	if _, ok := wc.mutation.Account(); !ok {
 		v := whatsapp.DefaultAccount
 		wc.mutation.SetAccount(v)
@@ -333,14 +347,18 @@ func (wc *WhatsappCreate) defaults() error {
 		v := whatsapp.DefaultPhone
 		wc.mutation.SetPhone(v)
 	}
+	if _, ok := wc.mutation.PhoneName(); !ok {
+		v := whatsapp.DefaultPhoneName
+		wc.mutation.SetPhoneName(v)
+	}
+	if _, ok := wc.mutation.PhoneStatus(); !ok {
+		v := whatsapp.DefaultPhoneStatus
+		wc.mutation.SetPhoneStatus(v)
+	}
 	if _, ok := wc.mutation.OrganizationID(); !ok {
 		v := whatsapp.DefaultOrganizationID
 		wc.mutation.SetOrganizationID(v)
 	}
-	if _, ok := wc.mutation.AgentID(); !ok {
-		v := whatsapp.DefaultAgentID
-		wc.mutation.SetAgentID(v)
-	}
 	if _, ok := wc.mutation.APIBase(); !ok {
 		v := whatsapp.DefaultAPIBase
 		wc.mutation.SetAPIBase(v)
@@ -360,8 +378,8 @@ func (wc *WhatsappCreate) check() error {
 	if _, ok := wc.mutation.UpdatedAt(); !ok {
 		return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Whatsapp.updated_at"`)}
 	}
-	if _, ok := wc.mutation.Sk(); !ok {
-		return &ValidationError{Name: "sk", err: errors.New(`ent: missing required field "Whatsapp.sk"`)}
+	if _, ok := wc.mutation.AgentID(); !ok {
+		return &ValidationError{Name: "agent_id", err: errors.New(`ent: missing required field "Whatsapp.agent_id"`)}
 	}
 	if _, ok := wc.mutation.Nickname(); !ok {
 		return &ValidationError{Name: "nickname", err: errors.New(`ent: missing required field "Whatsapp.nickname"`)}
@@ -369,8 +387,11 @@ 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.AgentID(); !ok {
-		return &ValidationError{Name: "agent_id", err: errors.New(`ent: missing required field "Whatsapp.agent_id"`)}
+	if _, ok := wc.mutation.PhoneName(); !ok {
+		return &ValidationError{Name: "phone_name", err: errors.New(`ent: missing required field "Whatsapp.phone_name"`)}
+	}
+	if _, ok := wc.mutation.PhoneStatus(); !ok {
+		return &ValidationError{Name: "phone_status", err: errors.New(`ent: missing required field "Whatsapp.phone_status"`)}
 	}
 	if _, ok := wc.mutation.AgentID(); !ok {
 		return &ValidationError{Name: "agent", err: errors.New(`ent: missing required edge "Whatsapp.agent"`)}
@@ -424,13 +445,9 @@ func (wc *WhatsappCreate) createSpec() (*Whatsapp, *sqlgraph.CreateSpec) {
 		_spec.SetField(whatsapp.FieldDeletedAt, field.TypeTime, value)
 		_node.DeletedAt = value
 	}
-	if value, ok := wc.mutation.Ak(); ok {
-		_spec.SetField(whatsapp.FieldAk, field.TypeString, value)
-		_node.Ak = value
-	}
-	if value, ok := wc.mutation.Sk(); ok {
-		_spec.SetField(whatsapp.FieldSk, field.TypeString, value)
-		_node.Sk = value
+	if value, ok := wc.mutation.WaID(); ok {
+		_spec.SetField(whatsapp.FieldWaID, field.TypeUint64, value)
+		_node.WaID = value
 	}
 	if value, ok := wc.mutation.Callback(); ok {
 		_spec.SetField(whatsapp.FieldCallback, field.TypeString, value)
@@ -448,6 +465,14 @@ func (wc *WhatsappCreate) createSpec() (*Whatsapp, *sqlgraph.CreateSpec) {
 		_spec.SetField(whatsapp.FieldPhone, field.TypeString, value)
 		_node.Phone = value
 	}
+	if value, ok := wc.mutation.PhoneName(); ok {
+		_spec.SetField(whatsapp.FieldPhoneName, field.TypeString, value)
+		_node.PhoneName = value
+	}
+	if value, ok := wc.mutation.PhoneStatus(); ok {
+		_spec.SetField(whatsapp.FieldPhoneStatus, field.TypeInt8, value)
+		_node.PhoneStatus = value
+	}
 	if value, ok := wc.mutation.OrganizationID(); ok {
 		_spec.SetField(whatsapp.FieldOrganizationID, field.TypeUint64, value)
 		_node.OrganizationID = value
@@ -599,33 +624,27 @@ func (u *WhatsappUpsert) ClearDeletedAt() *WhatsappUpsert {
 	return u
 }
 
-// SetAk sets the "ak" field.
-func (u *WhatsappUpsert) SetAk(v string) *WhatsappUpsert {
-	u.Set(whatsapp.FieldAk, v)
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappUpsert) SetWaID(v uint64) *WhatsappUpsert {
+	u.Set(whatsapp.FieldWaID, v)
 	return u
 }
 
-// UpdateAk sets the "ak" field to the value that was provided on create.
-func (u *WhatsappUpsert) UpdateAk() *WhatsappUpsert {
-	u.SetExcluded(whatsapp.FieldAk)
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappUpsert) UpdateWaID() *WhatsappUpsert {
+	u.SetExcluded(whatsapp.FieldWaID)
 	return u
 }
 
-// ClearAk clears the value of the "ak" field.
-func (u *WhatsappUpsert) ClearAk() *WhatsappUpsert {
-	u.SetNull(whatsapp.FieldAk)
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappUpsert) AddWaID(v uint64) *WhatsappUpsert {
+	u.Add(whatsapp.FieldWaID, v)
 	return u
 }
 
-// SetSk sets the "sk" field.
-func (u *WhatsappUpsert) SetSk(v string) *WhatsappUpsert {
-	u.Set(whatsapp.FieldSk, v)
-	return u
-}
-
-// UpdateSk sets the "sk" field to the value that was provided on create.
-func (u *WhatsappUpsert) UpdateSk() *WhatsappUpsert {
-	u.SetExcluded(whatsapp.FieldSk)
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappUpsert) ClearWaID() *WhatsappUpsert {
+	u.SetNull(whatsapp.FieldWaID)
 	return u
 }
 
@@ -647,6 +666,18 @@ func (u *WhatsappUpsert) ClearCallback() *WhatsappUpsert {
 	return u
 }
 
+// SetAgentID sets the "agent_id" field.
+func (u *WhatsappUpsert) SetAgentID(v uint64) *WhatsappUpsert {
+	u.Set(whatsapp.FieldAgentID, v)
+	return u
+}
+
+// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
+func (u *WhatsappUpsert) UpdateAgentID() *WhatsappUpsert {
+	u.SetExcluded(whatsapp.FieldAgentID)
+	return u
+}
+
 // SetAccount sets the "account" field.
 func (u *WhatsappUpsert) SetAccount(v string) *WhatsappUpsert {
 	u.Set(whatsapp.FieldAccount, v)
@@ -689,6 +720,36 @@ func (u *WhatsappUpsert) UpdatePhone() *WhatsappUpsert {
 	return u
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (u *WhatsappUpsert) SetPhoneName(v string) *WhatsappUpsert {
+	u.Set(whatsapp.FieldPhoneName, v)
+	return u
+}
+
+// UpdatePhoneName sets the "phone_name" field to the value that was provided on create.
+func (u *WhatsappUpsert) UpdatePhoneName() *WhatsappUpsert {
+	u.SetExcluded(whatsapp.FieldPhoneName)
+	return u
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (u *WhatsappUpsert) SetPhoneStatus(v int8) *WhatsappUpsert {
+	u.Set(whatsapp.FieldPhoneStatus, v)
+	return u
+}
+
+// UpdatePhoneStatus sets the "phone_status" field to the value that was provided on create.
+func (u *WhatsappUpsert) UpdatePhoneStatus() *WhatsappUpsert {
+	u.SetExcluded(whatsapp.FieldPhoneStatus)
+	return u
+}
+
+// AddPhoneStatus adds v to the "phone_status" field.
+func (u *WhatsappUpsert) AddPhoneStatus(v int8) *WhatsappUpsert {
+	u.Add(whatsapp.FieldPhoneStatus, v)
+	return u
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (u *WhatsappUpsert) SetOrganizationID(v uint64) *WhatsappUpsert {
 	u.Set(whatsapp.FieldOrganizationID, v)
@@ -713,18 +774,6 @@ func (u *WhatsappUpsert) ClearOrganizationID() *WhatsappUpsert {
 	return u
 }
 
-// SetAgentID sets the "agent_id" field.
-func (u *WhatsappUpsert) SetAgentID(v uint64) *WhatsappUpsert {
-	u.Set(whatsapp.FieldAgentID, v)
-	return u
-}
-
-// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
-func (u *WhatsappUpsert) UpdateAgentID() *WhatsappUpsert {
-	u.SetExcluded(whatsapp.FieldAgentID)
-	return u
-}
-
 // SetAPIBase sets the "api_base" field.
 func (u *WhatsappUpsert) SetAPIBase(v string) *WhatsappUpsert {
 	u.Set(whatsapp.FieldAPIBase, v)
@@ -947,38 +996,31 @@ func (u *WhatsappUpsertOne) ClearDeletedAt() *WhatsappUpsertOne {
 	})
 }
 
-// SetAk sets the "ak" field.
-func (u *WhatsappUpsertOne) SetAk(v string) *WhatsappUpsertOne {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.SetAk(v)
-	})
-}
-
-// UpdateAk sets the "ak" field to the value that was provided on create.
-func (u *WhatsappUpsertOne) UpdateAk() *WhatsappUpsertOne {
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappUpsertOne) SetWaID(v uint64) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateAk()
+		s.SetWaID(v)
 	})
 }
 
-// ClearAk clears the value of the "ak" field.
-func (u *WhatsappUpsertOne) ClearAk() *WhatsappUpsertOne {
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappUpsertOne) AddWaID(v uint64) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.ClearAk()
+		s.AddWaID(v)
 	})
 }
 
-// SetSk sets the "sk" field.
-func (u *WhatsappUpsertOne) SetSk(v string) *WhatsappUpsertOne {
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappUpsertOne) UpdateWaID() *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.SetSk(v)
+		s.UpdateWaID()
 	})
 }
 
-// UpdateSk sets the "sk" field to the value that was provided on create.
-func (u *WhatsappUpsertOne) UpdateSk() *WhatsappUpsertOne {
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappUpsertOne) ClearWaID() *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateSk()
+		s.ClearWaID()
 	})
 }
 
@@ -1003,6 +1045,20 @@ func (u *WhatsappUpsertOne) ClearCallback() *WhatsappUpsertOne {
 	})
 }
 
+// SetAgentID sets the "agent_id" field.
+func (u *WhatsappUpsertOne) SetAgentID(v uint64) *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetAgentID(v)
+	})
+}
+
+// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
+func (u *WhatsappUpsertOne) UpdateAgentID() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdateAgentID()
+	})
+}
+
 // SetAccount sets the "account" field.
 func (u *WhatsappUpsertOne) SetAccount(v string) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1052,6 +1108,41 @@ func (u *WhatsappUpsertOne) UpdatePhone() *WhatsappUpsertOne {
 	})
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (u *WhatsappUpsertOne) SetPhoneName(v string) *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetPhoneName(v)
+	})
+}
+
+// UpdatePhoneName sets the "phone_name" field to the value that was provided on create.
+func (u *WhatsappUpsertOne) UpdatePhoneName() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdatePhoneName()
+	})
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (u *WhatsappUpsertOne) SetPhoneStatus(v int8) *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetPhoneStatus(v)
+	})
+}
+
+// AddPhoneStatus adds v to the "phone_status" field.
+func (u *WhatsappUpsertOne) AddPhoneStatus(v int8) *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.AddPhoneStatus(v)
+	})
+}
+
+// UpdatePhoneStatus sets the "phone_status" field to the value that was provided on create.
+func (u *WhatsappUpsertOne) UpdatePhoneStatus() *WhatsappUpsertOne {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdatePhoneStatus()
+	})
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (u *WhatsappUpsertOne) SetOrganizationID(v uint64) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1080,20 +1171,6 @@ func (u *WhatsappUpsertOne) ClearOrganizationID() *WhatsappUpsertOne {
 	})
 }
 
-// SetAgentID sets the "agent_id" field.
-func (u *WhatsappUpsertOne) SetAgentID(v uint64) *WhatsappUpsertOne {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.SetAgentID(v)
-	})
-}
-
-// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
-func (u *WhatsappUpsertOne) UpdateAgentID() *WhatsappUpsertOne {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateAgentID()
-	})
-}
-
 // SetAPIBase sets the "api_base" field.
 func (u *WhatsappUpsertOne) SetAPIBase(v string) *WhatsappUpsertOne {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1500,38 +1577,31 @@ func (u *WhatsappUpsertBulk) ClearDeletedAt() *WhatsappUpsertBulk {
 	})
 }
 
-// SetAk sets the "ak" field.
-func (u *WhatsappUpsertBulk) SetAk(v string) *WhatsappUpsertBulk {
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappUpsertBulk) SetWaID(v uint64) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.SetAk(v)
+		s.SetWaID(v)
 	})
 }
 
-// UpdateAk sets the "ak" field to the value that was provided on create.
-func (u *WhatsappUpsertBulk) UpdateAk() *WhatsappUpsertBulk {
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappUpsertBulk) AddWaID(v uint64) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateAk()
+		s.AddWaID(v)
 	})
 }
 
-// ClearAk clears the value of the "ak" field.
-func (u *WhatsappUpsertBulk) ClearAk() *WhatsappUpsertBulk {
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappUpsertBulk) UpdateWaID() *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.ClearAk()
+		s.UpdateWaID()
 	})
 }
 
-// SetSk sets the "sk" field.
-func (u *WhatsappUpsertBulk) SetSk(v string) *WhatsappUpsertBulk {
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappUpsertBulk) ClearWaID() *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
-		s.SetSk(v)
-	})
-}
-
-// UpdateSk sets the "sk" field to the value that was provided on create.
-func (u *WhatsappUpsertBulk) UpdateSk() *WhatsappUpsertBulk {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateSk()
+		s.ClearWaID()
 	})
 }
 
@@ -1556,6 +1626,20 @@ func (u *WhatsappUpsertBulk) ClearCallback() *WhatsappUpsertBulk {
 	})
 }
 
+// SetAgentID sets the "agent_id" field.
+func (u *WhatsappUpsertBulk) SetAgentID(v uint64) *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetAgentID(v)
+	})
+}
+
+// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
+func (u *WhatsappUpsertBulk) UpdateAgentID() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdateAgentID()
+	})
+}
+
 // SetAccount sets the "account" field.
 func (u *WhatsappUpsertBulk) SetAccount(v string) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1605,6 +1689,41 @@ func (u *WhatsappUpsertBulk) UpdatePhone() *WhatsappUpsertBulk {
 	})
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (u *WhatsappUpsertBulk) SetPhoneName(v string) *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetPhoneName(v)
+	})
+}
+
+// UpdatePhoneName sets the "phone_name" field to the value that was provided on create.
+func (u *WhatsappUpsertBulk) UpdatePhoneName() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdatePhoneName()
+	})
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (u *WhatsappUpsertBulk) SetPhoneStatus(v int8) *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.SetPhoneStatus(v)
+	})
+}
+
+// AddPhoneStatus adds v to the "phone_status" field.
+func (u *WhatsappUpsertBulk) AddPhoneStatus(v int8) *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.AddPhoneStatus(v)
+	})
+}
+
+// UpdatePhoneStatus sets the "phone_status" field to the value that was provided on create.
+func (u *WhatsappUpsertBulk) UpdatePhoneStatus() *WhatsappUpsertBulk {
+	return u.Update(func(s *WhatsappUpsert) {
+		s.UpdatePhoneStatus()
+	})
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (u *WhatsappUpsertBulk) SetOrganizationID(v uint64) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {
@@ -1633,20 +1752,6 @@ func (u *WhatsappUpsertBulk) ClearOrganizationID() *WhatsappUpsertBulk {
 	})
 }
 
-// SetAgentID sets the "agent_id" field.
-func (u *WhatsappUpsertBulk) SetAgentID(v uint64) *WhatsappUpsertBulk {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.SetAgentID(v)
-	})
-}
-
-// UpdateAgentID sets the "agent_id" field to the value that was provided on create.
-func (u *WhatsappUpsertBulk) UpdateAgentID() *WhatsappUpsertBulk {
-	return u.Update(func(s *WhatsappUpsert) {
-		s.UpdateAgentID()
-	})
-}
-
 // SetAPIBase sets the "api_base" field.
 func (u *WhatsappUpsertBulk) SetAPIBase(v string) *WhatsappUpsertBulk {
 	return u.Update(func(s *WhatsappUpsert) {

+ 156 - 82
ent/whatsapp_update.go

@@ -83,37 +83,30 @@ func (wu *WhatsappUpdate) ClearDeletedAt() *WhatsappUpdate {
 	return wu
 }
 
-// SetAk sets the "ak" field.
-func (wu *WhatsappUpdate) SetAk(s string) *WhatsappUpdate {
-	wu.mutation.SetAk(s)
+// SetWaID sets the "wa_id" field.
+func (wu *WhatsappUpdate) SetWaID(u uint64) *WhatsappUpdate {
+	wu.mutation.ResetWaID()
+	wu.mutation.SetWaID(u)
 	return wu
 }
 
-// SetNillableAk sets the "ak" field if the given value is not nil.
-func (wu *WhatsappUpdate) SetNillableAk(s *string) *WhatsappUpdate {
-	if s != nil {
-		wu.SetAk(*s)
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wu *WhatsappUpdate) SetNillableWaID(u *uint64) *WhatsappUpdate {
+	if u != nil {
+		wu.SetWaID(*u)
 	}
 	return wu
 }
 
-// ClearAk clears the value of the "ak" field.
-func (wu *WhatsappUpdate) ClearAk() *WhatsappUpdate {
-	wu.mutation.ClearAk()
+// AddWaID adds u to the "wa_id" field.
+func (wu *WhatsappUpdate) AddWaID(u int64) *WhatsappUpdate {
+	wu.mutation.AddWaID(u)
 	return wu
 }
 
-// SetSk sets the "sk" field.
-func (wu *WhatsappUpdate) SetSk(s string) *WhatsappUpdate {
-	wu.mutation.SetSk(s)
-	return wu
-}
-
-// SetNillableSk sets the "sk" field if the given value is not nil.
-func (wu *WhatsappUpdate) SetNillableSk(s *string) *WhatsappUpdate {
-	if s != nil {
-		wu.SetSk(*s)
-	}
+// ClearWaID clears the value of the "wa_id" field.
+func (wu *WhatsappUpdate) ClearWaID() *WhatsappUpdate {
+	wu.mutation.ClearWaID()
 	return wu
 }
 
@@ -137,6 +130,20 @@ func (wu *WhatsappUpdate) ClearCallback() *WhatsappUpdate {
 	return wu
 }
 
+// SetAgentID sets the "agent_id" field.
+func (wu *WhatsappUpdate) SetAgentID(u uint64) *WhatsappUpdate {
+	wu.mutation.SetAgentID(u)
+	return wu
+}
+
+// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
+func (wu *WhatsappUpdate) SetNillableAgentID(u *uint64) *WhatsappUpdate {
+	if u != nil {
+		wu.SetAgentID(*u)
+	}
+	return wu
+}
+
 // SetAccount sets the "account" field.
 func (wu *WhatsappUpdate) SetAccount(s string) *WhatsappUpdate {
 	wu.mutation.SetAccount(s)
@@ -185,6 +192,41 @@ func (wu *WhatsappUpdate) SetNillablePhone(s *string) *WhatsappUpdate {
 	return wu
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (wu *WhatsappUpdate) SetPhoneName(s string) *WhatsappUpdate {
+	wu.mutation.SetPhoneName(s)
+	return wu
+}
+
+// SetNillablePhoneName sets the "phone_name" field if the given value is not nil.
+func (wu *WhatsappUpdate) SetNillablePhoneName(s *string) *WhatsappUpdate {
+	if s != nil {
+		wu.SetPhoneName(*s)
+	}
+	return wu
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (wu *WhatsappUpdate) SetPhoneStatus(i int8) *WhatsappUpdate {
+	wu.mutation.ResetPhoneStatus()
+	wu.mutation.SetPhoneStatus(i)
+	return wu
+}
+
+// SetNillablePhoneStatus sets the "phone_status" field if the given value is not nil.
+func (wu *WhatsappUpdate) SetNillablePhoneStatus(i *int8) *WhatsappUpdate {
+	if i != nil {
+		wu.SetPhoneStatus(*i)
+	}
+	return wu
+}
+
+// AddPhoneStatus adds i to the "phone_status" field.
+func (wu *WhatsappUpdate) AddPhoneStatus(i int8) *WhatsappUpdate {
+	wu.mutation.AddPhoneStatus(i)
+	return wu
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (wu *WhatsappUpdate) SetOrganizationID(u uint64) *WhatsappUpdate {
 	wu.mutation.ResetOrganizationID()
@@ -212,20 +254,6 @@ func (wu *WhatsappUpdate) ClearOrganizationID() *WhatsappUpdate {
 	return wu
 }
 
-// SetAgentID sets the "agent_id" field.
-func (wu *WhatsappUpdate) SetAgentID(u uint64) *WhatsappUpdate {
-	wu.mutation.SetAgentID(u)
-	return wu
-}
-
-// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
-func (wu *WhatsappUpdate) SetNillableAgentID(u *uint64) *WhatsappUpdate {
-	if u != nil {
-		wu.SetAgentID(*u)
-	}
-	return wu
-}
-
 // SetAPIBase sets the "api_base" field.
 func (wu *WhatsappUpdate) SetAPIBase(s string) *WhatsappUpdate {
 	wu.mutation.SetAPIBase(s)
@@ -434,14 +462,14 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if wu.mutation.DeletedAtCleared() {
 		_spec.ClearField(whatsapp.FieldDeletedAt, field.TypeTime)
 	}
-	if value, ok := wu.mutation.Ak(); ok {
-		_spec.SetField(whatsapp.FieldAk, field.TypeString, value)
+	if value, ok := wu.mutation.WaID(); ok {
+		_spec.SetField(whatsapp.FieldWaID, field.TypeUint64, value)
 	}
-	if wu.mutation.AkCleared() {
-		_spec.ClearField(whatsapp.FieldAk, field.TypeString)
+	if value, ok := wu.mutation.AddedWaID(); ok {
+		_spec.AddField(whatsapp.FieldWaID, field.TypeUint64, value)
 	}
-	if value, ok := wu.mutation.Sk(); ok {
-		_spec.SetField(whatsapp.FieldSk, field.TypeString, value)
+	if wu.mutation.WaIDCleared() {
+		_spec.ClearField(whatsapp.FieldWaID, field.TypeUint64)
 	}
 	if value, ok := wu.mutation.Callback(); ok {
 		_spec.SetField(whatsapp.FieldCallback, field.TypeString, value)
@@ -461,6 +489,15 @@ func (wu *WhatsappUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := wu.mutation.Phone(); ok {
 		_spec.SetField(whatsapp.FieldPhone, field.TypeString, value)
 	}
+	if value, ok := wu.mutation.PhoneName(); ok {
+		_spec.SetField(whatsapp.FieldPhoneName, field.TypeString, value)
+	}
+	if value, ok := wu.mutation.PhoneStatus(); ok {
+		_spec.SetField(whatsapp.FieldPhoneStatus, field.TypeInt8, value)
+	}
+	if value, ok := wu.mutation.AddedPhoneStatus(); ok {
+		_spec.AddField(whatsapp.FieldPhoneStatus, field.TypeInt8, value)
+	}
 	if value, ok := wu.mutation.OrganizationID(); ok {
 		_spec.SetField(whatsapp.FieldOrganizationID, field.TypeUint64, value)
 	}
@@ -628,37 +665,30 @@ func (wuo *WhatsappUpdateOne) ClearDeletedAt() *WhatsappUpdateOne {
 	return wuo
 }
 
-// SetAk sets the "ak" field.
-func (wuo *WhatsappUpdateOne) SetAk(s string) *WhatsappUpdateOne {
-	wuo.mutation.SetAk(s)
+// SetWaID sets the "wa_id" field.
+func (wuo *WhatsappUpdateOne) SetWaID(u uint64) *WhatsappUpdateOne {
+	wuo.mutation.ResetWaID()
+	wuo.mutation.SetWaID(u)
 	return wuo
 }
 
-// SetNillableAk sets the "ak" field if the given value is not nil.
-func (wuo *WhatsappUpdateOne) SetNillableAk(s *string) *WhatsappUpdateOne {
-	if s != nil {
-		wuo.SetAk(*s)
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wuo *WhatsappUpdateOne) SetNillableWaID(u *uint64) *WhatsappUpdateOne {
+	if u != nil {
+		wuo.SetWaID(*u)
 	}
 	return wuo
 }
 
-// ClearAk clears the value of the "ak" field.
-func (wuo *WhatsappUpdateOne) ClearAk() *WhatsappUpdateOne {
-	wuo.mutation.ClearAk()
+// AddWaID adds u to the "wa_id" field.
+func (wuo *WhatsappUpdateOne) AddWaID(u int64) *WhatsappUpdateOne {
+	wuo.mutation.AddWaID(u)
 	return wuo
 }
 
-// SetSk sets the "sk" field.
-func (wuo *WhatsappUpdateOne) SetSk(s string) *WhatsappUpdateOne {
-	wuo.mutation.SetSk(s)
-	return wuo
-}
-
-// SetNillableSk sets the "sk" field if the given value is not nil.
-func (wuo *WhatsappUpdateOne) SetNillableSk(s *string) *WhatsappUpdateOne {
-	if s != nil {
-		wuo.SetSk(*s)
-	}
+// ClearWaID clears the value of the "wa_id" field.
+func (wuo *WhatsappUpdateOne) ClearWaID() *WhatsappUpdateOne {
+	wuo.mutation.ClearWaID()
 	return wuo
 }
 
@@ -682,6 +712,20 @@ func (wuo *WhatsappUpdateOne) ClearCallback() *WhatsappUpdateOne {
 	return wuo
 }
 
+// SetAgentID sets the "agent_id" field.
+func (wuo *WhatsappUpdateOne) SetAgentID(u uint64) *WhatsappUpdateOne {
+	wuo.mutation.SetAgentID(u)
+	return wuo
+}
+
+// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
+func (wuo *WhatsappUpdateOne) SetNillableAgentID(u *uint64) *WhatsappUpdateOne {
+	if u != nil {
+		wuo.SetAgentID(*u)
+	}
+	return wuo
+}
+
 // SetAccount sets the "account" field.
 func (wuo *WhatsappUpdateOne) SetAccount(s string) *WhatsappUpdateOne {
 	wuo.mutation.SetAccount(s)
@@ -730,6 +774,41 @@ func (wuo *WhatsappUpdateOne) SetNillablePhone(s *string) *WhatsappUpdateOne {
 	return wuo
 }
 
+// SetPhoneName sets the "phone_name" field.
+func (wuo *WhatsappUpdateOne) SetPhoneName(s string) *WhatsappUpdateOne {
+	wuo.mutation.SetPhoneName(s)
+	return wuo
+}
+
+// SetNillablePhoneName sets the "phone_name" field if the given value is not nil.
+func (wuo *WhatsappUpdateOne) SetNillablePhoneName(s *string) *WhatsappUpdateOne {
+	if s != nil {
+		wuo.SetPhoneName(*s)
+	}
+	return wuo
+}
+
+// SetPhoneStatus sets the "phone_status" field.
+func (wuo *WhatsappUpdateOne) SetPhoneStatus(i int8) *WhatsappUpdateOne {
+	wuo.mutation.ResetPhoneStatus()
+	wuo.mutation.SetPhoneStatus(i)
+	return wuo
+}
+
+// SetNillablePhoneStatus sets the "phone_status" field if the given value is not nil.
+func (wuo *WhatsappUpdateOne) SetNillablePhoneStatus(i *int8) *WhatsappUpdateOne {
+	if i != nil {
+		wuo.SetPhoneStatus(*i)
+	}
+	return wuo
+}
+
+// AddPhoneStatus adds i to the "phone_status" field.
+func (wuo *WhatsappUpdateOne) AddPhoneStatus(i int8) *WhatsappUpdateOne {
+	wuo.mutation.AddPhoneStatus(i)
+	return wuo
+}
+
 // SetOrganizationID sets the "organization_id" field.
 func (wuo *WhatsappUpdateOne) SetOrganizationID(u uint64) *WhatsappUpdateOne {
 	wuo.mutation.ResetOrganizationID()
@@ -757,20 +836,6 @@ func (wuo *WhatsappUpdateOne) ClearOrganizationID() *WhatsappUpdateOne {
 	return wuo
 }
 
-// SetAgentID sets the "agent_id" field.
-func (wuo *WhatsappUpdateOne) SetAgentID(u uint64) *WhatsappUpdateOne {
-	wuo.mutation.SetAgentID(u)
-	return wuo
-}
-
-// SetNillableAgentID sets the "agent_id" field if the given value is not nil.
-func (wuo *WhatsappUpdateOne) SetNillableAgentID(u *uint64) *WhatsappUpdateOne {
-	if u != nil {
-		wuo.SetAgentID(*u)
-	}
-	return wuo
-}
-
 // SetAPIBase sets the "api_base" field.
 func (wuo *WhatsappUpdateOne) SetAPIBase(s string) *WhatsappUpdateOne {
 	wuo.mutation.SetAPIBase(s)
@@ -1009,14 +1074,14 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 	if wuo.mutation.DeletedAtCleared() {
 		_spec.ClearField(whatsapp.FieldDeletedAt, field.TypeTime)
 	}
-	if value, ok := wuo.mutation.Ak(); ok {
-		_spec.SetField(whatsapp.FieldAk, field.TypeString, value)
+	if value, ok := wuo.mutation.WaID(); ok {
+		_spec.SetField(whatsapp.FieldWaID, field.TypeUint64, value)
 	}
-	if wuo.mutation.AkCleared() {
-		_spec.ClearField(whatsapp.FieldAk, field.TypeString)
+	if value, ok := wuo.mutation.AddedWaID(); ok {
+		_spec.AddField(whatsapp.FieldWaID, field.TypeUint64, value)
 	}
-	if value, ok := wuo.mutation.Sk(); ok {
-		_spec.SetField(whatsapp.FieldSk, field.TypeString, value)
+	if wuo.mutation.WaIDCleared() {
+		_spec.ClearField(whatsapp.FieldWaID, field.TypeUint64)
 	}
 	if value, ok := wuo.mutation.Callback(); ok {
 		_spec.SetField(whatsapp.FieldCallback, field.TypeString, value)
@@ -1036,6 +1101,15 @@ func (wuo *WhatsappUpdateOne) sqlSave(ctx context.Context) (_node *Whatsapp, err
 	if value, ok := wuo.mutation.Phone(); ok {
 		_spec.SetField(whatsapp.FieldPhone, field.TypeString, value)
 	}
+	if value, ok := wuo.mutation.PhoneName(); ok {
+		_spec.SetField(whatsapp.FieldPhoneName, field.TypeString, value)
+	}
+	if value, ok := wuo.mutation.PhoneStatus(); ok {
+		_spec.SetField(whatsapp.FieldPhoneStatus, field.TypeInt8, value)
+	}
+	if value, ok := wuo.mutation.AddedPhoneStatus(); ok {
+		_spec.AddField(whatsapp.FieldPhoneStatus, field.TypeInt8, value)
+	}
 	if value, ok := wuo.mutation.OrganizationID(); ok {
 		_spec.SetField(whatsapp.FieldOrganizationID, field.TypeUint64, value)
 	}

+ 227 - 0
ent/whatsappchannel.go

@@ -0,0 +1,227 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"fmt"
+	"strings"
+	"time"
+	"wechat-api/ent/whatsappchannel"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/sql"
+)
+
+// WhatsappChannel is the model entity for the WhatsappChannel schema.
+type WhatsappChannel struct {
+	config `json:"-"`
+	// ID of the ent.
+	ID uint64 `json:"id,omitempty"`
+	// Create Time | 创建日期
+	CreatedAt time.Time `json:"created_at,omitempty"`
+	// Update Time | 修改日期
+	UpdatedAt time.Time `json:"updated_at,omitempty"`
+	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
+	Status uint8 `json:"status,omitempty"`
+	// Delete Time | 删除日期
+	DeletedAt time.Time `json:"deleted_at,omitempty"`
+	// ak
+	Ak string `json:"ak,omitempty"`
+	// 端口号
+	Sk string `json:"sk,omitempty"`
+	// 通道ID
+	WaID uint64 `json:"wa_id,omitempty"`
+	// 通道名
+	WaName string `json:"wa_name,omitempty"`
+	// WABA ID
+	WabaID uint64 `json:"waba_id,omitempty"`
+	// 商业平台ID
+	BusinessID uint64 `json:"business_id,omitempty"`
+	// 机构 ID
+	OrganizationID uint64 `json:"organization_id,omitempty"`
+	// 认证主体
+	VerifyAccount string `json:"verify_account,omitempty"`
+	selectValues  sql.SelectValues
+}
+
+// scanValues returns the types for scanning values from sql.Rows.
+func (*WhatsappChannel) scanValues(columns []string) ([]any, error) {
+	values := make([]any, len(columns))
+	for i := range columns {
+		switch columns[i] {
+		case whatsappchannel.FieldID, whatsappchannel.FieldStatus, whatsappchannel.FieldWaID, whatsappchannel.FieldWabaID, whatsappchannel.FieldBusinessID, whatsappchannel.FieldOrganizationID:
+			values[i] = new(sql.NullInt64)
+		case whatsappchannel.FieldAk, whatsappchannel.FieldSk, whatsappchannel.FieldWaName, whatsappchannel.FieldVerifyAccount:
+			values[i] = new(sql.NullString)
+		case whatsappchannel.FieldCreatedAt, whatsappchannel.FieldUpdatedAt, whatsappchannel.FieldDeletedAt:
+			values[i] = new(sql.NullTime)
+		default:
+			values[i] = new(sql.UnknownType)
+		}
+	}
+	return values, nil
+}
+
+// assignValues assigns the values that were returned from sql.Rows (after scanning)
+// to the WhatsappChannel fields.
+func (wc *WhatsappChannel) assignValues(columns []string, values []any) error {
+	if m, n := len(values), len(columns); m < n {
+		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
+	}
+	for i := range columns {
+		switch columns[i] {
+		case whatsappchannel.FieldID:
+			value, ok := values[i].(*sql.NullInt64)
+			if !ok {
+				return fmt.Errorf("unexpected type %T for field id", value)
+			}
+			wc.ID = uint64(value.Int64)
+		case whatsappchannel.FieldCreatedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field created_at", values[i])
+			} else if value.Valid {
+				wc.CreatedAt = value.Time
+			}
+		case whatsappchannel.FieldUpdatedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
+			} else if value.Valid {
+				wc.UpdatedAt = value.Time
+			}
+		case whatsappchannel.FieldStatus:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field status", values[i])
+			} else if value.Valid {
+				wc.Status = uint8(value.Int64)
+			}
+		case whatsappchannel.FieldDeletedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field deleted_at", values[i])
+			} else if value.Valid {
+				wc.DeletedAt = value.Time
+			}
+		case whatsappchannel.FieldAk:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field ak", values[i])
+			} else if value.Valid {
+				wc.Ak = value.String
+			}
+		case whatsappchannel.FieldSk:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field sk", values[i])
+			} else if value.Valid {
+				wc.Sk = value.String
+			}
+		case whatsappchannel.FieldWaID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field wa_id", values[i])
+			} else if value.Valid {
+				wc.WaID = uint64(value.Int64)
+			}
+		case whatsappchannel.FieldWaName:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field wa_name", values[i])
+			} else if value.Valid {
+				wc.WaName = value.String
+			}
+		case whatsappchannel.FieldWabaID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field waba_id", values[i])
+			} else if value.Valid {
+				wc.WabaID = uint64(value.Int64)
+			}
+		case whatsappchannel.FieldBusinessID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field business_id", values[i])
+			} else if value.Valid {
+				wc.BusinessID = uint64(value.Int64)
+			}
+		case whatsappchannel.FieldOrganizationID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field organization_id", values[i])
+			} else if value.Valid {
+				wc.OrganizationID = uint64(value.Int64)
+			}
+		case whatsappchannel.FieldVerifyAccount:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field verify_account", values[i])
+			} else if value.Valid {
+				wc.VerifyAccount = value.String
+			}
+		default:
+			wc.selectValues.Set(columns[i], values[i])
+		}
+	}
+	return nil
+}
+
+// Value returns the ent.Value that was dynamically selected and assigned to the WhatsappChannel.
+// This includes values selected through modifiers, order, etc.
+func (wc *WhatsappChannel) Value(name string) (ent.Value, error) {
+	return wc.selectValues.Get(name)
+}
+
+// Update returns a builder for updating this WhatsappChannel.
+// Note that you need to call WhatsappChannel.Unwrap() before calling this method if this WhatsappChannel
+// was returned from a transaction, and the transaction was committed or rolled back.
+func (wc *WhatsappChannel) Update() *WhatsappChannelUpdateOne {
+	return NewWhatsappChannelClient(wc.config).UpdateOne(wc)
+}
+
+// Unwrap unwraps the WhatsappChannel entity that was returned from a transaction after it was closed,
+// so that all future queries will be executed through the driver which created the transaction.
+func (wc *WhatsappChannel) Unwrap() *WhatsappChannel {
+	_tx, ok := wc.config.driver.(*txDriver)
+	if !ok {
+		panic("ent: WhatsappChannel is not a transactional entity")
+	}
+	wc.config.driver = _tx.drv
+	return wc
+}
+
+// String implements the fmt.Stringer.
+func (wc *WhatsappChannel) String() string {
+	var builder strings.Builder
+	builder.WriteString("WhatsappChannel(")
+	builder.WriteString(fmt.Sprintf("id=%v, ", wc.ID))
+	builder.WriteString("created_at=")
+	builder.WriteString(wc.CreatedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("updated_at=")
+	builder.WriteString(wc.UpdatedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("status=")
+	builder.WriteString(fmt.Sprintf("%v", wc.Status))
+	builder.WriteString(", ")
+	builder.WriteString("deleted_at=")
+	builder.WriteString(wc.DeletedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("ak=")
+	builder.WriteString(wc.Ak)
+	builder.WriteString(", ")
+	builder.WriteString("sk=")
+	builder.WriteString(wc.Sk)
+	builder.WriteString(", ")
+	builder.WriteString("wa_id=")
+	builder.WriteString(fmt.Sprintf("%v", wc.WaID))
+	builder.WriteString(", ")
+	builder.WriteString("wa_name=")
+	builder.WriteString(wc.WaName)
+	builder.WriteString(", ")
+	builder.WriteString("waba_id=")
+	builder.WriteString(fmt.Sprintf("%v", wc.WabaID))
+	builder.WriteString(", ")
+	builder.WriteString("business_id=")
+	builder.WriteString(fmt.Sprintf("%v", wc.BusinessID))
+	builder.WriteString(", ")
+	builder.WriteString("organization_id=")
+	builder.WriteString(fmt.Sprintf("%v", wc.OrganizationID))
+	builder.WriteString(", ")
+	builder.WriteString("verify_account=")
+	builder.WriteString(wc.VerifyAccount)
+	builder.WriteByte(')')
+	return builder.String()
+}
+
+// WhatsappChannels is a parsable slice of WhatsappChannel.
+type WhatsappChannels []*WhatsappChannel

+ 172 - 0
ent/whatsappchannel/whatsappchannel.go

@@ -0,0 +1,172 @@
+// Code generated by ent, DO NOT EDIT.
+
+package whatsappchannel
+
+import (
+	"time"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/sql"
+)
+
+const (
+	// Label holds the string label denoting the whatsappchannel type in the database.
+	Label = "whatsapp_channel"
+	// FieldID holds the string denoting the id field in the database.
+	FieldID = "id"
+	// FieldCreatedAt holds the string denoting the created_at field in the database.
+	FieldCreatedAt = "created_at"
+	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
+	FieldUpdatedAt = "updated_at"
+	// FieldStatus holds the string denoting the status field in the database.
+	FieldStatus = "status"
+	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
+	FieldDeletedAt = "deleted_at"
+	// FieldAk holds the string denoting the ak field in the database.
+	FieldAk = "ak"
+	// FieldSk holds the string denoting the sk field in the database.
+	FieldSk = "sk"
+	// FieldWaID holds the string denoting the wa_id field in the database.
+	FieldWaID = "wa_id"
+	// FieldWaName holds the string denoting the wa_name field in the database.
+	FieldWaName = "wa_name"
+	// FieldWabaID holds the string denoting the waba_id field in the database.
+	FieldWabaID = "waba_id"
+	// FieldBusinessID holds the string denoting the business_id field in the database.
+	FieldBusinessID = "business_id"
+	// FieldOrganizationID holds the string denoting the organization_id field in the database.
+	FieldOrganizationID = "organization_id"
+	// FieldVerifyAccount holds the string denoting the verify_account field in the database.
+	FieldVerifyAccount = "verify_account"
+	// Table holds the table name of the whatsappchannel in the database.
+	Table = "whatsapp_channel"
+)
+
+// Columns holds all SQL columns for whatsappchannel fields.
+var Columns = []string{
+	FieldID,
+	FieldCreatedAt,
+	FieldUpdatedAt,
+	FieldStatus,
+	FieldDeletedAt,
+	FieldAk,
+	FieldSk,
+	FieldWaID,
+	FieldWaName,
+	FieldWabaID,
+	FieldBusinessID,
+	FieldOrganizationID,
+	FieldVerifyAccount,
+}
+
+// ValidColumn reports if the column name is valid (part of the table columns).
+func ValidColumn(column string) bool {
+	for i := range Columns {
+		if column == Columns[i] {
+			return true
+		}
+	}
+	return false
+}
+
+// Note that the variables below are initialized by the runtime
+// package on the initialization of the application. Therefore,
+// it should be imported in the main as follows:
+//
+//	import _ "wechat-api/ent/runtime"
+var (
+	Hooks        [1]ent.Hook
+	Interceptors [1]ent.Interceptor
+	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
+	DefaultCreatedAt func() time.Time
+	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
+	DefaultUpdatedAt func() time.Time
+	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
+	UpdateDefaultUpdatedAt func() time.Time
+	// DefaultStatus holds the default value on creation for the "status" field.
+	DefaultStatus uint8
+	// DefaultAk holds the default value on creation for the "ak" field.
+	DefaultAk string
+	// DefaultSk holds the default value on creation for the "sk" field.
+	DefaultSk string
+	// DefaultWaID holds the default value on creation for the "wa_id" field.
+	DefaultWaID uint64
+	// DefaultWaName holds the default value on creation for the "wa_name" field.
+	DefaultWaName string
+	// DefaultWabaID holds the default value on creation for the "waba_id" field.
+	DefaultWabaID uint64
+	// DefaultBusinessID holds the default value on creation for the "business_id" field.
+	DefaultBusinessID uint64
+	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
+	DefaultOrganizationID uint64
+	// DefaultVerifyAccount holds the default value on creation for the "verify_account" field.
+	DefaultVerifyAccount string
+)
+
+// OrderOption defines the ordering options for the WhatsappChannel queries.
+type OrderOption func(*sql.Selector)
+
+// ByID orders the results by the id field.
+func ByID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldID, opts...).ToFunc()
+}
+
+// ByCreatedAt orders the results by the created_at field.
+func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+}
+
+// ByUpdatedAt orders the results by the updated_at field.
+func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
+}
+
+// ByStatus orders the results by the status field.
+func ByStatus(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldStatus, opts...).ToFunc()
+}
+
+// ByDeletedAt orders the results by the deleted_at field.
+func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
+}
+
+// ByAk orders the results by the ak field.
+func ByAk(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldAk, opts...).ToFunc()
+}
+
+// BySk orders the results by the sk field.
+func BySk(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldSk, opts...).ToFunc()
+}
+
+// ByWaID orders the results by the wa_id field.
+func ByWaID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldWaID, opts...).ToFunc()
+}
+
+// ByWaName orders the results by the wa_name field.
+func ByWaName(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldWaName, opts...).ToFunc()
+}
+
+// ByWabaID orders the results by the waba_id field.
+func ByWabaID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldWabaID, opts...).ToFunc()
+}
+
+// ByBusinessID orders the results by the business_id field.
+func ByBusinessID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldBusinessID, opts...).ToFunc()
+}
+
+// ByOrganizationID orders the results by the organization_id field.
+func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
+}
+
+// ByVerifyAccount orders the results by the verify_account field.
+func ByVerifyAccount(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldVerifyAccount, opts...).ToFunc()
+}

+ 770 - 0
ent/whatsappchannel/where.go

@@ -0,0 +1,770 @@
+// Code generated by ent, DO NOT EDIT.
+
+package whatsappchannel
+
+import (
+	"time"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+)
+
+// ID filters vertices based on their ID field.
+func ID(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldID, id))
+}
+
+// IDEQ applies the EQ predicate on the ID field.
+func IDEQ(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldID, id))
+}
+
+// IDNEQ applies the NEQ predicate on the ID field.
+func IDNEQ(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldID, id))
+}
+
+// IDIn applies the In predicate on the ID field.
+func IDIn(ids ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldID, ids...))
+}
+
+// IDNotIn applies the NotIn predicate on the ID field.
+func IDNotIn(ids ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldID, ids...))
+}
+
+// IDGT applies the GT predicate on the ID field.
+func IDGT(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldID, id))
+}
+
+// IDGTE applies the GTE predicate on the ID field.
+func IDGTE(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldID, id))
+}
+
+// IDLT applies the LT predicate on the ID field.
+func IDLT(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldID, id))
+}
+
+// IDLTE applies the LTE predicate on the ID field.
+func IDLTE(id uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldID, id))
+}
+
+// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
+func CreatedAt(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
+func UpdatedAt(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
+func Status(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldStatus, v))
+}
+
+// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
+func DeletedAt(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldDeletedAt, v))
+}
+
+// Ak applies equality check predicate on the "ak" field. It's identical to AkEQ.
+func Ak(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldAk, v))
+}
+
+// Sk applies equality check predicate on the "sk" field. It's identical to SkEQ.
+func Sk(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldSk, v))
+}
+
+// WaID applies equality check predicate on the "wa_id" field. It's identical to WaIDEQ.
+func WaID(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWaID, v))
+}
+
+// WaName applies equality check predicate on the "wa_name" field. It's identical to WaNameEQ.
+func WaName(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWaName, v))
+}
+
+// WabaID applies equality check predicate on the "waba_id" field. It's identical to WabaIDEQ.
+func WabaID(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWabaID, v))
+}
+
+// BusinessID applies equality check predicate on the "business_id" field. It's identical to BusinessIDEQ.
+func BusinessID(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldBusinessID, v))
+}
+
+// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ.
+func OrganizationID(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldOrganizationID, v))
+}
+
+// VerifyAccount applies equality check predicate on the "verify_account" field. It's identical to VerifyAccountEQ.
+func VerifyAccount(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldVerifyAccount, v))
+}
+
+// CreatedAtEQ applies the EQ predicate on the "created_at" field.
+func CreatedAtEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
+func CreatedAtNEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtIn applies the In predicate on the "created_at" field.
+func CreatedAtIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
+func CreatedAtNotIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtGT applies the GT predicate on the "created_at" field.
+func CreatedAtGT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldCreatedAt, v))
+}
+
+// CreatedAtGTE applies the GTE predicate on the "created_at" field.
+func CreatedAtGTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldCreatedAt, v))
+}
+
+// CreatedAtLT applies the LT predicate on the "created_at" field.
+func CreatedAtLT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldCreatedAt, v))
+}
+
+// CreatedAtLTE applies the LTE predicate on the "created_at" field.
+func CreatedAtLTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldCreatedAt, v))
+}
+
+// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
+func UpdatedAtEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
+func UpdatedAtNEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtIn applies the In predicate on the "updated_at" field.
+func UpdatedAtIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
+func UpdatedAtNotIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtGT applies the GT predicate on the "updated_at" field.
+func UpdatedAtGT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
+func UpdatedAtGTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLT applies the LT predicate on the "updated_at" field.
+func UpdatedAtLT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
+func UpdatedAtLTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldUpdatedAt, v))
+}
+
+// StatusEQ applies the EQ predicate on the "status" field.
+func StatusEQ(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldStatus, v))
+}
+
+// StatusNEQ applies the NEQ predicate on the "status" field.
+func StatusNEQ(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldStatus, v))
+}
+
+// StatusIn applies the In predicate on the "status" field.
+func StatusIn(vs ...uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldStatus, vs...))
+}
+
+// StatusNotIn applies the NotIn predicate on the "status" field.
+func StatusNotIn(vs ...uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldStatus, vs...))
+}
+
+// StatusGT applies the GT predicate on the "status" field.
+func StatusGT(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldStatus, v))
+}
+
+// StatusGTE applies the GTE predicate on the "status" field.
+func StatusGTE(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldStatus, v))
+}
+
+// StatusLT applies the LT predicate on the "status" field.
+func StatusLT(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldStatus, v))
+}
+
+// StatusLTE applies the LTE predicate on the "status" field.
+func StatusLTE(v uint8) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldStatus, v))
+}
+
+// StatusIsNil applies the IsNil predicate on the "status" field.
+func StatusIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldStatus))
+}
+
+// StatusNotNil applies the NotNil predicate on the "status" field.
+func StatusNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldStatus))
+}
+
+// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
+func DeletedAtEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldDeletedAt, v))
+}
+
+// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
+func DeletedAtNEQ(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldDeletedAt, v))
+}
+
+// DeletedAtIn applies the In predicate on the "deleted_at" field.
+func DeletedAtIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldDeletedAt, vs...))
+}
+
+// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
+func DeletedAtNotIn(vs ...time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldDeletedAt, vs...))
+}
+
+// DeletedAtGT applies the GT predicate on the "deleted_at" field.
+func DeletedAtGT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldDeletedAt, v))
+}
+
+// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
+func DeletedAtGTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldDeletedAt, v))
+}
+
+// DeletedAtLT applies the LT predicate on the "deleted_at" field.
+func DeletedAtLT(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldDeletedAt, v))
+}
+
+// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
+func DeletedAtLTE(v time.Time) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldDeletedAt, v))
+}
+
+// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
+func DeletedAtIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldDeletedAt))
+}
+
+// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
+func DeletedAtNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldDeletedAt))
+}
+
+// AkEQ applies the EQ predicate on the "ak" field.
+func AkEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldAk, v))
+}
+
+// AkNEQ applies the NEQ predicate on the "ak" field.
+func AkNEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldAk, v))
+}
+
+// AkIn applies the In predicate on the "ak" field.
+func AkIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldAk, vs...))
+}
+
+// AkNotIn applies the NotIn predicate on the "ak" field.
+func AkNotIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldAk, vs...))
+}
+
+// AkGT applies the GT predicate on the "ak" field.
+func AkGT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldAk, v))
+}
+
+// AkGTE applies the GTE predicate on the "ak" field.
+func AkGTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldAk, v))
+}
+
+// AkLT applies the LT predicate on the "ak" field.
+func AkLT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldAk, v))
+}
+
+// AkLTE applies the LTE predicate on the "ak" field.
+func AkLTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldAk, v))
+}
+
+// AkContains applies the Contains predicate on the "ak" field.
+func AkContains(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContains(FieldAk, v))
+}
+
+// AkHasPrefix applies the HasPrefix predicate on the "ak" field.
+func AkHasPrefix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasPrefix(FieldAk, v))
+}
+
+// AkHasSuffix applies the HasSuffix predicate on the "ak" field.
+func AkHasSuffix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasSuffix(FieldAk, v))
+}
+
+// AkIsNil applies the IsNil predicate on the "ak" field.
+func AkIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldAk))
+}
+
+// AkNotNil applies the NotNil predicate on the "ak" field.
+func AkNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldAk))
+}
+
+// AkEqualFold applies the EqualFold predicate on the "ak" field.
+func AkEqualFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEqualFold(FieldAk, v))
+}
+
+// AkContainsFold applies the ContainsFold predicate on the "ak" field.
+func AkContainsFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContainsFold(FieldAk, v))
+}
+
+// SkEQ applies the EQ predicate on the "sk" field.
+func SkEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldSk, v))
+}
+
+// SkNEQ applies the NEQ predicate on the "sk" field.
+func SkNEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldSk, v))
+}
+
+// SkIn applies the In predicate on the "sk" field.
+func SkIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldSk, vs...))
+}
+
+// SkNotIn applies the NotIn predicate on the "sk" field.
+func SkNotIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldSk, vs...))
+}
+
+// SkGT applies the GT predicate on the "sk" field.
+func SkGT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldSk, v))
+}
+
+// SkGTE applies the GTE predicate on the "sk" field.
+func SkGTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldSk, v))
+}
+
+// SkLT applies the LT predicate on the "sk" field.
+func SkLT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldSk, v))
+}
+
+// SkLTE applies the LTE predicate on the "sk" field.
+func SkLTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldSk, v))
+}
+
+// SkContains applies the Contains predicate on the "sk" field.
+func SkContains(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContains(FieldSk, v))
+}
+
+// SkHasPrefix applies the HasPrefix predicate on the "sk" field.
+func SkHasPrefix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasPrefix(FieldSk, v))
+}
+
+// SkHasSuffix applies the HasSuffix predicate on the "sk" field.
+func SkHasSuffix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasSuffix(FieldSk, v))
+}
+
+// SkEqualFold applies the EqualFold predicate on the "sk" field.
+func SkEqualFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEqualFold(FieldSk, v))
+}
+
+// SkContainsFold applies the ContainsFold predicate on the "sk" field.
+func SkContainsFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContainsFold(FieldSk, v))
+}
+
+// WaIDEQ applies the EQ predicate on the "wa_id" field.
+func WaIDEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWaID, v))
+}
+
+// WaIDNEQ applies the NEQ predicate on the "wa_id" field.
+func WaIDNEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldWaID, v))
+}
+
+// WaIDIn applies the In predicate on the "wa_id" field.
+func WaIDIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldWaID, vs...))
+}
+
+// WaIDNotIn applies the NotIn predicate on the "wa_id" field.
+func WaIDNotIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldWaID, vs...))
+}
+
+// WaIDGT applies the GT predicate on the "wa_id" field.
+func WaIDGT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldWaID, v))
+}
+
+// WaIDGTE applies the GTE predicate on the "wa_id" field.
+func WaIDGTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldWaID, v))
+}
+
+// WaIDLT applies the LT predicate on the "wa_id" field.
+func WaIDLT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldWaID, v))
+}
+
+// WaIDLTE applies the LTE predicate on the "wa_id" field.
+func WaIDLTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldWaID, v))
+}
+
+// WaIDIsNil applies the IsNil predicate on the "wa_id" field.
+func WaIDIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldWaID))
+}
+
+// WaIDNotNil applies the NotNil predicate on the "wa_id" field.
+func WaIDNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldWaID))
+}
+
+// WaNameEQ applies the EQ predicate on the "wa_name" field.
+func WaNameEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWaName, v))
+}
+
+// WaNameNEQ applies the NEQ predicate on the "wa_name" field.
+func WaNameNEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldWaName, v))
+}
+
+// WaNameIn applies the In predicate on the "wa_name" field.
+func WaNameIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldWaName, vs...))
+}
+
+// WaNameNotIn applies the NotIn predicate on the "wa_name" field.
+func WaNameNotIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldWaName, vs...))
+}
+
+// WaNameGT applies the GT predicate on the "wa_name" field.
+func WaNameGT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldWaName, v))
+}
+
+// WaNameGTE applies the GTE predicate on the "wa_name" field.
+func WaNameGTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldWaName, v))
+}
+
+// WaNameLT applies the LT predicate on the "wa_name" field.
+func WaNameLT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldWaName, v))
+}
+
+// WaNameLTE applies the LTE predicate on the "wa_name" field.
+func WaNameLTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldWaName, v))
+}
+
+// WaNameContains applies the Contains predicate on the "wa_name" field.
+func WaNameContains(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContains(FieldWaName, v))
+}
+
+// WaNameHasPrefix applies the HasPrefix predicate on the "wa_name" field.
+func WaNameHasPrefix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasPrefix(FieldWaName, v))
+}
+
+// WaNameHasSuffix applies the HasSuffix predicate on the "wa_name" field.
+func WaNameHasSuffix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasSuffix(FieldWaName, v))
+}
+
+// WaNameIsNil applies the IsNil predicate on the "wa_name" field.
+func WaNameIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldWaName))
+}
+
+// WaNameNotNil applies the NotNil predicate on the "wa_name" field.
+func WaNameNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldWaName))
+}
+
+// WaNameEqualFold applies the EqualFold predicate on the "wa_name" field.
+func WaNameEqualFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEqualFold(FieldWaName, v))
+}
+
+// WaNameContainsFold applies the ContainsFold predicate on the "wa_name" field.
+func WaNameContainsFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContainsFold(FieldWaName, v))
+}
+
+// WabaIDEQ applies the EQ predicate on the "waba_id" field.
+func WabaIDEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldWabaID, v))
+}
+
+// WabaIDNEQ applies the NEQ predicate on the "waba_id" field.
+func WabaIDNEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldWabaID, v))
+}
+
+// WabaIDIn applies the In predicate on the "waba_id" field.
+func WabaIDIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldWabaID, vs...))
+}
+
+// WabaIDNotIn applies the NotIn predicate on the "waba_id" field.
+func WabaIDNotIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldWabaID, vs...))
+}
+
+// WabaIDGT applies the GT predicate on the "waba_id" field.
+func WabaIDGT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldWabaID, v))
+}
+
+// WabaIDGTE applies the GTE predicate on the "waba_id" field.
+func WabaIDGTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldWabaID, v))
+}
+
+// WabaIDLT applies the LT predicate on the "waba_id" field.
+func WabaIDLT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldWabaID, v))
+}
+
+// WabaIDLTE applies the LTE predicate on the "waba_id" field.
+func WabaIDLTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldWabaID, v))
+}
+
+// BusinessIDEQ applies the EQ predicate on the "business_id" field.
+func BusinessIDEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldBusinessID, v))
+}
+
+// BusinessIDNEQ applies the NEQ predicate on the "business_id" field.
+func BusinessIDNEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldBusinessID, v))
+}
+
+// BusinessIDIn applies the In predicate on the "business_id" field.
+func BusinessIDIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldBusinessID, vs...))
+}
+
+// BusinessIDNotIn applies the NotIn predicate on the "business_id" field.
+func BusinessIDNotIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldBusinessID, vs...))
+}
+
+// BusinessIDGT applies the GT predicate on the "business_id" field.
+func BusinessIDGT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldBusinessID, v))
+}
+
+// BusinessIDGTE applies the GTE predicate on the "business_id" field.
+func BusinessIDGTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldBusinessID, v))
+}
+
+// BusinessIDLT applies the LT predicate on the "business_id" field.
+func BusinessIDLT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldBusinessID, v))
+}
+
+// BusinessIDLTE applies the LTE predicate on the "business_id" field.
+func BusinessIDLTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldBusinessID, v))
+}
+
+// OrganizationIDEQ applies the EQ predicate on the "organization_id" field.
+func OrganizationIDEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field.
+func OrganizationIDNEQ(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDIn applies the In predicate on the "organization_id" field.
+func OrganizationIDIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field.
+func OrganizationIDNotIn(vs ...uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDGT applies the GT predicate on the "organization_id" field.
+func OrganizationIDGT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldOrganizationID, v))
+}
+
+// OrganizationIDGTE applies the GTE predicate on the "organization_id" field.
+func OrganizationIDGTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldOrganizationID, v))
+}
+
+// OrganizationIDLT applies the LT predicate on the "organization_id" field.
+func OrganizationIDLT(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldOrganizationID, v))
+}
+
+// OrganizationIDLTE applies the LTE predicate on the "organization_id" field.
+func OrganizationIDLTE(v uint64) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldOrganizationID, v))
+}
+
+// OrganizationIDIsNil applies the IsNil predicate on the "organization_id" field.
+func OrganizationIDIsNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIsNull(FieldOrganizationID))
+}
+
+// OrganizationIDNotNil applies the NotNil predicate on the "organization_id" field.
+func OrganizationIDNotNil() predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotNull(FieldOrganizationID))
+}
+
+// VerifyAccountEQ applies the EQ predicate on the "verify_account" field.
+func VerifyAccountEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEQ(FieldVerifyAccount, v))
+}
+
+// VerifyAccountNEQ applies the NEQ predicate on the "verify_account" field.
+func VerifyAccountNEQ(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNEQ(FieldVerifyAccount, v))
+}
+
+// VerifyAccountIn applies the In predicate on the "verify_account" field.
+func VerifyAccountIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldIn(FieldVerifyAccount, vs...))
+}
+
+// VerifyAccountNotIn applies the NotIn predicate on the "verify_account" field.
+func VerifyAccountNotIn(vs ...string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldNotIn(FieldVerifyAccount, vs...))
+}
+
+// VerifyAccountGT applies the GT predicate on the "verify_account" field.
+func VerifyAccountGT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGT(FieldVerifyAccount, v))
+}
+
+// VerifyAccountGTE applies the GTE predicate on the "verify_account" field.
+func VerifyAccountGTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldGTE(FieldVerifyAccount, v))
+}
+
+// VerifyAccountLT applies the LT predicate on the "verify_account" field.
+func VerifyAccountLT(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLT(FieldVerifyAccount, v))
+}
+
+// VerifyAccountLTE applies the LTE predicate on the "verify_account" field.
+func VerifyAccountLTE(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldLTE(FieldVerifyAccount, v))
+}
+
+// VerifyAccountContains applies the Contains predicate on the "verify_account" field.
+func VerifyAccountContains(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContains(FieldVerifyAccount, v))
+}
+
+// VerifyAccountHasPrefix applies the HasPrefix predicate on the "verify_account" field.
+func VerifyAccountHasPrefix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasPrefix(FieldVerifyAccount, v))
+}
+
+// VerifyAccountHasSuffix applies the HasSuffix predicate on the "verify_account" field.
+func VerifyAccountHasSuffix(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldHasSuffix(FieldVerifyAccount, v))
+}
+
+// VerifyAccountEqualFold applies the EqualFold predicate on the "verify_account" field.
+func VerifyAccountEqualFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldEqualFold(FieldVerifyAccount, v))
+}
+
+// VerifyAccountContainsFold applies the ContainsFold predicate on the "verify_account" field.
+func VerifyAccountContainsFold(v string) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.FieldContainsFold(FieldVerifyAccount, v))
+}
+
+// And groups predicates with the AND operator between them.
+func And(predicates ...predicate.WhatsappChannel) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.AndPredicates(predicates...))
+}
+
+// Or groups predicates with the OR operator between them.
+func Or(predicates ...predicate.WhatsappChannel) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.OrPredicates(predicates...))
+}
+
+// Not applies the not operator on the given predicate.
+func Not(p predicate.WhatsappChannel) predicate.WhatsappChannel {
+	return predicate.WhatsappChannel(sql.NotPredicates(p))
+}

+ 1391 - 0
ent/whatsappchannel_create.go

@@ -0,0 +1,1391 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"time"
+	"wechat-api/ent/whatsappchannel"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// WhatsappChannelCreate is the builder for creating a WhatsappChannel entity.
+type WhatsappChannelCreate struct {
+	config
+	mutation *WhatsappChannelMutation
+	hooks    []Hook
+	conflict []sql.ConflictOption
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (wcc *WhatsappChannelCreate) SetCreatedAt(t time.Time) *WhatsappChannelCreate {
+	wcc.mutation.SetCreatedAt(t)
+	return wcc
+}
+
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableCreatedAt(t *time.Time) *WhatsappChannelCreate {
+	if t != nil {
+		wcc.SetCreatedAt(*t)
+	}
+	return wcc
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (wcc *WhatsappChannelCreate) SetUpdatedAt(t time.Time) *WhatsappChannelCreate {
+	wcc.mutation.SetUpdatedAt(t)
+	return wcc
+}
+
+// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableUpdatedAt(t *time.Time) *WhatsappChannelCreate {
+	if t != nil {
+		wcc.SetUpdatedAt(*t)
+	}
+	return wcc
+}
+
+// SetStatus sets the "status" field.
+func (wcc *WhatsappChannelCreate) SetStatus(u uint8) *WhatsappChannelCreate {
+	wcc.mutation.SetStatus(u)
+	return wcc
+}
+
+// SetNillableStatus sets the "status" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableStatus(u *uint8) *WhatsappChannelCreate {
+	if u != nil {
+		wcc.SetStatus(*u)
+	}
+	return wcc
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (wcc *WhatsappChannelCreate) SetDeletedAt(t time.Time) *WhatsappChannelCreate {
+	wcc.mutation.SetDeletedAt(t)
+	return wcc
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableDeletedAt(t *time.Time) *WhatsappChannelCreate {
+	if t != nil {
+		wcc.SetDeletedAt(*t)
+	}
+	return wcc
+}
+
+// SetAk sets the "ak" field.
+func (wcc *WhatsappChannelCreate) SetAk(s string) *WhatsappChannelCreate {
+	wcc.mutation.SetAk(s)
+	return wcc
+}
+
+// SetNillableAk sets the "ak" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableAk(s *string) *WhatsappChannelCreate {
+	if s != nil {
+		wcc.SetAk(*s)
+	}
+	return wcc
+}
+
+// SetSk sets the "sk" field.
+func (wcc *WhatsappChannelCreate) SetSk(s string) *WhatsappChannelCreate {
+	wcc.mutation.SetSk(s)
+	return wcc
+}
+
+// SetNillableSk sets the "sk" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableSk(s *string) *WhatsappChannelCreate {
+	if s != nil {
+		wcc.SetSk(*s)
+	}
+	return wcc
+}
+
+// SetWaID sets the "wa_id" field.
+func (wcc *WhatsappChannelCreate) SetWaID(u uint64) *WhatsappChannelCreate {
+	wcc.mutation.SetWaID(u)
+	return wcc
+}
+
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableWaID(u *uint64) *WhatsappChannelCreate {
+	if u != nil {
+		wcc.SetWaID(*u)
+	}
+	return wcc
+}
+
+// SetWaName sets the "wa_name" field.
+func (wcc *WhatsappChannelCreate) SetWaName(s string) *WhatsappChannelCreate {
+	wcc.mutation.SetWaName(s)
+	return wcc
+}
+
+// SetNillableWaName sets the "wa_name" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableWaName(s *string) *WhatsappChannelCreate {
+	if s != nil {
+		wcc.SetWaName(*s)
+	}
+	return wcc
+}
+
+// SetWabaID sets the "waba_id" field.
+func (wcc *WhatsappChannelCreate) SetWabaID(u uint64) *WhatsappChannelCreate {
+	wcc.mutation.SetWabaID(u)
+	return wcc
+}
+
+// SetNillableWabaID sets the "waba_id" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableWabaID(u *uint64) *WhatsappChannelCreate {
+	if u != nil {
+		wcc.SetWabaID(*u)
+	}
+	return wcc
+}
+
+// SetBusinessID sets the "business_id" field.
+func (wcc *WhatsappChannelCreate) SetBusinessID(u uint64) *WhatsappChannelCreate {
+	wcc.mutation.SetBusinessID(u)
+	return wcc
+}
+
+// SetNillableBusinessID sets the "business_id" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableBusinessID(u *uint64) *WhatsappChannelCreate {
+	if u != nil {
+		wcc.SetBusinessID(*u)
+	}
+	return wcc
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (wcc *WhatsappChannelCreate) SetOrganizationID(u uint64) *WhatsappChannelCreate {
+	wcc.mutation.SetOrganizationID(u)
+	return wcc
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableOrganizationID(u *uint64) *WhatsappChannelCreate {
+	if u != nil {
+		wcc.SetOrganizationID(*u)
+	}
+	return wcc
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (wcc *WhatsappChannelCreate) SetVerifyAccount(s string) *WhatsappChannelCreate {
+	wcc.mutation.SetVerifyAccount(s)
+	return wcc
+}
+
+// SetNillableVerifyAccount sets the "verify_account" field if the given value is not nil.
+func (wcc *WhatsappChannelCreate) SetNillableVerifyAccount(s *string) *WhatsappChannelCreate {
+	if s != nil {
+		wcc.SetVerifyAccount(*s)
+	}
+	return wcc
+}
+
+// SetID sets the "id" field.
+func (wcc *WhatsappChannelCreate) SetID(u uint64) *WhatsappChannelCreate {
+	wcc.mutation.SetID(u)
+	return wcc
+}
+
+// Mutation returns the WhatsappChannelMutation object of the builder.
+func (wcc *WhatsappChannelCreate) Mutation() *WhatsappChannelMutation {
+	return wcc.mutation
+}
+
+// Save creates the WhatsappChannel in the database.
+func (wcc *WhatsappChannelCreate) Save(ctx context.Context) (*WhatsappChannel, error) {
+	if err := wcc.defaults(); err != nil {
+		return nil, err
+	}
+	return withHooks(ctx, wcc.sqlSave, wcc.mutation, wcc.hooks)
+}
+
+// SaveX calls Save and panics if Save returns an error.
+func (wcc *WhatsappChannelCreate) SaveX(ctx context.Context) *WhatsappChannel {
+	v, err := wcc.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (wcc *WhatsappChannelCreate) Exec(ctx context.Context) error {
+	_, err := wcc.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wcc *WhatsappChannelCreate) ExecX(ctx context.Context) {
+	if err := wcc.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (wcc *WhatsappChannelCreate) defaults() error {
+	if _, ok := wcc.mutation.CreatedAt(); !ok {
+		if whatsappchannel.DefaultCreatedAt == nil {
+			return fmt.Errorf("ent: uninitialized whatsappchannel.DefaultCreatedAt (forgotten import ent/runtime?)")
+		}
+		v := whatsappchannel.DefaultCreatedAt()
+		wcc.mutation.SetCreatedAt(v)
+	}
+	if _, ok := wcc.mutation.UpdatedAt(); !ok {
+		if whatsappchannel.DefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized whatsappchannel.DefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := whatsappchannel.DefaultUpdatedAt()
+		wcc.mutation.SetUpdatedAt(v)
+	}
+	if _, ok := wcc.mutation.Status(); !ok {
+		v := whatsappchannel.DefaultStatus
+		wcc.mutation.SetStatus(v)
+	}
+	if _, ok := wcc.mutation.Ak(); !ok {
+		v := whatsappchannel.DefaultAk
+		wcc.mutation.SetAk(v)
+	}
+	if _, ok := wcc.mutation.Sk(); !ok {
+		v := whatsappchannel.DefaultSk
+		wcc.mutation.SetSk(v)
+	}
+	if _, ok := wcc.mutation.WaID(); !ok {
+		v := whatsappchannel.DefaultWaID
+		wcc.mutation.SetWaID(v)
+	}
+	if _, ok := wcc.mutation.WaName(); !ok {
+		v := whatsappchannel.DefaultWaName
+		wcc.mutation.SetWaName(v)
+	}
+	if _, ok := wcc.mutation.WabaID(); !ok {
+		v := whatsappchannel.DefaultWabaID
+		wcc.mutation.SetWabaID(v)
+	}
+	if _, ok := wcc.mutation.BusinessID(); !ok {
+		v := whatsappchannel.DefaultBusinessID
+		wcc.mutation.SetBusinessID(v)
+	}
+	if _, ok := wcc.mutation.OrganizationID(); !ok {
+		v := whatsappchannel.DefaultOrganizationID
+		wcc.mutation.SetOrganizationID(v)
+	}
+	if _, ok := wcc.mutation.VerifyAccount(); !ok {
+		v := whatsappchannel.DefaultVerifyAccount
+		wcc.mutation.SetVerifyAccount(v)
+	}
+	return nil
+}
+
+// check runs all checks and user-defined validators on the builder.
+func (wcc *WhatsappChannelCreate) check() error {
+	if _, ok := wcc.mutation.CreatedAt(); !ok {
+		return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "WhatsappChannel.created_at"`)}
+	}
+	if _, ok := wcc.mutation.UpdatedAt(); !ok {
+		return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "WhatsappChannel.updated_at"`)}
+	}
+	if _, ok := wcc.mutation.Sk(); !ok {
+		return &ValidationError{Name: "sk", err: errors.New(`ent: missing required field "WhatsappChannel.sk"`)}
+	}
+	if _, ok := wcc.mutation.WabaID(); !ok {
+		return &ValidationError{Name: "waba_id", err: errors.New(`ent: missing required field "WhatsappChannel.waba_id"`)}
+	}
+	if _, ok := wcc.mutation.BusinessID(); !ok {
+		return &ValidationError{Name: "business_id", err: errors.New(`ent: missing required field "WhatsappChannel.business_id"`)}
+	}
+	if _, ok := wcc.mutation.VerifyAccount(); !ok {
+		return &ValidationError{Name: "verify_account", err: errors.New(`ent: missing required field "WhatsappChannel.verify_account"`)}
+	}
+	return nil
+}
+
+func (wcc *WhatsappChannelCreate) sqlSave(ctx context.Context) (*WhatsappChannel, error) {
+	if err := wcc.check(); err != nil {
+		return nil, err
+	}
+	_node, _spec := wcc.createSpec()
+	if err := sqlgraph.CreateNode(ctx, wcc.driver, _spec); err != nil {
+		if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	if _spec.ID.Value != _node.ID {
+		id := _spec.ID.Value.(int64)
+		_node.ID = uint64(id)
+	}
+	wcc.mutation.id = &_node.ID
+	wcc.mutation.done = true
+	return _node, nil
+}
+
+func (wcc *WhatsappChannelCreate) createSpec() (*WhatsappChannel, *sqlgraph.CreateSpec) {
+	var (
+		_node = &WhatsappChannel{config: wcc.config}
+		_spec = sqlgraph.NewCreateSpec(whatsappchannel.Table, sqlgraph.NewFieldSpec(whatsappchannel.FieldID, field.TypeUint64))
+	)
+	_spec.OnConflict = wcc.conflict
+	if id, ok := wcc.mutation.ID(); ok {
+		_node.ID = id
+		_spec.ID.Value = id
+	}
+	if value, ok := wcc.mutation.CreatedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldCreatedAt, field.TypeTime, value)
+		_node.CreatedAt = value
+	}
+	if value, ok := wcc.mutation.UpdatedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldUpdatedAt, field.TypeTime, value)
+		_node.UpdatedAt = value
+	}
+	if value, ok := wcc.mutation.Status(); ok {
+		_spec.SetField(whatsappchannel.FieldStatus, field.TypeUint8, value)
+		_node.Status = value
+	}
+	if value, ok := wcc.mutation.DeletedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldDeletedAt, field.TypeTime, value)
+		_node.DeletedAt = value
+	}
+	if value, ok := wcc.mutation.Ak(); ok {
+		_spec.SetField(whatsappchannel.FieldAk, field.TypeString, value)
+		_node.Ak = value
+	}
+	if value, ok := wcc.mutation.Sk(); ok {
+		_spec.SetField(whatsappchannel.FieldSk, field.TypeString, value)
+		_node.Sk = value
+	}
+	if value, ok := wcc.mutation.WaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWaID, field.TypeUint64, value)
+		_node.WaID = value
+	}
+	if value, ok := wcc.mutation.WaName(); ok {
+		_spec.SetField(whatsappchannel.FieldWaName, field.TypeString, value)
+		_node.WaName = value
+	}
+	if value, ok := wcc.mutation.WabaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWabaID, field.TypeUint64, value)
+		_node.WabaID = value
+	}
+	if value, ok := wcc.mutation.BusinessID(); ok {
+		_spec.SetField(whatsappchannel.FieldBusinessID, field.TypeUint64, value)
+		_node.BusinessID = value
+	}
+	if value, ok := wcc.mutation.OrganizationID(); ok {
+		_spec.SetField(whatsappchannel.FieldOrganizationID, field.TypeUint64, value)
+		_node.OrganizationID = value
+	}
+	if value, ok := wcc.mutation.VerifyAccount(); ok {
+		_spec.SetField(whatsappchannel.FieldVerifyAccount, field.TypeString, value)
+		_node.VerifyAccount = value
+	}
+	return _node, _spec
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.WhatsappChannel.Create().
+//		SetCreatedAt(v).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.WhatsappChannelUpsert) {
+//			SetCreatedAt(v+v).
+//		}).
+//		Exec(ctx)
+func (wcc *WhatsappChannelCreate) OnConflict(opts ...sql.ConflictOption) *WhatsappChannelUpsertOne {
+	wcc.conflict = opts
+	return &WhatsappChannelUpsertOne{
+		create: wcc,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (wcc *WhatsappChannelCreate) OnConflictColumns(columns ...string) *WhatsappChannelUpsertOne {
+	wcc.conflict = append(wcc.conflict, sql.ConflictColumns(columns...))
+	return &WhatsappChannelUpsertOne{
+		create: wcc,
+	}
+}
+
+type (
+	// WhatsappChannelUpsertOne is the builder for "upsert"-ing
+	//  one WhatsappChannel node.
+	WhatsappChannelUpsertOne struct {
+		create *WhatsappChannelCreate
+	}
+
+	// WhatsappChannelUpsert is the "OnConflict" setter.
+	WhatsappChannelUpsert struct {
+		*sql.UpdateSet
+	}
+)
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *WhatsappChannelUpsert) SetUpdatedAt(v time.Time) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldUpdatedAt, v)
+	return u
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateUpdatedAt() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldUpdatedAt)
+	return u
+}
+
+// SetStatus sets the "status" field.
+func (u *WhatsappChannelUpsert) SetStatus(v uint8) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldStatus, v)
+	return u
+}
+
+// UpdateStatus sets the "status" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateStatus() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldStatus)
+	return u
+}
+
+// AddStatus adds v to the "status" field.
+func (u *WhatsappChannelUpsert) AddStatus(v uint8) *WhatsappChannelUpsert {
+	u.Add(whatsappchannel.FieldStatus, v)
+	return u
+}
+
+// ClearStatus clears the value of the "status" field.
+func (u *WhatsappChannelUpsert) ClearStatus() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldStatus)
+	return u
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *WhatsappChannelUpsert) SetDeletedAt(v time.Time) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldDeletedAt, v)
+	return u
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateDeletedAt() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldDeletedAt)
+	return u
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *WhatsappChannelUpsert) ClearDeletedAt() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldDeletedAt)
+	return u
+}
+
+// SetAk sets the "ak" field.
+func (u *WhatsappChannelUpsert) SetAk(v string) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldAk, v)
+	return u
+}
+
+// UpdateAk sets the "ak" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateAk() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldAk)
+	return u
+}
+
+// ClearAk clears the value of the "ak" field.
+func (u *WhatsappChannelUpsert) ClearAk() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldAk)
+	return u
+}
+
+// SetSk sets the "sk" field.
+func (u *WhatsappChannelUpsert) SetSk(v string) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldSk, v)
+	return u
+}
+
+// UpdateSk sets the "sk" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateSk() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldSk)
+	return u
+}
+
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappChannelUpsert) SetWaID(v uint64) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldWaID, v)
+	return u
+}
+
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateWaID() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldWaID)
+	return u
+}
+
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappChannelUpsert) AddWaID(v uint64) *WhatsappChannelUpsert {
+	u.Add(whatsappchannel.FieldWaID, v)
+	return u
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappChannelUpsert) ClearWaID() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldWaID)
+	return u
+}
+
+// SetWaName sets the "wa_name" field.
+func (u *WhatsappChannelUpsert) SetWaName(v string) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldWaName, v)
+	return u
+}
+
+// UpdateWaName sets the "wa_name" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateWaName() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldWaName)
+	return u
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (u *WhatsappChannelUpsert) ClearWaName() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldWaName)
+	return u
+}
+
+// SetWabaID sets the "waba_id" field.
+func (u *WhatsappChannelUpsert) SetWabaID(v uint64) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldWabaID, v)
+	return u
+}
+
+// UpdateWabaID sets the "waba_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateWabaID() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldWabaID)
+	return u
+}
+
+// AddWabaID adds v to the "waba_id" field.
+func (u *WhatsappChannelUpsert) AddWabaID(v uint64) *WhatsappChannelUpsert {
+	u.Add(whatsappchannel.FieldWabaID, v)
+	return u
+}
+
+// SetBusinessID sets the "business_id" field.
+func (u *WhatsappChannelUpsert) SetBusinessID(v uint64) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldBusinessID, v)
+	return u
+}
+
+// UpdateBusinessID sets the "business_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateBusinessID() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldBusinessID)
+	return u
+}
+
+// AddBusinessID adds v to the "business_id" field.
+func (u *WhatsappChannelUpsert) AddBusinessID(v uint64) *WhatsappChannelUpsert {
+	u.Add(whatsappchannel.FieldBusinessID, v)
+	return u
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *WhatsappChannelUpsert) SetOrganizationID(v uint64) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldOrganizationID, v)
+	return u
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateOrganizationID() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldOrganizationID)
+	return u
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *WhatsappChannelUpsert) AddOrganizationID(v uint64) *WhatsappChannelUpsert {
+	u.Add(whatsappchannel.FieldOrganizationID, v)
+	return u
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *WhatsappChannelUpsert) ClearOrganizationID() *WhatsappChannelUpsert {
+	u.SetNull(whatsappchannel.FieldOrganizationID)
+	return u
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (u *WhatsappChannelUpsert) SetVerifyAccount(v string) *WhatsappChannelUpsert {
+	u.Set(whatsappchannel.FieldVerifyAccount, v)
+	return u
+}
+
+// UpdateVerifyAccount sets the "verify_account" field to the value that was provided on create.
+func (u *WhatsappChannelUpsert) UpdateVerifyAccount() *WhatsappChannelUpsert {
+	u.SetExcluded(whatsappchannel.FieldVerifyAccount)
+	return u
+}
+
+// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
+// Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(whatsappchannel.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *WhatsappChannelUpsertOne) UpdateNewValues() *WhatsappChannelUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		if _, exists := u.create.mutation.ID(); exists {
+			s.SetIgnore(whatsappchannel.FieldID)
+		}
+		if _, exists := u.create.mutation.CreatedAt(); exists {
+			s.SetIgnore(whatsappchannel.FieldCreatedAt)
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//	    OnConflict(sql.ResolveWithIgnore()).
+//	    Exec(ctx)
+func (u *WhatsappChannelUpsertOne) Ignore() *WhatsappChannelUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *WhatsappChannelUpsertOne) DoNothing() *WhatsappChannelUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the WhatsappChannelCreate.OnConflict
+// documentation for more info.
+func (u *WhatsappChannelUpsertOne) Update(set func(*WhatsappChannelUpsert)) *WhatsappChannelUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&WhatsappChannelUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *WhatsappChannelUpsertOne) SetUpdatedAt(v time.Time) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateUpdatedAt() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// SetStatus sets the "status" field.
+func (u *WhatsappChannelUpsertOne) SetStatus(v uint8) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetStatus(v)
+	})
+}
+
+// AddStatus adds v to the "status" field.
+func (u *WhatsappChannelUpsertOne) AddStatus(v uint8) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddStatus(v)
+	})
+}
+
+// UpdateStatus sets the "status" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateStatus() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateStatus()
+	})
+}
+
+// ClearStatus clears the value of the "status" field.
+func (u *WhatsappChannelUpsertOne) ClearStatus() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearStatus()
+	})
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *WhatsappChannelUpsertOne) SetDeletedAt(v time.Time) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetDeletedAt(v)
+	})
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateDeletedAt() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateDeletedAt()
+	})
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *WhatsappChannelUpsertOne) ClearDeletedAt() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearDeletedAt()
+	})
+}
+
+// SetAk sets the "ak" field.
+func (u *WhatsappChannelUpsertOne) SetAk(v string) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetAk(v)
+	})
+}
+
+// UpdateAk sets the "ak" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateAk() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateAk()
+	})
+}
+
+// ClearAk clears the value of the "ak" field.
+func (u *WhatsappChannelUpsertOne) ClearAk() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearAk()
+	})
+}
+
+// SetSk sets the "sk" field.
+func (u *WhatsappChannelUpsertOne) SetSk(v string) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetSk(v)
+	})
+}
+
+// UpdateSk sets the "sk" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateSk() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateSk()
+	})
+}
+
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappChannelUpsertOne) SetWaID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWaID(v)
+	})
+}
+
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappChannelUpsertOne) AddWaID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddWaID(v)
+	})
+}
+
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateWaID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWaID()
+	})
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappChannelUpsertOne) ClearWaID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearWaID()
+	})
+}
+
+// SetWaName sets the "wa_name" field.
+func (u *WhatsappChannelUpsertOne) SetWaName(v string) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWaName(v)
+	})
+}
+
+// UpdateWaName sets the "wa_name" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateWaName() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWaName()
+	})
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (u *WhatsappChannelUpsertOne) ClearWaName() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearWaName()
+	})
+}
+
+// SetWabaID sets the "waba_id" field.
+func (u *WhatsappChannelUpsertOne) SetWabaID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWabaID(v)
+	})
+}
+
+// AddWabaID adds v to the "waba_id" field.
+func (u *WhatsappChannelUpsertOne) AddWabaID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddWabaID(v)
+	})
+}
+
+// UpdateWabaID sets the "waba_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateWabaID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWabaID()
+	})
+}
+
+// SetBusinessID sets the "business_id" field.
+func (u *WhatsappChannelUpsertOne) SetBusinessID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetBusinessID(v)
+	})
+}
+
+// AddBusinessID adds v to the "business_id" field.
+func (u *WhatsappChannelUpsertOne) AddBusinessID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddBusinessID(v)
+	})
+}
+
+// UpdateBusinessID sets the "business_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateBusinessID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateBusinessID()
+	})
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *WhatsappChannelUpsertOne) SetOrganizationID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *WhatsappChannelUpsertOne) AddOrganizationID(v uint64) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateOrganizationID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *WhatsappChannelUpsertOne) ClearOrganizationID() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearOrganizationID()
+	})
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (u *WhatsappChannelUpsertOne) SetVerifyAccount(v string) *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetVerifyAccount(v)
+	})
+}
+
+// UpdateVerifyAccount sets the "verify_account" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertOne) UpdateVerifyAccount() *WhatsappChannelUpsertOne {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateVerifyAccount()
+	})
+}
+
+// Exec executes the query.
+func (u *WhatsappChannelUpsertOne) Exec(ctx context.Context) error {
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for WhatsappChannelCreate.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *WhatsappChannelUpsertOne) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// Exec executes the UPSERT query and returns the inserted/updated ID.
+func (u *WhatsappChannelUpsertOne) ID(ctx context.Context) (id uint64, err error) {
+	node, err := u.create.Save(ctx)
+	if err != nil {
+		return id, err
+	}
+	return node.ID, nil
+}
+
+// IDX is like ID, but panics if an error occurs.
+func (u *WhatsappChannelUpsertOne) IDX(ctx context.Context) uint64 {
+	id, err := u.ID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// WhatsappChannelCreateBulk is the builder for creating many WhatsappChannel entities in bulk.
+type WhatsappChannelCreateBulk struct {
+	config
+	err      error
+	builders []*WhatsappChannelCreate
+	conflict []sql.ConflictOption
+}
+
+// Save creates the WhatsappChannel entities in the database.
+func (wccb *WhatsappChannelCreateBulk) Save(ctx context.Context) ([]*WhatsappChannel, error) {
+	if wccb.err != nil {
+		return nil, wccb.err
+	}
+	specs := make([]*sqlgraph.CreateSpec, len(wccb.builders))
+	nodes := make([]*WhatsappChannel, len(wccb.builders))
+	mutators := make([]Mutator, len(wccb.builders))
+	for i := range wccb.builders {
+		func(i int, root context.Context) {
+			builder := wccb.builders[i]
+			builder.defaults()
+			var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
+				mutation, ok := m.(*WhatsappChannelMutation)
+				if !ok {
+					return nil, fmt.Errorf("unexpected mutation type %T", m)
+				}
+				if err := builder.check(); err != nil {
+					return nil, err
+				}
+				builder.mutation = mutation
+				var err error
+				nodes[i], specs[i] = builder.createSpec()
+				if i < len(mutators)-1 {
+					_, err = mutators[i+1].Mutate(root, wccb.builders[i+1].mutation)
+				} else {
+					spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
+					spec.OnConflict = wccb.conflict
+					// Invoke the actual operation on the latest mutation in the chain.
+					if err = sqlgraph.BatchCreate(ctx, wccb.driver, spec); err != nil {
+						if sqlgraph.IsConstraintError(err) {
+							err = &ConstraintError{msg: err.Error(), wrap: err}
+						}
+					}
+				}
+				if err != nil {
+					return nil, err
+				}
+				mutation.id = &nodes[i].ID
+				if specs[i].ID.Value != nil && nodes[i].ID == 0 {
+					id := specs[i].ID.Value.(int64)
+					nodes[i].ID = uint64(id)
+				}
+				mutation.done = true
+				return nodes[i], nil
+			})
+			for i := len(builder.hooks) - 1; i >= 0; i-- {
+				mut = builder.hooks[i](mut)
+			}
+			mutators[i] = mut
+		}(i, ctx)
+	}
+	if len(mutators) > 0 {
+		if _, err := mutators[0].Mutate(ctx, wccb.builders[0].mutation); err != nil {
+			return nil, err
+		}
+	}
+	return nodes, nil
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (wccb *WhatsappChannelCreateBulk) SaveX(ctx context.Context) []*WhatsappChannel {
+	v, err := wccb.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (wccb *WhatsappChannelCreateBulk) Exec(ctx context.Context) error {
+	_, err := wccb.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wccb *WhatsappChannelCreateBulk) ExecX(ctx context.Context) {
+	if err := wccb.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.WhatsappChannel.CreateBulk(builders...).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.WhatsappChannelUpsert) {
+//			SetCreatedAt(v+v).
+//		}).
+//		Exec(ctx)
+func (wccb *WhatsappChannelCreateBulk) OnConflict(opts ...sql.ConflictOption) *WhatsappChannelUpsertBulk {
+	wccb.conflict = opts
+	return &WhatsappChannelUpsertBulk{
+		create: wccb,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (wccb *WhatsappChannelCreateBulk) OnConflictColumns(columns ...string) *WhatsappChannelUpsertBulk {
+	wccb.conflict = append(wccb.conflict, sql.ConflictColumns(columns...))
+	return &WhatsappChannelUpsertBulk{
+		create: wccb,
+	}
+}
+
+// WhatsappChannelUpsertBulk is the builder for "upsert"-ing
+// a bulk of WhatsappChannel nodes.
+type WhatsappChannelUpsertBulk struct {
+	create *WhatsappChannelCreateBulk
+}
+
+// UpdateNewValues updates the mutable fields using the new values that
+// were set on create. Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(whatsappchannel.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *WhatsappChannelUpsertBulk) UpdateNewValues() *WhatsappChannelUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		for _, b := range u.create.builders {
+			if _, exists := b.mutation.ID(); exists {
+				s.SetIgnore(whatsappchannel.FieldID)
+			}
+			if _, exists := b.mutation.CreatedAt(); exists {
+				s.SetIgnore(whatsappchannel.FieldCreatedAt)
+			}
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.WhatsappChannel.Create().
+//		OnConflict(sql.ResolveWithIgnore()).
+//		Exec(ctx)
+func (u *WhatsappChannelUpsertBulk) Ignore() *WhatsappChannelUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *WhatsappChannelUpsertBulk) DoNothing() *WhatsappChannelUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the WhatsappChannelCreateBulk.OnConflict
+// documentation for more info.
+func (u *WhatsappChannelUpsertBulk) Update(set func(*WhatsappChannelUpsert)) *WhatsappChannelUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&WhatsappChannelUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *WhatsappChannelUpsertBulk) SetUpdatedAt(v time.Time) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateUpdatedAt() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// SetStatus sets the "status" field.
+func (u *WhatsappChannelUpsertBulk) SetStatus(v uint8) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetStatus(v)
+	})
+}
+
+// AddStatus adds v to the "status" field.
+func (u *WhatsappChannelUpsertBulk) AddStatus(v uint8) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddStatus(v)
+	})
+}
+
+// UpdateStatus sets the "status" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateStatus() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateStatus()
+	})
+}
+
+// ClearStatus clears the value of the "status" field.
+func (u *WhatsappChannelUpsertBulk) ClearStatus() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearStatus()
+	})
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *WhatsappChannelUpsertBulk) SetDeletedAt(v time.Time) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetDeletedAt(v)
+	})
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateDeletedAt() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateDeletedAt()
+	})
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *WhatsappChannelUpsertBulk) ClearDeletedAt() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearDeletedAt()
+	})
+}
+
+// SetAk sets the "ak" field.
+func (u *WhatsappChannelUpsertBulk) SetAk(v string) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetAk(v)
+	})
+}
+
+// UpdateAk sets the "ak" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateAk() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateAk()
+	})
+}
+
+// ClearAk clears the value of the "ak" field.
+func (u *WhatsappChannelUpsertBulk) ClearAk() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearAk()
+	})
+}
+
+// SetSk sets the "sk" field.
+func (u *WhatsappChannelUpsertBulk) SetSk(v string) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetSk(v)
+	})
+}
+
+// UpdateSk sets the "sk" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateSk() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateSk()
+	})
+}
+
+// SetWaID sets the "wa_id" field.
+func (u *WhatsappChannelUpsertBulk) SetWaID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWaID(v)
+	})
+}
+
+// AddWaID adds v to the "wa_id" field.
+func (u *WhatsappChannelUpsertBulk) AddWaID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddWaID(v)
+	})
+}
+
+// UpdateWaID sets the "wa_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateWaID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWaID()
+	})
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (u *WhatsappChannelUpsertBulk) ClearWaID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearWaID()
+	})
+}
+
+// SetWaName sets the "wa_name" field.
+func (u *WhatsappChannelUpsertBulk) SetWaName(v string) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWaName(v)
+	})
+}
+
+// UpdateWaName sets the "wa_name" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateWaName() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWaName()
+	})
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (u *WhatsappChannelUpsertBulk) ClearWaName() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearWaName()
+	})
+}
+
+// SetWabaID sets the "waba_id" field.
+func (u *WhatsappChannelUpsertBulk) SetWabaID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetWabaID(v)
+	})
+}
+
+// AddWabaID adds v to the "waba_id" field.
+func (u *WhatsappChannelUpsertBulk) AddWabaID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddWabaID(v)
+	})
+}
+
+// UpdateWabaID sets the "waba_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateWabaID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateWabaID()
+	})
+}
+
+// SetBusinessID sets the "business_id" field.
+func (u *WhatsappChannelUpsertBulk) SetBusinessID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetBusinessID(v)
+	})
+}
+
+// AddBusinessID adds v to the "business_id" field.
+func (u *WhatsappChannelUpsertBulk) AddBusinessID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddBusinessID(v)
+	})
+}
+
+// UpdateBusinessID sets the "business_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateBusinessID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateBusinessID()
+	})
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *WhatsappChannelUpsertBulk) SetOrganizationID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *WhatsappChannelUpsertBulk) AddOrganizationID(v uint64) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateOrganizationID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *WhatsappChannelUpsertBulk) ClearOrganizationID() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.ClearOrganizationID()
+	})
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (u *WhatsappChannelUpsertBulk) SetVerifyAccount(v string) *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.SetVerifyAccount(v)
+	})
+}
+
+// UpdateVerifyAccount sets the "verify_account" field to the value that was provided on create.
+func (u *WhatsappChannelUpsertBulk) UpdateVerifyAccount() *WhatsappChannelUpsertBulk {
+	return u.Update(func(s *WhatsappChannelUpsert) {
+		s.UpdateVerifyAccount()
+	})
+}
+
+// Exec executes the query.
+func (u *WhatsappChannelUpsertBulk) Exec(ctx context.Context) error {
+	if u.create.err != nil {
+		return u.create.err
+	}
+	for i, b := range u.create.builders {
+		if len(b.conflict) != 0 {
+			return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the WhatsappChannelCreateBulk instead", i)
+		}
+	}
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for WhatsappChannelCreateBulk.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *WhatsappChannelUpsertBulk) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 88 - 0
ent/whatsappchannel_delete.go

@@ -0,0 +1,88 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/whatsappchannel"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// WhatsappChannelDelete is the builder for deleting a WhatsappChannel entity.
+type WhatsappChannelDelete struct {
+	config
+	hooks    []Hook
+	mutation *WhatsappChannelMutation
+}
+
+// Where appends a list predicates to the WhatsappChannelDelete builder.
+func (wcd *WhatsappChannelDelete) Where(ps ...predicate.WhatsappChannel) *WhatsappChannelDelete {
+	wcd.mutation.Where(ps...)
+	return wcd
+}
+
+// Exec executes the deletion query and returns how many vertices were deleted.
+func (wcd *WhatsappChannelDelete) Exec(ctx context.Context) (int, error) {
+	return withHooks(ctx, wcd.sqlExec, wcd.mutation, wcd.hooks)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wcd *WhatsappChannelDelete) ExecX(ctx context.Context) int {
+	n, err := wcd.Exec(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return n
+}
+
+func (wcd *WhatsappChannelDelete) sqlExec(ctx context.Context) (int, error) {
+	_spec := sqlgraph.NewDeleteSpec(whatsappchannel.Table, sqlgraph.NewFieldSpec(whatsappchannel.FieldID, field.TypeUint64))
+	if ps := wcd.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	affected, err := sqlgraph.DeleteNodes(ctx, wcd.driver, _spec)
+	if err != nil && sqlgraph.IsConstraintError(err) {
+		err = &ConstraintError{msg: err.Error(), wrap: err}
+	}
+	wcd.mutation.done = true
+	return affected, err
+}
+
+// WhatsappChannelDeleteOne is the builder for deleting a single WhatsappChannel entity.
+type WhatsappChannelDeleteOne struct {
+	wcd *WhatsappChannelDelete
+}
+
+// Where appends a list predicates to the WhatsappChannelDelete builder.
+func (wcdo *WhatsappChannelDeleteOne) Where(ps ...predicate.WhatsappChannel) *WhatsappChannelDeleteOne {
+	wcdo.wcd.mutation.Where(ps...)
+	return wcdo
+}
+
+// Exec executes the deletion query.
+func (wcdo *WhatsappChannelDeleteOne) Exec(ctx context.Context) error {
+	n, err := wcdo.wcd.Exec(ctx)
+	switch {
+	case err != nil:
+		return err
+	case n == 0:
+		return &NotFoundError{whatsappchannel.Label}
+	default:
+		return nil
+	}
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wcdo *WhatsappChannelDeleteOne) ExecX(ctx context.Context) {
+	if err := wcdo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 526 - 0
ent/whatsappchannel_query.go

@@ -0,0 +1,526 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"fmt"
+	"math"
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/whatsappchannel"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// WhatsappChannelQuery is the builder for querying WhatsappChannel entities.
+type WhatsappChannelQuery struct {
+	config
+	ctx        *QueryContext
+	order      []whatsappchannel.OrderOption
+	inters     []Interceptor
+	predicates []predicate.WhatsappChannel
+	// intermediate query (i.e. traversal path).
+	sql  *sql.Selector
+	path func(context.Context) (*sql.Selector, error)
+}
+
+// Where adds a new predicate for the WhatsappChannelQuery builder.
+func (wcq *WhatsappChannelQuery) Where(ps ...predicate.WhatsappChannel) *WhatsappChannelQuery {
+	wcq.predicates = append(wcq.predicates, ps...)
+	return wcq
+}
+
+// Limit the number of records to be returned by this query.
+func (wcq *WhatsappChannelQuery) Limit(limit int) *WhatsappChannelQuery {
+	wcq.ctx.Limit = &limit
+	return wcq
+}
+
+// Offset to start from.
+func (wcq *WhatsappChannelQuery) Offset(offset int) *WhatsappChannelQuery {
+	wcq.ctx.Offset = &offset
+	return wcq
+}
+
+// Unique configures the query builder to filter duplicate records on query.
+// By default, unique is set to true, and can be disabled using this method.
+func (wcq *WhatsappChannelQuery) Unique(unique bool) *WhatsappChannelQuery {
+	wcq.ctx.Unique = &unique
+	return wcq
+}
+
+// Order specifies how the records should be ordered.
+func (wcq *WhatsappChannelQuery) Order(o ...whatsappchannel.OrderOption) *WhatsappChannelQuery {
+	wcq.order = append(wcq.order, o...)
+	return wcq
+}
+
+// First returns the first WhatsappChannel entity from the query.
+// Returns a *NotFoundError when no WhatsappChannel was found.
+func (wcq *WhatsappChannelQuery) First(ctx context.Context) (*WhatsappChannel, error) {
+	nodes, err := wcq.Limit(1).All(setContextOp(ctx, wcq.ctx, "First"))
+	if err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nil, &NotFoundError{whatsappchannel.Label}
+	}
+	return nodes[0], nil
+}
+
+// FirstX is like First, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) FirstX(ctx context.Context) *WhatsappChannel {
+	node, err := wcq.First(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return node
+}
+
+// FirstID returns the first WhatsappChannel ID from the query.
+// Returns a *NotFoundError when no WhatsappChannel ID was found.
+func (wcq *WhatsappChannelQuery) FirstID(ctx context.Context) (id uint64, err error) {
+	var ids []uint64
+	if ids, err = wcq.Limit(1).IDs(setContextOp(ctx, wcq.ctx, "FirstID")); err != nil {
+		return
+	}
+	if len(ids) == 0 {
+		err = &NotFoundError{whatsappchannel.Label}
+		return
+	}
+	return ids[0], nil
+}
+
+// FirstIDX is like FirstID, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) FirstIDX(ctx context.Context) uint64 {
+	id, err := wcq.FirstID(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return id
+}
+
+// Only returns a single WhatsappChannel entity found by the query, ensuring it only returns one.
+// Returns a *NotSingularError when more than one WhatsappChannel entity is found.
+// Returns a *NotFoundError when no WhatsappChannel entities are found.
+func (wcq *WhatsappChannelQuery) Only(ctx context.Context) (*WhatsappChannel, error) {
+	nodes, err := wcq.Limit(2).All(setContextOp(ctx, wcq.ctx, "Only"))
+	if err != nil {
+		return nil, err
+	}
+	switch len(nodes) {
+	case 1:
+		return nodes[0], nil
+	case 0:
+		return nil, &NotFoundError{whatsappchannel.Label}
+	default:
+		return nil, &NotSingularError{whatsappchannel.Label}
+	}
+}
+
+// OnlyX is like Only, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) OnlyX(ctx context.Context) *WhatsappChannel {
+	node, err := wcq.Only(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// OnlyID is like Only, but returns the only WhatsappChannel ID in the query.
+// Returns a *NotSingularError when more than one WhatsappChannel ID is found.
+// Returns a *NotFoundError when no entities are found.
+func (wcq *WhatsappChannelQuery) OnlyID(ctx context.Context) (id uint64, err error) {
+	var ids []uint64
+	if ids, err = wcq.Limit(2).IDs(setContextOp(ctx, wcq.ctx, "OnlyID")); err != nil {
+		return
+	}
+	switch len(ids) {
+	case 1:
+		id = ids[0]
+	case 0:
+		err = &NotFoundError{whatsappchannel.Label}
+	default:
+		err = &NotSingularError{whatsappchannel.Label}
+	}
+	return
+}
+
+// OnlyIDX is like OnlyID, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) OnlyIDX(ctx context.Context) uint64 {
+	id, err := wcq.OnlyID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// All executes the query and returns a list of WhatsappChannels.
+func (wcq *WhatsappChannelQuery) All(ctx context.Context) ([]*WhatsappChannel, error) {
+	ctx = setContextOp(ctx, wcq.ctx, "All")
+	if err := wcq.prepareQuery(ctx); err != nil {
+		return nil, err
+	}
+	qr := querierAll[[]*WhatsappChannel, *WhatsappChannelQuery]()
+	return withInterceptors[[]*WhatsappChannel](ctx, wcq, qr, wcq.inters)
+}
+
+// AllX is like All, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) AllX(ctx context.Context) []*WhatsappChannel {
+	nodes, err := wcq.All(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return nodes
+}
+
+// IDs executes the query and returns a list of WhatsappChannel IDs.
+func (wcq *WhatsappChannelQuery) IDs(ctx context.Context) (ids []uint64, err error) {
+	if wcq.ctx.Unique == nil && wcq.path != nil {
+		wcq.Unique(true)
+	}
+	ctx = setContextOp(ctx, wcq.ctx, "IDs")
+	if err = wcq.Select(whatsappchannel.FieldID).Scan(ctx, &ids); err != nil {
+		return nil, err
+	}
+	return ids, nil
+}
+
+// IDsX is like IDs, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) IDsX(ctx context.Context) []uint64 {
+	ids, err := wcq.IDs(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return ids
+}
+
+// Count returns the count of the given query.
+func (wcq *WhatsappChannelQuery) Count(ctx context.Context) (int, error) {
+	ctx = setContextOp(ctx, wcq.ctx, "Count")
+	if err := wcq.prepareQuery(ctx); err != nil {
+		return 0, err
+	}
+	return withInterceptors[int](ctx, wcq, querierCount[*WhatsappChannelQuery](), wcq.inters)
+}
+
+// CountX is like Count, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) CountX(ctx context.Context) int {
+	count, err := wcq.Count(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return count
+}
+
+// Exist returns true if the query has elements in the graph.
+func (wcq *WhatsappChannelQuery) Exist(ctx context.Context) (bool, error) {
+	ctx = setContextOp(ctx, wcq.ctx, "Exist")
+	switch _, err := wcq.FirstID(ctx); {
+	case IsNotFound(err):
+		return false, nil
+	case err != nil:
+		return false, fmt.Errorf("ent: check existence: %w", err)
+	default:
+		return true, nil
+	}
+}
+
+// ExistX is like Exist, but panics if an error occurs.
+func (wcq *WhatsappChannelQuery) ExistX(ctx context.Context) bool {
+	exist, err := wcq.Exist(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return exist
+}
+
+// Clone returns a duplicate of the WhatsappChannelQuery builder, including all associated steps. It can be
+// used to prepare common query builders and use them differently after the clone is made.
+func (wcq *WhatsappChannelQuery) Clone() *WhatsappChannelQuery {
+	if wcq == nil {
+		return nil
+	}
+	return &WhatsappChannelQuery{
+		config:     wcq.config,
+		ctx:        wcq.ctx.Clone(),
+		order:      append([]whatsappchannel.OrderOption{}, wcq.order...),
+		inters:     append([]Interceptor{}, wcq.inters...),
+		predicates: append([]predicate.WhatsappChannel{}, wcq.predicates...),
+		// clone intermediate query.
+		sql:  wcq.sql.Clone(),
+		path: wcq.path,
+	}
+}
+
+// GroupBy is used to group vertices by one or more fields/columns.
+// It is often used with aggregate functions, like: count, max, mean, min, sum.
+//
+// Example:
+//
+//	var v []struct {
+//		CreatedAt time.Time `json:"created_at,omitempty"`
+//		Count int `json:"count,omitempty"`
+//	}
+//
+//	client.WhatsappChannel.Query().
+//		GroupBy(whatsappchannel.FieldCreatedAt).
+//		Aggregate(ent.Count()).
+//		Scan(ctx, &v)
+func (wcq *WhatsappChannelQuery) GroupBy(field string, fields ...string) *WhatsappChannelGroupBy {
+	wcq.ctx.Fields = append([]string{field}, fields...)
+	grbuild := &WhatsappChannelGroupBy{build: wcq}
+	grbuild.flds = &wcq.ctx.Fields
+	grbuild.label = whatsappchannel.Label
+	grbuild.scan = grbuild.Scan
+	return grbuild
+}
+
+// Select allows the selection one or more fields/columns for the given query,
+// instead of selecting all fields in the entity.
+//
+// Example:
+//
+//	var v []struct {
+//		CreatedAt time.Time `json:"created_at,omitempty"`
+//	}
+//
+//	client.WhatsappChannel.Query().
+//		Select(whatsappchannel.FieldCreatedAt).
+//		Scan(ctx, &v)
+func (wcq *WhatsappChannelQuery) Select(fields ...string) *WhatsappChannelSelect {
+	wcq.ctx.Fields = append(wcq.ctx.Fields, fields...)
+	sbuild := &WhatsappChannelSelect{WhatsappChannelQuery: wcq}
+	sbuild.label = whatsappchannel.Label
+	sbuild.flds, sbuild.scan = &wcq.ctx.Fields, sbuild.Scan
+	return sbuild
+}
+
+// Aggregate returns a WhatsappChannelSelect configured with the given aggregations.
+func (wcq *WhatsappChannelQuery) Aggregate(fns ...AggregateFunc) *WhatsappChannelSelect {
+	return wcq.Select().Aggregate(fns...)
+}
+
+func (wcq *WhatsappChannelQuery) prepareQuery(ctx context.Context) error {
+	for _, inter := range wcq.inters {
+		if inter == nil {
+			return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
+		}
+		if trv, ok := inter.(Traverser); ok {
+			if err := trv.Traverse(ctx, wcq); err != nil {
+				return err
+			}
+		}
+	}
+	for _, f := range wcq.ctx.Fields {
+		if !whatsappchannel.ValidColumn(f) {
+			return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+		}
+	}
+	if wcq.path != nil {
+		prev, err := wcq.path(ctx)
+		if err != nil {
+			return err
+		}
+		wcq.sql = prev
+	}
+	return nil
+}
+
+func (wcq *WhatsappChannelQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*WhatsappChannel, error) {
+	var (
+		nodes = []*WhatsappChannel{}
+		_spec = wcq.querySpec()
+	)
+	_spec.ScanValues = func(columns []string) ([]any, error) {
+		return (*WhatsappChannel).scanValues(nil, columns)
+	}
+	_spec.Assign = func(columns []string, values []any) error {
+		node := &WhatsappChannel{config: wcq.config}
+		nodes = append(nodes, node)
+		return node.assignValues(columns, values)
+	}
+	for i := range hooks {
+		hooks[i](ctx, _spec)
+	}
+	if err := sqlgraph.QueryNodes(ctx, wcq.driver, _spec); err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nodes, nil
+	}
+	return nodes, nil
+}
+
+func (wcq *WhatsappChannelQuery) sqlCount(ctx context.Context) (int, error) {
+	_spec := wcq.querySpec()
+	_spec.Node.Columns = wcq.ctx.Fields
+	if len(wcq.ctx.Fields) > 0 {
+		_spec.Unique = wcq.ctx.Unique != nil && *wcq.ctx.Unique
+	}
+	return sqlgraph.CountNodes(ctx, wcq.driver, _spec)
+}
+
+func (wcq *WhatsappChannelQuery) querySpec() *sqlgraph.QuerySpec {
+	_spec := sqlgraph.NewQuerySpec(whatsappchannel.Table, whatsappchannel.Columns, sqlgraph.NewFieldSpec(whatsappchannel.FieldID, field.TypeUint64))
+	_spec.From = wcq.sql
+	if unique := wcq.ctx.Unique; unique != nil {
+		_spec.Unique = *unique
+	} else if wcq.path != nil {
+		_spec.Unique = true
+	}
+	if fields := wcq.ctx.Fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, whatsappchannel.FieldID)
+		for i := range fields {
+			if fields[i] != whatsappchannel.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
+			}
+		}
+	}
+	if ps := wcq.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if limit := wcq.ctx.Limit; limit != nil {
+		_spec.Limit = *limit
+	}
+	if offset := wcq.ctx.Offset; offset != nil {
+		_spec.Offset = *offset
+	}
+	if ps := wcq.order; len(ps) > 0 {
+		_spec.Order = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	return _spec
+}
+
+func (wcq *WhatsappChannelQuery) sqlQuery(ctx context.Context) *sql.Selector {
+	builder := sql.Dialect(wcq.driver.Dialect())
+	t1 := builder.Table(whatsappchannel.Table)
+	columns := wcq.ctx.Fields
+	if len(columns) == 0 {
+		columns = whatsappchannel.Columns
+	}
+	selector := builder.Select(t1.Columns(columns...)...).From(t1)
+	if wcq.sql != nil {
+		selector = wcq.sql
+		selector.Select(selector.Columns(columns...)...)
+	}
+	if wcq.ctx.Unique != nil && *wcq.ctx.Unique {
+		selector.Distinct()
+	}
+	for _, p := range wcq.predicates {
+		p(selector)
+	}
+	for _, p := range wcq.order {
+		p(selector)
+	}
+	if offset := wcq.ctx.Offset; offset != nil {
+		// limit is mandatory for offset clause. We start
+		// with default value, and override it below if needed.
+		selector.Offset(*offset).Limit(math.MaxInt32)
+	}
+	if limit := wcq.ctx.Limit; limit != nil {
+		selector.Limit(*limit)
+	}
+	return selector
+}
+
+// WhatsappChannelGroupBy is the group-by builder for WhatsappChannel entities.
+type WhatsappChannelGroupBy struct {
+	selector
+	build *WhatsappChannelQuery
+}
+
+// Aggregate adds the given aggregation functions to the group-by query.
+func (wcgb *WhatsappChannelGroupBy) Aggregate(fns ...AggregateFunc) *WhatsappChannelGroupBy {
+	wcgb.fns = append(wcgb.fns, fns...)
+	return wcgb
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (wcgb *WhatsappChannelGroupBy) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, wcgb.build.ctx, "GroupBy")
+	if err := wcgb.build.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*WhatsappChannelQuery, *WhatsappChannelGroupBy](ctx, wcgb.build, wcgb, wcgb.build.inters, v)
+}
+
+func (wcgb *WhatsappChannelGroupBy) sqlScan(ctx context.Context, root *WhatsappChannelQuery, v any) error {
+	selector := root.sqlQuery(ctx).Select()
+	aggregation := make([]string, 0, len(wcgb.fns))
+	for _, fn := range wcgb.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	if len(selector.SelectedColumns()) == 0 {
+		columns := make([]string, 0, len(*wcgb.flds)+len(wcgb.fns))
+		for _, f := range *wcgb.flds {
+			columns = append(columns, selector.C(f))
+		}
+		columns = append(columns, aggregation...)
+		selector.Select(columns...)
+	}
+	selector.GroupBy(selector.Columns(*wcgb.flds...)...)
+	if err := selector.Err(); err != nil {
+		return err
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := wcgb.build.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}
+
+// WhatsappChannelSelect is the builder for selecting fields of WhatsappChannel entities.
+type WhatsappChannelSelect struct {
+	*WhatsappChannelQuery
+	selector
+}
+
+// Aggregate adds the given aggregation functions to the selector query.
+func (wcs *WhatsappChannelSelect) Aggregate(fns ...AggregateFunc) *WhatsappChannelSelect {
+	wcs.fns = append(wcs.fns, fns...)
+	return wcs
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (wcs *WhatsappChannelSelect) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, wcs.ctx, "Select")
+	if err := wcs.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*WhatsappChannelQuery, *WhatsappChannelSelect](ctx, wcs.WhatsappChannelQuery, wcs, wcs.inters, v)
+}
+
+func (wcs *WhatsappChannelSelect) sqlScan(ctx context.Context, root *WhatsappChannelQuery, v any) error {
+	selector := root.sqlQuery(ctx)
+	aggregation := make([]string, 0, len(wcs.fns))
+	for _, fn := range wcs.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	switch n := len(*wcs.selector.flds); {
+	case n == 0 && len(aggregation) > 0:
+		selector.Select(aggregation...)
+	case n != 0 && len(aggregation) > 0:
+		selector.AppendSelect(aggregation...)
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := wcs.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}

+ 772 - 0
ent/whatsappchannel_update.go

@@ -0,0 +1,772 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"time"
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/whatsappchannel"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// WhatsappChannelUpdate is the builder for updating WhatsappChannel entities.
+type WhatsappChannelUpdate struct {
+	config
+	hooks    []Hook
+	mutation *WhatsappChannelMutation
+}
+
+// Where appends a list predicates to the WhatsappChannelUpdate builder.
+func (wcu *WhatsappChannelUpdate) Where(ps ...predicate.WhatsappChannel) *WhatsappChannelUpdate {
+	wcu.mutation.Where(ps...)
+	return wcu
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (wcu *WhatsappChannelUpdate) SetUpdatedAt(t time.Time) *WhatsappChannelUpdate {
+	wcu.mutation.SetUpdatedAt(t)
+	return wcu
+}
+
+// SetStatus sets the "status" field.
+func (wcu *WhatsappChannelUpdate) SetStatus(u uint8) *WhatsappChannelUpdate {
+	wcu.mutation.ResetStatus()
+	wcu.mutation.SetStatus(u)
+	return wcu
+}
+
+// SetNillableStatus sets the "status" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableStatus(u *uint8) *WhatsappChannelUpdate {
+	if u != nil {
+		wcu.SetStatus(*u)
+	}
+	return wcu
+}
+
+// AddStatus adds u to the "status" field.
+func (wcu *WhatsappChannelUpdate) AddStatus(u int8) *WhatsappChannelUpdate {
+	wcu.mutation.AddStatus(u)
+	return wcu
+}
+
+// ClearStatus clears the value of the "status" field.
+func (wcu *WhatsappChannelUpdate) ClearStatus() *WhatsappChannelUpdate {
+	wcu.mutation.ClearStatus()
+	return wcu
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (wcu *WhatsappChannelUpdate) SetDeletedAt(t time.Time) *WhatsappChannelUpdate {
+	wcu.mutation.SetDeletedAt(t)
+	return wcu
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableDeletedAt(t *time.Time) *WhatsappChannelUpdate {
+	if t != nil {
+		wcu.SetDeletedAt(*t)
+	}
+	return wcu
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (wcu *WhatsappChannelUpdate) ClearDeletedAt() *WhatsappChannelUpdate {
+	wcu.mutation.ClearDeletedAt()
+	return wcu
+}
+
+// SetAk sets the "ak" field.
+func (wcu *WhatsappChannelUpdate) SetAk(s string) *WhatsappChannelUpdate {
+	wcu.mutation.SetAk(s)
+	return wcu
+}
+
+// SetNillableAk sets the "ak" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableAk(s *string) *WhatsappChannelUpdate {
+	if s != nil {
+		wcu.SetAk(*s)
+	}
+	return wcu
+}
+
+// ClearAk clears the value of the "ak" field.
+func (wcu *WhatsappChannelUpdate) ClearAk() *WhatsappChannelUpdate {
+	wcu.mutation.ClearAk()
+	return wcu
+}
+
+// SetSk sets the "sk" field.
+func (wcu *WhatsappChannelUpdate) SetSk(s string) *WhatsappChannelUpdate {
+	wcu.mutation.SetSk(s)
+	return wcu
+}
+
+// SetNillableSk sets the "sk" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableSk(s *string) *WhatsappChannelUpdate {
+	if s != nil {
+		wcu.SetSk(*s)
+	}
+	return wcu
+}
+
+// SetWaID sets the "wa_id" field.
+func (wcu *WhatsappChannelUpdate) SetWaID(u uint64) *WhatsappChannelUpdate {
+	wcu.mutation.ResetWaID()
+	wcu.mutation.SetWaID(u)
+	return wcu
+}
+
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableWaID(u *uint64) *WhatsappChannelUpdate {
+	if u != nil {
+		wcu.SetWaID(*u)
+	}
+	return wcu
+}
+
+// AddWaID adds u to the "wa_id" field.
+func (wcu *WhatsappChannelUpdate) AddWaID(u int64) *WhatsappChannelUpdate {
+	wcu.mutation.AddWaID(u)
+	return wcu
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (wcu *WhatsappChannelUpdate) ClearWaID() *WhatsappChannelUpdate {
+	wcu.mutation.ClearWaID()
+	return wcu
+}
+
+// SetWaName sets the "wa_name" field.
+func (wcu *WhatsappChannelUpdate) SetWaName(s string) *WhatsappChannelUpdate {
+	wcu.mutation.SetWaName(s)
+	return wcu
+}
+
+// SetNillableWaName sets the "wa_name" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableWaName(s *string) *WhatsappChannelUpdate {
+	if s != nil {
+		wcu.SetWaName(*s)
+	}
+	return wcu
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (wcu *WhatsappChannelUpdate) ClearWaName() *WhatsappChannelUpdate {
+	wcu.mutation.ClearWaName()
+	return wcu
+}
+
+// SetWabaID sets the "waba_id" field.
+func (wcu *WhatsappChannelUpdate) SetWabaID(u uint64) *WhatsappChannelUpdate {
+	wcu.mutation.ResetWabaID()
+	wcu.mutation.SetWabaID(u)
+	return wcu
+}
+
+// SetNillableWabaID sets the "waba_id" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableWabaID(u *uint64) *WhatsappChannelUpdate {
+	if u != nil {
+		wcu.SetWabaID(*u)
+	}
+	return wcu
+}
+
+// AddWabaID adds u to the "waba_id" field.
+func (wcu *WhatsappChannelUpdate) AddWabaID(u int64) *WhatsappChannelUpdate {
+	wcu.mutation.AddWabaID(u)
+	return wcu
+}
+
+// SetBusinessID sets the "business_id" field.
+func (wcu *WhatsappChannelUpdate) SetBusinessID(u uint64) *WhatsappChannelUpdate {
+	wcu.mutation.ResetBusinessID()
+	wcu.mutation.SetBusinessID(u)
+	return wcu
+}
+
+// SetNillableBusinessID sets the "business_id" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableBusinessID(u *uint64) *WhatsappChannelUpdate {
+	if u != nil {
+		wcu.SetBusinessID(*u)
+	}
+	return wcu
+}
+
+// AddBusinessID adds u to the "business_id" field.
+func (wcu *WhatsappChannelUpdate) AddBusinessID(u int64) *WhatsappChannelUpdate {
+	wcu.mutation.AddBusinessID(u)
+	return wcu
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (wcu *WhatsappChannelUpdate) SetOrganizationID(u uint64) *WhatsappChannelUpdate {
+	wcu.mutation.ResetOrganizationID()
+	wcu.mutation.SetOrganizationID(u)
+	return wcu
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableOrganizationID(u *uint64) *WhatsappChannelUpdate {
+	if u != nil {
+		wcu.SetOrganizationID(*u)
+	}
+	return wcu
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (wcu *WhatsappChannelUpdate) AddOrganizationID(u int64) *WhatsappChannelUpdate {
+	wcu.mutation.AddOrganizationID(u)
+	return wcu
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (wcu *WhatsappChannelUpdate) ClearOrganizationID() *WhatsappChannelUpdate {
+	wcu.mutation.ClearOrganizationID()
+	return wcu
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (wcu *WhatsappChannelUpdate) SetVerifyAccount(s string) *WhatsappChannelUpdate {
+	wcu.mutation.SetVerifyAccount(s)
+	return wcu
+}
+
+// SetNillableVerifyAccount sets the "verify_account" field if the given value is not nil.
+func (wcu *WhatsappChannelUpdate) SetNillableVerifyAccount(s *string) *WhatsappChannelUpdate {
+	if s != nil {
+		wcu.SetVerifyAccount(*s)
+	}
+	return wcu
+}
+
+// Mutation returns the WhatsappChannelMutation object of the builder.
+func (wcu *WhatsappChannelUpdate) Mutation() *WhatsappChannelMutation {
+	return wcu.mutation
+}
+
+// Save executes the query and returns the number of nodes affected by the update operation.
+func (wcu *WhatsappChannelUpdate) Save(ctx context.Context) (int, error) {
+	if err := wcu.defaults(); err != nil {
+		return 0, err
+	}
+	return withHooks(ctx, wcu.sqlSave, wcu.mutation, wcu.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (wcu *WhatsappChannelUpdate) SaveX(ctx context.Context) int {
+	affected, err := wcu.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return affected
+}
+
+// Exec executes the query.
+func (wcu *WhatsappChannelUpdate) Exec(ctx context.Context) error {
+	_, err := wcu.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wcu *WhatsappChannelUpdate) ExecX(ctx context.Context) {
+	if err := wcu.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (wcu *WhatsappChannelUpdate) defaults() error {
+	if _, ok := wcu.mutation.UpdatedAt(); !ok {
+		if whatsappchannel.UpdateDefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized whatsappchannel.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := whatsappchannel.UpdateDefaultUpdatedAt()
+		wcu.mutation.SetUpdatedAt(v)
+	}
+	return nil
+}
+
+func (wcu *WhatsappChannelUpdate) sqlSave(ctx context.Context) (n int, err error) {
+	_spec := sqlgraph.NewUpdateSpec(whatsappchannel.Table, whatsappchannel.Columns, sqlgraph.NewFieldSpec(whatsappchannel.FieldID, field.TypeUint64))
+	if ps := wcu.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := wcu.mutation.UpdatedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldUpdatedAt, field.TypeTime, value)
+	}
+	if value, ok := wcu.mutation.Status(); ok {
+		_spec.SetField(whatsappchannel.FieldStatus, field.TypeUint8, value)
+	}
+	if value, ok := wcu.mutation.AddedStatus(); ok {
+		_spec.AddField(whatsappchannel.FieldStatus, field.TypeUint8, value)
+	}
+	if wcu.mutation.StatusCleared() {
+		_spec.ClearField(whatsappchannel.FieldStatus, field.TypeUint8)
+	}
+	if value, ok := wcu.mutation.DeletedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldDeletedAt, field.TypeTime, value)
+	}
+	if wcu.mutation.DeletedAtCleared() {
+		_spec.ClearField(whatsappchannel.FieldDeletedAt, field.TypeTime)
+	}
+	if value, ok := wcu.mutation.Ak(); ok {
+		_spec.SetField(whatsappchannel.FieldAk, field.TypeString, value)
+	}
+	if wcu.mutation.AkCleared() {
+		_spec.ClearField(whatsappchannel.FieldAk, field.TypeString)
+	}
+	if value, ok := wcu.mutation.Sk(); ok {
+		_spec.SetField(whatsappchannel.FieldSk, field.TypeString, value)
+	}
+	if value, ok := wcu.mutation.WaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWaID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.AddedWaID(); ok {
+		_spec.AddField(whatsappchannel.FieldWaID, field.TypeUint64, value)
+	}
+	if wcu.mutation.WaIDCleared() {
+		_spec.ClearField(whatsappchannel.FieldWaID, field.TypeUint64)
+	}
+	if value, ok := wcu.mutation.WaName(); ok {
+		_spec.SetField(whatsappchannel.FieldWaName, field.TypeString, value)
+	}
+	if wcu.mutation.WaNameCleared() {
+		_spec.ClearField(whatsappchannel.FieldWaName, field.TypeString)
+	}
+	if value, ok := wcu.mutation.WabaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWabaID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.AddedWabaID(); ok {
+		_spec.AddField(whatsappchannel.FieldWabaID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.BusinessID(); ok {
+		_spec.SetField(whatsappchannel.FieldBusinessID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.AddedBusinessID(); ok {
+		_spec.AddField(whatsappchannel.FieldBusinessID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.OrganizationID(); ok {
+		_spec.SetField(whatsappchannel.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := wcu.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(whatsappchannel.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if wcu.mutation.OrganizationIDCleared() {
+		_spec.ClearField(whatsappchannel.FieldOrganizationID, field.TypeUint64)
+	}
+	if value, ok := wcu.mutation.VerifyAccount(); ok {
+		_spec.SetField(whatsappchannel.FieldVerifyAccount, field.TypeString, value)
+	}
+	if n, err = sqlgraph.UpdateNodes(ctx, wcu.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{whatsappchannel.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return 0, err
+	}
+	wcu.mutation.done = true
+	return n, nil
+}
+
+// WhatsappChannelUpdateOne is the builder for updating a single WhatsappChannel entity.
+type WhatsappChannelUpdateOne struct {
+	config
+	fields   []string
+	hooks    []Hook
+	mutation *WhatsappChannelMutation
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (wcuo *WhatsappChannelUpdateOne) SetUpdatedAt(t time.Time) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetUpdatedAt(t)
+	return wcuo
+}
+
+// SetStatus sets the "status" field.
+func (wcuo *WhatsappChannelUpdateOne) SetStatus(u uint8) *WhatsappChannelUpdateOne {
+	wcuo.mutation.ResetStatus()
+	wcuo.mutation.SetStatus(u)
+	return wcuo
+}
+
+// SetNillableStatus sets the "status" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableStatus(u *uint8) *WhatsappChannelUpdateOne {
+	if u != nil {
+		wcuo.SetStatus(*u)
+	}
+	return wcuo
+}
+
+// AddStatus adds u to the "status" field.
+func (wcuo *WhatsappChannelUpdateOne) AddStatus(u int8) *WhatsappChannelUpdateOne {
+	wcuo.mutation.AddStatus(u)
+	return wcuo
+}
+
+// ClearStatus clears the value of the "status" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearStatus() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearStatus()
+	return wcuo
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (wcuo *WhatsappChannelUpdateOne) SetDeletedAt(t time.Time) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetDeletedAt(t)
+	return wcuo
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableDeletedAt(t *time.Time) *WhatsappChannelUpdateOne {
+	if t != nil {
+		wcuo.SetDeletedAt(*t)
+	}
+	return wcuo
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearDeletedAt() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearDeletedAt()
+	return wcuo
+}
+
+// SetAk sets the "ak" field.
+func (wcuo *WhatsappChannelUpdateOne) SetAk(s string) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetAk(s)
+	return wcuo
+}
+
+// SetNillableAk sets the "ak" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableAk(s *string) *WhatsappChannelUpdateOne {
+	if s != nil {
+		wcuo.SetAk(*s)
+	}
+	return wcuo
+}
+
+// ClearAk clears the value of the "ak" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearAk() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearAk()
+	return wcuo
+}
+
+// SetSk sets the "sk" field.
+func (wcuo *WhatsappChannelUpdateOne) SetSk(s string) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetSk(s)
+	return wcuo
+}
+
+// SetNillableSk sets the "sk" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableSk(s *string) *WhatsappChannelUpdateOne {
+	if s != nil {
+		wcuo.SetSk(*s)
+	}
+	return wcuo
+}
+
+// SetWaID sets the "wa_id" field.
+func (wcuo *WhatsappChannelUpdateOne) SetWaID(u uint64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.ResetWaID()
+	wcuo.mutation.SetWaID(u)
+	return wcuo
+}
+
+// SetNillableWaID sets the "wa_id" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableWaID(u *uint64) *WhatsappChannelUpdateOne {
+	if u != nil {
+		wcuo.SetWaID(*u)
+	}
+	return wcuo
+}
+
+// AddWaID adds u to the "wa_id" field.
+func (wcuo *WhatsappChannelUpdateOne) AddWaID(u int64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.AddWaID(u)
+	return wcuo
+}
+
+// ClearWaID clears the value of the "wa_id" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearWaID() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearWaID()
+	return wcuo
+}
+
+// SetWaName sets the "wa_name" field.
+func (wcuo *WhatsappChannelUpdateOne) SetWaName(s string) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetWaName(s)
+	return wcuo
+}
+
+// SetNillableWaName sets the "wa_name" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableWaName(s *string) *WhatsappChannelUpdateOne {
+	if s != nil {
+		wcuo.SetWaName(*s)
+	}
+	return wcuo
+}
+
+// ClearWaName clears the value of the "wa_name" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearWaName() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearWaName()
+	return wcuo
+}
+
+// SetWabaID sets the "waba_id" field.
+func (wcuo *WhatsappChannelUpdateOne) SetWabaID(u uint64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.ResetWabaID()
+	wcuo.mutation.SetWabaID(u)
+	return wcuo
+}
+
+// SetNillableWabaID sets the "waba_id" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableWabaID(u *uint64) *WhatsappChannelUpdateOne {
+	if u != nil {
+		wcuo.SetWabaID(*u)
+	}
+	return wcuo
+}
+
+// AddWabaID adds u to the "waba_id" field.
+func (wcuo *WhatsappChannelUpdateOne) AddWabaID(u int64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.AddWabaID(u)
+	return wcuo
+}
+
+// SetBusinessID sets the "business_id" field.
+func (wcuo *WhatsappChannelUpdateOne) SetBusinessID(u uint64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.ResetBusinessID()
+	wcuo.mutation.SetBusinessID(u)
+	return wcuo
+}
+
+// SetNillableBusinessID sets the "business_id" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableBusinessID(u *uint64) *WhatsappChannelUpdateOne {
+	if u != nil {
+		wcuo.SetBusinessID(*u)
+	}
+	return wcuo
+}
+
+// AddBusinessID adds u to the "business_id" field.
+func (wcuo *WhatsappChannelUpdateOne) AddBusinessID(u int64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.AddBusinessID(u)
+	return wcuo
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (wcuo *WhatsappChannelUpdateOne) SetOrganizationID(u uint64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.ResetOrganizationID()
+	wcuo.mutation.SetOrganizationID(u)
+	return wcuo
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableOrganizationID(u *uint64) *WhatsappChannelUpdateOne {
+	if u != nil {
+		wcuo.SetOrganizationID(*u)
+	}
+	return wcuo
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (wcuo *WhatsappChannelUpdateOne) AddOrganizationID(u int64) *WhatsappChannelUpdateOne {
+	wcuo.mutation.AddOrganizationID(u)
+	return wcuo
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (wcuo *WhatsappChannelUpdateOne) ClearOrganizationID() *WhatsappChannelUpdateOne {
+	wcuo.mutation.ClearOrganizationID()
+	return wcuo
+}
+
+// SetVerifyAccount sets the "verify_account" field.
+func (wcuo *WhatsappChannelUpdateOne) SetVerifyAccount(s string) *WhatsappChannelUpdateOne {
+	wcuo.mutation.SetVerifyAccount(s)
+	return wcuo
+}
+
+// SetNillableVerifyAccount sets the "verify_account" field if the given value is not nil.
+func (wcuo *WhatsappChannelUpdateOne) SetNillableVerifyAccount(s *string) *WhatsappChannelUpdateOne {
+	if s != nil {
+		wcuo.SetVerifyAccount(*s)
+	}
+	return wcuo
+}
+
+// Mutation returns the WhatsappChannelMutation object of the builder.
+func (wcuo *WhatsappChannelUpdateOne) Mutation() *WhatsappChannelMutation {
+	return wcuo.mutation
+}
+
+// Where appends a list predicates to the WhatsappChannelUpdate builder.
+func (wcuo *WhatsappChannelUpdateOne) Where(ps ...predicate.WhatsappChannel) *WhatsappChannelUpdateOne {
+	wcuo.mutation.Where(ps...)
+	return wcuo
+}
+
+// Select allows selecting one or more fields (columns) of the returned entity.
+// The default is selecting all fields defined in the entity schema.
+func (wcuo *WhatsappChannelUpdateOne) Select(field string, fields ...string) *WhatsappChannelUpdateOne {
+	wcuo.fields = append([]string{field}, fields...)
+	return wcuo
+}
+
+// Save executes the query and returns the updated WhatsappChannel entity.
+func (wcuo *WhatsappChannelUpdateOne) Save(ctx context.Context) (*WhatsappChannel, error) {
+	if err := wcuo.defaults(); err != nil {
+		return nil, err
+	}
+	return withHooks(ctx, wcuo.sqlSave, wcuo.mutation, wcuo.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (wcuo *WhatsappChannelUpdateOne) SaveX(ctx context.Context) *WhatsappChannel {
+	node, err := wcuo.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// Exec executes the query on the entity.
+func (wcuo *WhatsappChannelUpdateOne) Exec(ctx context.Context) error {
+	_, err := wcuo.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (wcuo *WhatsappChannelUpdateOne) ExecX(ctx context.Context) {
+	if err := wcuo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (wcuo *WhatsappChannelUpdateOne) defaults() error {
+	if _, ok := wcuo.mutation.UpdatedAt(); !ok {
+		if whatsappchannel.UpdateDefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized whatsappchannel.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := whatsappchannel.UpdateDefaultUpdatedAt()
+		wcuo.mutation.SetUpdatedAt(v)
+	}
+	return nil
+}
+
+func (wcuo *WhatsappChannelUpdateOne) sqlSave(ctx context.Context) (_node *WhatsappChannel, err error) {
+	_spec := sqlgraph.NewUpdateSpec(whatsappchannel.Table, whatsappchannel.Columns, sqlgraph.NewFieldSpec(whatsappchannel.FieldID, field.TypeUint64))
+	id, ok := wcuo.mutation.ID()
+	if !ok {
+		return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "WhatsappChannel.id" for update`)}
+	}
+	_spec.Node.ID.Value = id
+	if fields := wcuo.fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, whatsappchannel.FieldID)
+		for _, f := range fields {
+			if !whatsappchannel.ValidColumn(f) {
+				return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+			}
+			if f != whatsappchannel.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, f)
+			}
+		}
+	}
+	if ps := wcuo.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := wcuo.mutation.UpdatedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldUpdatedAt, field.TypeTime, value)
+	}
+	if value, ok := wcuo.mutation.Status(); ok {
+		_spec.SetField(whatsappchannel.FieldStatus, field.TypeUint8, value)
+	}
+	if value, ok := wcuo.mutation.AddedStatus(); ok {
+		_spec.AddField(whatsappchannel.FieldStatus, field.TypeUint8, value)
+	}
+	if wcuo.mutation.StatusCleared() {
+		_spec.ClearField(whatsappchannel.FieldStatus, field.TypeUint8)
+	}
+	if value, ok := wcuo.mutation.DeletedAt(); ok {
+		_spec.SetField(whatsappchannel.FieldDeletedAt, field.TypeTime, value)
+	}
+	if wcuo.mutation.DeletedAtCleared() {
+		_spec.ClearField(whatsappchannel.FieldDeletedAt, field.TypeTime)
+	}
+	if value, ok := wcuo.mutation.Ak(); ok {
+		_spec.SetField(whatsappchannel.FieldAk, field.TypeString, value)
+	}
+	if wcuo.mutation.AkCleared() {
+		_spec.ClearField(whatsappchannel.FieldAk, field.TypeString)
+	}
+	if value, ok := wcuo.mutation.Sk(); ok {
+		_spec.SetField(whatsappchannel.FieldSk, field.TypeString, value)
+	}
+	if value, ok := wcuo.mutation.WaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWaID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.AddedWaID(); ok {
+		_spec.AddField(whatsappchannel.FieldWaID, field.TypeUint64, value)
+	}
+	if wcuo.mutation.WaIDCleared() {
+		_spec.ClearField(whatsappchannel.FieldWaID, field.TypeUint64)
+	}
+	if value, ok := wcuo.mutation.WaName(); ok {
+		_spec.SetField(whatsappchannel.FieldWaName, field.TypeString, value)
+	}
+	if wcuo.mutation.WaNameCleared() {
+		_spec.ClearField(whatsappchannel.FieldWaName, field.TypeString)
+	}
+	if value, ok := wcuo.mutation.WabaID(); ok {
+		_spec.SetField(whatsappchannel.FieldWabaID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.AddedWabaID(); ok {
+		_spec.AddField(whatsappchannel.FieldWabaID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.BusinessID(); ok {
+		_spec.SetField(whatsappchannel.FieldBusinessID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.AddedBusinessID(); ok {
+		_spec.AddField(whatsappchannel.FieldBusinessID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.OrganizationID(); ok {
+		_spec.SetField(whatsappchannel.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := wcuo.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(whatsappchannel.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if wcuo.mutation.OrganizationIDCleared() {
+		_spec.ClearField(whatsappchannel.FieldOrganizationID, field.TypeUint64)
+	}
+	if value, ok := wcuo.mutation.VerifyAccount(); ok {
+		_spec.SetField(whatsappchannel.FieldVerifyAccount, field.TypeString, value)
+	}
+	_node = &WhatsappChannel{config: wcuo.config}
+	_spec.Assign = _node.assignValues
+	_spec.ScanValues = _node.scanValues
+	if err = sqlgraph.UpdateNode(ctx, wcuo.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{whatsappchannel.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	wcuo.mutation.done = true
+	return _node, nil
+}

+ 35 - 0
internal/handler/routes.go

@@ -42,6 +42,7 @@ import (
 	token "wechat-api/internal/handler/token"
 	tutorial "wechat-api/internal/handler/tutorial"
 	whatsapp "wechat-api/internal/handler/whatsapp"
+	whatsapp_channel "wechat-api/internal/handler/whatsapp_channel"
 	work_experience "wechat-api/internal/handler/work_experience"
 	wxcard "wechat-api/internal/handler/wxcard"
 	wxcarduser "wechat-api/internal/handler/wxcarduser"
@@ -1807,4 +1808,38 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		),
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodPost,
+					Path:    "/whatsapp_channel/create",
+					Handler: whatsapp_channel.CreateWhatsappChannelHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/whatsapp_channel/update",
+					Handler: whatsapp_channel.UpdateWhatsappChannelHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/whatsapp_channel/delete",
+					Handler: whatsapp_channel.DeleteWhatsappChannelHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/whatsapp_channel/list",
+					Handler: whatsapp_channel.GetWhatsappChannelListHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/whatsapp_channel",
+					Handler: whatsapp_channel.GetWhatsappChannelByIdHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
 }

+ 44 - 0
internal/handler/whatsapp_channel/create_whatsapp_channel_handler.go

@@ -0,0 +1,44 @@
+package whatsapp_channel
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/whatsapp_channel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /whatsapp_channel/create whatsapp_channel CreateWhatsappChannel
+//
+// Create whatsapp channel information | 创建WhatsappChannel
+//
+// Create whatsapp channel information | 创建WhatsappChannel
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: WhatsappChannelInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func CreateWhatsappChannelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.WhatsappChannelInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := whatsapp_channel.NewCreateWhatsappChannelLogic(r.Context(), svcCtx)
+		resp, err := l.CreateWhatsappChannel(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/whatsapp_channel/delete_whatsapp_channel_handler.go

@@ -0,0 +1,44 @@
+package whatsapp_channel
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/whatsapp_channel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /whatsapp_channel/delete whatsapp_channel DeleteWhatsappChannel
+//
+// Delete whatsapp channel information | 删除WhatsappChannel信息
+//
+// Delete whatsapp channel information | 删除WhatsappChannel信息
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDsReq
+//
+// Responses:
+//  200: BaseMsgResp
+
+func DeleteWhatsappChannelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDsReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := whatsapp_channel.NewDeleteWhatsappChannelLogic(r.Context(), svcCtx)
+		resp, err := l.DeleteWhatsappChannel(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/whatsapp_channel/get_whatsapp_channel_by_id_handler.go

@@ -0,0 +1,44 @@
+package whatsapp_channel
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/whatsapp_channel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /whatsapp_channel whatsapp_channel GetWhatsappChannelById
+//
+// Get whatsapp channel by ID | 通过ID获取WhatsappChannel
+//
+// Get whatsapp channel by ID | 通过ID获取WhatsappChannel
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDReq
+//
+// Responses:
+//  200: WhatsappChannelInfoResp
+
+func GetWhatsappChannelByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := whatsapp_channel.NewGetWhatsappChannelByIdLogic(r.Context(), svcCtx)
+		resp, err := l.GetWhatsappChannelById(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/whatsapp_channel/get_whatsapp_channel_list_handler.go

@@ -0,0 +1,44 @@
+package whatsapp_channel
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/whatsapp_channel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /whatsapp_channel/list whatsapp_channel GetWhatsappChannelList
+//
+// Get whatsapp channel list | 获取WhatsappChannel列表
+//
+// Get whatsapp channel list | 获取WhatsappChannel列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: WhatsappChannelListReq
+//
+// Responses:
+//  200: WhatsappChannelListResp
+
+func GetWhatsappChannelListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.WhatsappChannelListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := whatsapp_channel.NewGetWhatsappChannelListLogic(r.Context(), svcCtx)
+		resp, err := l.GetWhatsappChannelList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/whatsapp_channel/update_whatsapp_channel_handler.go

@@ -0,0 +1,44 @@
+package whatsapp_channel
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/whatsapp_channel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /whatsapp_channel/update whatsapp_channel UpdateWhatsappChannel
+//
+// Update whatsapp channel information | 更新WhatsappChannel
+//
+// Update whatsapp channel information | 更新WhatsappChannel
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: WhatsappChannelInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func UpdateWhatsappChannelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.WhatsappChannelInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := whatsapp_channel.NewUpdateWhatsappChannelLogic(r.Context(), svcCtx)
+		resp, err := l.UpdateWhatsappChannel(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 62 - 0
internal/logic/base/init_api_data.go

@@ -6,6 +6,68 @@ import (
 )
 
 func (l *InitDatabaseLogic) insertApiData() (err error) {
+	// WhatsappChannel
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/whatsapp_channel/create"),
+		Description: pointy.GetPointer("apiDesc.createWhatsappChannel"),
+		ApiGroup:    pointy.GetPointer("whatsapp_channel"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/whatsapp_channel/update"),
+		Description: pointy.GetPointer("apiDesc.updateWhatsappChannel"),
+		ApiGroup:    pointy.GetPointer("whatsapp_channel"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/whatsapp_channel/delete"),
+		Description: pointy.GetPointer("apiDesc.deleteWhatsappChannel"),
+		ApiGroup:    pointy.GetPointer("whatsapp_channel"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/whatsapp_channel/list"),
+		Description: pointy.GetPointer("apiDesc.getWhatsappChannelList"),
+		ApiGroup:    pointy.GetPointer("whatsapp_channel"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/whatsapp_channel"),
+		Description: pointy.GetPointer("apiDesc.getWhatsappChannelById"),
+		ApiGroup:    pointy.GetPointer("whatsapp_channel"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
 	// Whatsapp
 
 	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{

+ 3 - 2
internal/logic/whatsapp/create_whatsapp_logic.go

@@ -30,12 +30,13 @@ func (l *CreateWhatsappLogic) CreateWhatsapp(req *types.WhatsappInfo) (*types.Ba
 	var stringSlice []string
 
 	_, err := l.svcCtx.DB.Whatsapp.Create().
-		SetNotNilAk(req.Ak).
-		SetNotNilSk(req.Sk).
+		SetNotNilWaID(req.WaId).
 		SetNotNilCallback(req.Callback).
 		SetNotNilAccount(req.Account).
 		SetNotNilNickname(req.Nickname).
 		SetNotNilPhone(req.Phone).
+		SetNotNilPhoneName(req.PhoneName).
+		SetNotNilPhoneStatus(req.PhoneStatus).
 		SetNotNilOrganizationID(req.OrganizationId).
 		SetNotNilAgentID(req.AgentId).
 		SetNotNilAPIBase(req.ApiBase).

+ 3 - 2
internal/logic/whatsapp/get_whatsapp_by_id_logic.go

@@ -66,12 +66,13 @@ func (l *GetWhatsappByIdLogic) GetWhatsappById(req *types.IDReq) (*types.Whatsap
 				CreatedAt: pointy.GetPointer(data.CreatedAt.UnixMilli()),
 				UpdatedAt: pointy.GetPointer(data.UpdatedAt.UnixMilli()),
 			},
-			Ak:               &data.Ak,
-			Sk:               &data.Sk,
+			WaId:             &data.WaID,
 			Callback:         &data.Callback,
 			Account:          &data.Account,
 			Nickname:         &data.Nickname,
 			Phone:            &data.Phone,
+			PhoneName:        &data.PhoneName,
+			PhoneStatus:      &data.PhoneStatus,
 			OrganizationId:   &data.OrganizationID,
 			OrganizationName: departmentInfo.Name,
 			AgentId:          &data.AgentID,

+ 3 - 8
internal/logic/whatsapp/get_whatsapp_list_logic.go

@@ -32,12 +32,6 @@ func NewGetWhatsappListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G
 
 func (l *GetWhatsappListLogic) GetWhatsappList(req *types.WhatsappListReq) (*types.WhatsappListResp, error) {
 	var predicates []predicate.Whatsapp
-	if req.Ak != nil {
-		predicates = append(predicates, whatsapp.AkContains(*req.Ak))
-	}
-	if req.Sk != nil {
-		predicates = append(predicates, whatsapp.SkContains(*req.Sk))
-	}
 	if req.Callback != nil {
 		predicates = append(predicates, whatsapp.CallbackContains(*req.Callback))
 	}
@@ -79,12 +73,13 @@ func (l *GetWhatsappListLogic) GetWhatsappList(req *types.WhatsappListReq) (*typ
 					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
 					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
 				},
-				Ak:               &v.Ak,
-				Sk:               &v.Sk,
+				WaId:             &v.WaID,
 				Callback:         &v.Callback,
 				Account:          &v.Account,
 				Nickname:         &v.Nickname,
 				Phone:            &v.Phone,
+				PhoneName:        &v.PhoneName,
+				PhoneStatus:      &v.PhoneStatus,
 				OrganizationId:   &v.OrganizationID,
 				OrganizationName: departmentInfo.Name,
 				AgentId:          &v.AgentID,

+ 3 - 2
internal/logic/whatsapp/update_whatsapp_logic.go

@@ -27,12 +27,13 @@ func NewUpdateWhatsappLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
 
 func (l *UpdateWhatsappLogic) UpdateWhatsapp(req *types.WhatsappInfo) (*types.BaseMsgResp, error) {
 	err := l.svcCtx.DB.Whatsapp.UpdateOneID(*req.Id).
-		SetNotNilAk(req.Ak).
-		SetNotNilSk(req.Sk).
+		SetNotNilWaID(req.WaId).
 		SetNotNilCallback(req.Callback).
 		SetNotNilAccount(req.Account).
 		SetNotNilNickname(req.Nickname).
 		SetNotNilPhone(req.Phone).
+		SetNotNilPhoneName(req.PhoneName).
+		SetNotNilPhoneStatus(req.PhoneStatus).
 		SetNotNilOrganizationID(req.OrganizationId).
 		SetNotNilAgentID(req.AgentId).
 		SetNotNilAPIBase(req.ApiBase).

+ 48 - 0
internal/logic/whatsapp_channel/create_whatsapp_channel_logic.go

@@ -0,0 +1,48 @@
+package whatsapp_channel
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CreateWhatsappChannelLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCreateWhatsappChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateWhatsappChannelLogic {
+	return &CreateWhatsappChannelLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CreateWhatsappChannelLogic) CreateWhatsappChannel(req *types.WhatsappChannelInfo) (*types.BaseMsgResp, error) {
+	organizationId := l.ctx.Value("organizationId").(uint64)
+	_, err := l.svcCtx.DB.WhatsappChannel.Create().
+		//SetNotNilStatus(req.Status).
+		SetNotNilAk(req.Ak).
+		SetNotNilSk(req.Sk).
+		SetNotNilWaID(req.WaId).
+		SetNotNilWaName(req.WaName).
+		SetNotNilWabaID(req.WabaId).
+		SetNotNilBusinessID(req.BusinessId).
+		SetNotNilOrganizationID(&organizationId).
+		SetNotNilVerifyAccount(req.VerifyAccount).
+		Save(l.ctx)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	return &types.BaseMsgResp{Msg: errormsg.CreateSuccess}, nil
+}

+ 37 - 0
internal/logic/whatsapp_channel/delete_whatsapp_channel_logic.go

@@ -0,0 +1,37 @@
+package whatsapp_channel
+
+import (
+	"context"
+
+    "wechat-api/ent/whatsappchannel"
+    "wechat-api/internal/svc"
+    "wechat-api/internal/types"
+    "wechat-api/internal/utils/dberrorhandler"
+
+    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+    "github.com/zeromicro/go-zero/core/logx"
+)
+
+type DeleteWhatsappChannelLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewDeleteWhatsappChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWhatsappChannelLogic {
+	return &DeleteWhatsappChannelLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *DeleteWhatsappChannelLogic) DeleteWhatsappChannel(req *types.IDsReq) (*types.BaseMsgResp, error) {
+	_, err := l.svcCtx.DB.WhatsappChannel.Delete().Where(whatsappchannel.IDIn(req.Ids...)).Exec(l.ctx)
+
+    if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+    return &types.BaseMsgResp{Msg: errormsg.DeleteSuccess}, nil
+}

+ 64 - 0
internal/logic/whatsapp_channel/get_whatsapp_channel_by_id_logic.go

@@ -0,0 +1,64 @@
+package whatsapp_channel
+
+import (
+	"context"
+	"github.com/suyuan32/simple-admin-core/rpc/types/core"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetWhatsappChannelByIdLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetWhatsappChannelByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWhatsappChannelByIdLogic {
+	return &GetWhatsappChannelByIdLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetWhatsappChannelByIdLogic) GetWhatsappChannelById(req *types.IDReq) (*types.WhatsappChannelInfoResp, error) {
+	data, err := l.svcCtx.DB.WhatsappChannel.Get(l.ctx, req.Id)
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	departmentInfo, err := l.svcCtx.CoreRpc.GetDepartmentById(l.ctx, &core.IDReq{Id: data.OrganizationID})
+	if err != nil {
+		l.Error("获取部门信息失败", err)
+	}
+	return &types.WhatsappChannelInfoResp{
+		BaseDataInfo: types.BaseDataInfo{
+			Code: 0,
+			Msg:  errormsg.Success,
+		},
+		Data: types.WhatsappChannelInfo{
+			BaseIDInfo: types.BaseIDInfo{
+				Id:        &data.ID,
+				CreatedAt: pointy.GetPointer(data.CreatedAt.UnixMilli()),
+				UpdatedAt: pointy.GetPointer(data.UpdatedAt.UnixMilli()),
+			},
+			Status:           &data.Status,
+			Ak:               &data.Ak,
+			Sk:               &data.Sk,
+			WaId:             &data.WaID,
+			WaName:           &data.WaName,
+			WabaId:           &data.WabaID,
+			BusinessId:       &data.BusinessID,
+			OrganizationId:   &data.OrganizationID,
+			OrganizationName: departmentInfo.Name,
+			VerifyAccount:    &data.VerifyAccount,
+		},
+	}, nil
+}

+ 81 - 0
internal/logic/whatsapp_channel/get_whatsapp_channel_list_logic.go

@@ -0,0 +1,81 @@
+package whatsapp_channel
+
+import (
+	"context"
+	"github.com/suyuan32/simple-admin-core/rpc/types/core"
+
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/whatsappchannel"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetWhatsappChannelListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetWhatsappChannelListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWhatsappChannelListLogic {
+	return &GetWhatsappChannelListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetWhatsappChannelListLogic) GetWhatsappChannelList(req *types.WhatsappChannelListReq) (*types.WhatsappChannelListResp, error) {
+	var predicates []predicate.WhatsappChannel
+	if req.OrganizationId != nil {
+		predicates = append(predicates, whatsappchannel.OrganizationID(*req.OrganizationId))
+	}
+	if req.WaName != nil && *req.WaName != "" {
+		predicates = append(predicates, whatsappchannel.WaNameContains(*req.WaName))
+	}
+	if req.WabaId != nil {
+		predicates = append(predicates, whatsappchannel.WabaID(*req.WabaId))
+	}
+	data, err := l.svcCtx.DB.WhatsappChannel.Query().Where(predicates...).Page(l.ctx, req.Page, req.PageSize)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	resp := &types.WhatsappChannelListResp{}
+	resp.Msg = errormsg.Success
+	resp.Data.Total = data.PageDetails.Total
+
+	for _, v := range data.List {
+		departmentInfo, err := l.svcCtx.CoreRpc.GetDepartmentById(l.ctx, &core.IDReq{Id: v.OrganizationID})
+		if err != nil {
+			l.Error("获取部门信息失败", err)
+		}
+
+		resp.Data.Data = append(resp.Data.Data,
+			types.WhatsappChannelInfo{
+				BaseIDInfo: types.BaseIDInfo{
+					Id:        &v.ID,
+					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
+					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+				},
+				Status:           &v.Status,
+				Ak:               &v.Ak,
+				Sk:               &v.Sk,
+				WaId:             &v.WaID,
+				WaName:           &v.WaName,
+				WabaId:           &v.WabaID,
+				BusinessId:       &v.BusinessID,
+				OrganizationId:   &v.OrganizationID,
+				OrganizationName: departmentInfo.Name,
+				VerifyAccount:    &v.VerifyAccount,
+			})
+	}
+
+	return resp, nil
+}

+ 46 - 0
internal/logic/whatsapp_channel/update_whatsapp_channel_logic.go

@@ -0,0 +1,46 @@
+package whatsapp_channel
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateWhatsappChannelLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewUpdateWhatsappChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateWhatsappChannelLogic {
+	return &UpdateWhatsappChannelLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *UpdateWhatsappChannelLogic) UpdateWhatsappChannel(req *types.WhatsappChannelInfo) (*types.BaseMsgResp, error) {
+	err := l.svcCtx.DB.WhatsappChannel.UpdateOneID(*req.Id).
+		//SetNotNilStatus(req.Status).
+		SetNotNilAk(req.Ak).
+		SetNotNilSk(req.Sk).
+		SetNotNilWaID(req.WaId).
+		SetNotNilWaName(req.WaName).
+		SetNotNilWabaID(req.WabaId).
+		SetNotNilBusinessID(req.BusinessId).
+		//SetNotNilOrganizationID(req.OrganizationId).
+		SetNotNilVerifyAccount(req.VerifyAccount).
+		Exec(l.ctx)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
+}

+ 70 - 8
internal/types/types.go

@@ -3414,25 +3414,28 @@ type PayRechargeInfoResp struct {
 type WhatsappInfo struct {
 	BaseIDInfo
 	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
-	Status *uint8 `json:"status,optional"`
-	// ak
-	Ak *string `json:"ak,optional"`
-	// 端口号
-	Sk *string `json:"sk,optional"`
+	Status *uint8  `json:"status,optional"`
+	WaId   *uint64 `json:"waId,optional"`
 	// 回调地址
 	Callback *string `json:"callback,optional"`
+	// 模式ID
+	AgentId   *uint64    `json:"agentId,optional"`
+	AgentInfo *AgentInfo `json:"agentInfo,optional"`
 	// 微信账号
 	Account *string `json:"account,optional"`
 	// 昵称
 	Nickname *string `json:"nickname,optional"`
 	// 手机号
 	Phone *string `json:"phone,optional"`
+	// 号码名称
+	PhoneName *string `json:"phoneName,optional"`
+	// 号码状态
+	PhoneStatus *int8   `json:"phoneStatus,optional"`
+	Tokens      *uint64 `json:"tokens,optional"`
+	Frequency   *uint64 `json:"frequency,optional"`
 	// 机构 ID
 	OrganizationId   *uint64 `json:"organizationId,optional"`
 	OrganizationName *string `json:"organizationName,optional"`
-	// 模式ID
-	AgentId   *uint64    `json:"agentId,optional"`
-	AgentInfo *AgentInfo `json:"agentInfo,optional"`
 	// 大模型服务地址
 	ApiBase *string `json:"apiBase,optional"`
 	// 大模型服务密钥
@@ -3482,3 +3485,62 @@ type WhatsappInfoResp struct {
 	// Whatsapp information | Whatsapp数据
 	Data WhatsappInfo `json:"data"`
 }
+
+// The data of whatsapp channel information | WhatsappChannel信息
+// swagger:model WhatsappChannelInfo
+type WhatsappChannelInfo struct {
+	BaseIDInfo
+	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
+	Status *uint8 `json:"status,optional"`
+	// ak
+	Ak *string `json:"ak,optional"`
+	// 端口号
+	Sk *string `json:"sk,optional"`
+	// 通道ID
+	WaId *uint64 `json:"waId,optional"`
+	// 通道名
+	WaName *string `json:"waName,optional"`
+	// WABA ID
+	WabaId *uint64 `json:"wabaId,optional"`
+	// 商业平台ID
+	BusinessId *uint64 `json:"businessId,optional"`
+	// 机构 ID
+	OrganizationId   *uint64 `json:"organizationId,optional"`
+	OrganizationName *string `json:"organizationName,optional"`
+	// 认证主体
+	VerifyAccount *string `json:"verifyAccount,optional"`
+}
+
+// The response data of whatsapp channel list | WhatsappChannel列表数据
+// swagger:model WhatsappChannelListResp
+type WhatsappChannelListResp struct {
+	BaseDataInfo
+	// WhatsappChannel list data | WhatsappChannel列表数据
+	Data WhatsappChannelListInfo `json:"data"`
+}
+
+// WhatsappChannel list data | WhatsappChannel列表数据
+// swagger:model WhatsappChannelListInfo
+type WhatsappChannelListInfo struct {
+	BaseListInfo
+	// The API list data | WhatsappChannel列表数据
+	Data []WhatsappChannelInfo `json:"data"`
+}
+
+// Get whatsapp channel list request params | WhatsappChannel列表请求参数
+// swagger:model WhatsappChannelListReq
+type WhatsappChannelListReq struct {
+	PageInfo
+	OrganizationId *uint64 `json:"organizationId,optional"`
+	WaName         *string `json:"waName,optional"`
+	WabaId         *uint64 `json:"wabaId,optional"`
+	VerifyAccount  *string `json:"verifyAccount,optional"`
+}
+
+// WhatsappChannel information response | WhatsappChannel信息返回体
+// swagger:model WhatsappChannelInfoResp
+type WhatsappChannelInfoResp struct {
+	BaseDataInfo
+	// WhatsappChannel information | WhatsappChannel数据
+	Data WhatsappChannelInfo `json:"data"`
+}