system-prompts-and-models-o.../salesflow-saas/backend/app/api
Claude c398bd31ce
feat(dealix): Full OS orchestrator — unified deal lifecycle automation
The missing brain that connects ALL existing services into one system:

1. full_os_orchestrator.py — Deal lifecycle state machine:
   12 stages: new_lead → qualifying → qualified → nurturing →
   meeting_booked → meeting_done → proposal_sent → negotiating →
   payment_requested → pilot_active → closed_won/lost/opted_out.

   Each stage has: auto-transitions based on intent, auto-actions
   (send_whatsapp, book_meeting, sync_crm, etc.), Arabic response
   templates, qualification questions.

2. full_os.py API — 4 endpoints:
   - POST /os/process — classify event + determine next stage + actions
   - POST /os/process-and-act — same + auto-execute (WhatsApp send
     via Ultramsg if safe, or create draft if human approval needed)
   - POST /os/bulk-process — batch event processing
   - GET /os/stages — list all stages with transitions

3. How it works:
   Inbound WhatsApp → /os/process-and-act →
   classify intent → transition stage →
   if auto_send_allowed: send WhatsApp response immediately
   if human_approval_required: create draft for Sami to review
   Always: log activity + suggest next actions

4. Safety:
   - Negotiation/payment/pilot stages = human_approval_required
   - Opt-out = immediate stop, no further contact
   - All sends via existing Ultramsg (rate limited, logged)
   - Draft queue for anything needing review

Connects to existing infrastructure:
- outreach_engine._send_via_ultramsg() for WhatsApp
- OutreachDraft model for draft queue
- Reply classifier for intent detection

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
2026-04-25 18:04:12 +00:00
..
routes fix(intelligence): contact_phone fix + Apollo/PDL enrichment + CSV export + stats endpoints 2026-04-22 05:30:15 +00:00
v1 feat(dealix): Full OS orchestrator — unified deal lifecycle automation 2026-04-25 18:04:12 +00:00
__init__.py Add SalesMatic AI Sales SaaS Platform - Complete Foundation 2026-03-28 03:06:53 +00:00
dependencies.py 🚀 Complete Dealix AI Sales Empire Update - Security Scrubbed, Lead Engine & Multi-Channel Ready 2026-04-02 17:17:13 +03:00
deps.py chore: snapshot Dealix salesflow phase2 for audit worktree 2026-04-04 18:04:21 +03:00