refactor: split backend into standalone server project

Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
This commit is contained in:
t
2026-08-20 21:46:55 +08:00
parent 954a3fe8d9
commit 3d47227fbd
612 changed files with 515 additions and 97334 deletions
+29
View File
@@ -187,6 +187,35 @@ func TestConversationCreateCreatesAIWelcomeMessage(t *testing.T) {
}
}
func TestConversationCreateAllowsHumanChannelWithoutAIAgent(t *testing.T) {
db := setupMessageWelcomeTestDB(t)
conversation, err := ConversationService.Create(welcomeTestExternalUser("human-channel-1"), 11, 0)
if err != nil {
t.Fatalf("create human channel conversation: %v", err)
}
if conversation == nil {
t.Fatal("expected conversation")
}
if conversation.AIAgentID != 0 {
t.Fatalf("ai agent id = %d, want 0", conversation.AIAgentID)
}
if conversation.ServiceMode != enums.IMConversationServiceModeHumanOnly {
t.Fatalf("service mode = %d, want human only", conversation.ServiceMode)
}
if conversation.Status != enums.IMConversationStatusPending {
t.Fatalf("status = %d, want pending", conversation.Status)
}
var messages []models.Message
if err := db.Where("conversation_id = ?", conversation.ID).Find(&messages).Error; err != nil {
t.Fatalf("find messages: %v", err)
}
if len(messages) != 1 || messages[0].Content != HandoffWaitingMessage {
t.Fatalf("unexpected human channel messages: %#v", messages)
}
}
func TestSendCustomerMessageStoresRequestIDOnMessageAndEvent(t *testing.T) {
db := setupMessageWelcomeTestDB(t)
aiAgent := createWelcomeTestAIAgent(t, db, "")