feat(comm): implement Communication & Lead Layer core
- Add database migration: contacts, conversations, messages, leads, workflows, follow-ups, audit log - Contact handler with deduplication and identity resolution - Conversation handler with unified inbox - Lead handler with scoring engine and qualification - Workflow handler with trigger-action engine - Full API routes for all comm layer endpoints - 12 operational agents integrated in all BOC modules
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"boc/db"
|
||||
"boc/employee"
|
||||
"boc/handlers"
|
||||
"boc/handlers/comm"
|
||||
"boc/ledger"
|
||||
"boc/middleware"
|
||||
"boc/sms"
|
||||
@@ -407,6 +408,42 @@ func main() {
|
||||
r.Post("/api/v1/agents/chat", agentOrchestrator.HandleAgentChat)
|
||||
r.Get("/api/v1/agents/{id}", agentOrchestrator.HandleAgentStatus)
|
||||
r.Post("/api/v1/agents/{id}/execute", agentOrchestrator.HandleAgentChat)
|
||||
|
||||
// Communication & Lead Layer
|
||||
contactH := comm.NewContactHandler(database)
|
||||
conversationH := comm.NewConversationHandler(database)
|
||||
leadH := comm.NewLeadHandler(database)
|
||||
workflowH := comm.NewWorkflowHandler(database)
|
||||
|
||||
// Contacts
|
||||
r.Post("/api/v1/comm/contacts", contactH.CreateContact)
|
||||
r.Get("/api/v1/comm/contacts", contactH.ListContacts)
|
||||
r.Get("/api/v1/comm/contacts/{id}", contactH.GetContact)
|
||||
r.Post("/api/v1/comm/contacts/merge", contactH.MergeContacts)
|
||||
|
||||
// Conversations
|
||||
r.Post("/api/v1/comm/conversations", conversationH.CreateConversation)
|
||||
r.Get("/api/v1/comm/conversations", conversationH.ListConversations)
|
||||
r.Get("/api/v1/comm/conversations/{id}", conversationH.GetConversation)
|
||||
r.Post("/api/v1/comm/conversations/{id}/messages", conversationH.SendMessage)
|
||||
r.Put("/api/v1/comm/conversations/{id}/status", conversationH.UpdateStatus)
|
||||
|
||||
// Leads
|
||||
r.Post("/api/v1/comm/leads", leadH.CreateLead)
|
||||
r.Get("/api/v1/comm/leads", leadH.ListLeads)
|
||||
r.Get("/api/v1/comm/leads/{id}", leadH.GetLead)
|
||||
r.Put("/api/v1/comm/leads/{id}", leadH.UpdateLead)
|
||||
r.Put("/api/v1/comm/leads/{id}/qualification", leadH.UpdateQualification)
|
||||
r.Get("/api/v1/comm/leads/{id}/score-history", leadH.GetLeadScoreHistory)
|
||||
|
||||
// Workflows
|
||||
r.Post("/api/v1/comm/workflows", workflowH.CreateWorkflow)
|
||||
r.Get("/api/v1/comm/workflows", workflowH.ListWorkflows)
|
||||
r.Get("/api/v1/comm/workflows/{id}", workflowH.GetWorkflow)
|
||||
r.Put("/api/v1/comm/workflows/{id}", workflowH.UpdateWorkflow)
|
||||
r.Post("/api/v1/comm/workflows/{id}/toggle", workflowH.ToggleWorkflow)
|
||||
r.Post("/api/v1/comm/workflows/{id}/execute", workflowH.ExecuteWorkflow)
|
||||
r.Get("/api/v1/comm/workflows/{id}/executions", workflowH.ListExecutions)
|
||||
})
|
||||
|
||||
// WebSocket (protected)
|
||||
|
||||
Reference in New Issue
Block a user