chore: stabilize chatwoot parity baseline

This commit is contained in:
2026-06-04 18:12:50 +08:00
parent 8ac150bc7b
commit 42cdab880c
39 changed files with 1028 additions and 696 deletions
@@ -123,13 +123,13 @@ func (s *BotTriggerConfigHandlerTestSuite) setupRouter() *gin.Engine {
{
botGroup.GET("", s.handler.ListByBot)
botGroup.POST("", s.handler.Create)
botGroup.GET("/:agent_bot_id", s.handler.Get)
botGroup.PUT("/:agent_bot_id", s.handler.Update)
botGroup.DELETE("/:agent_bot_id", s.handler.Delete)
botGroup.GET("/:trigger_config_id", s.handler.Get)
botGroup.PUT("/:trigger_config_id", s.handler.Update)
botGroup.DELETE("/:trigger_config_id", s.handler.Delete)
}
// ToggleActive route (handler method exists but not in production router yet)
r.PATCH("/api/v1/accounts/:account_id/agent_bots/:agent_bot_id/trigger_configs/:agent_bot_id/active", s.handler.ToggleActive)
r.PATCH("/api/v1/accounts/:account_id/agent_bots/:agent_bot_id/trigger_configs/:trigger_config_id/active", s.handler.ToggleActive)
return r
}
@@ -714,10 +714,10 @@ func (s *BotTriggerConfigHandlerTestSuite) TestToggleActive_MalformedJSON() {
// createTestConfig creates a BotTriggerConfig directly via the service for test seeding.
func (s *BotTriggerConfigHandlerTestSuite) createTestConfig(name string, eventName automation.BotRuleEventType, active bool) *automation.BotTriggerConfig {
config := &automation.BotTriggerConfig{
AccountID: s.accountID,
AgentBotID: s.agentBotID,
Name: name,
EventName: eventName,
AccountID: s.accountID,
AgentBotID: s.agentBotID,
Name: name,
EventName: eventName,
Conditions: automation.TriggerConditions{
{Attribute: "status", FilterOperator: "equal", Values: []string{"open"}, QueryOperator: "and"},
},
@@ -727,4 +727,4 @@ func (s *BotTriggerConfigHandlerTestSuite) createTestConfig(name string, eventNa
err := s.svc.Create(context.Background(), config)
s.Require().NoError(err)
return config
}
}