feat(comm): implement Communication & Lead Layer core
BOC CI/CD / Test (push) Failing after 2s
BOC CI/CD / Security Scan (push) Has been skipped
BOC CI/CD / Build & Push (push) Has been skipped
BOC CI/CD / Deploy to Staging (push) Has been skipped
BOC CI/CD / Deploy to Production (push) Has been skipped

- 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:
Bernt
2026-08-12 10:15:54 +00:00
parent 8cb26cdb15
commit 9e519f5c8f
8 changed files with 1806 additions and 0 deletions
+37
View File
@@ -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)