Complete sales pipeline management system with lead capture, opportunity tracking, and customer conversion workflows.
{
"id": "uuid",
"name": "string",
"owner_id": "uuid", // FK to User
"source": "enum[website, google_ads, facebook, privy, typeform, bulk_upload, manual]",
"created_at": "timestamp",
"prospective_type": "enum[individual, sme, corporate]",
"priority": "enum[hot, warm, cold]",
"contact_info": {
"email": "string",
"phone": "string",
"whatsapp": "string"
},
"tags": "array[string]",
"notes": "text",
"status": "enum[new, contacted, qualified, disqualified]",
"updated_at": "timestamp"
}{
"id": "uuid",
"lead_id": "uuid", // FK to Lead
"deal_name": "string",
"expected_close_date": "date",
"deal_stage": "enum[discovery, proposal_sent, negotiation, won, lost]",
"value_estimate": "decimal",
"assigned_to": "uuid", // FK to User
"created_at": "timestamp",
"updated_at": "timestamp"
}{
"id": "uuid",
"opportunity_id": "uuid", // FK to Opportunity
"lead_id": "uuid", // FK to Lead
"customer_success_manager": "uuid", // FK to User
"purchase_history": "array[object]",
"onboarding_status": "enum[pending, in_progress, completed]",
"created_at": "timestamp",
"updated_at": "timestamp"
}{
"id": "uuid",
"entity_type": "enum[lead, opportunity, customer]",
"entity_id": "uuid",
"activity_type": "enum[call, email, whatsapp, meeting, proposal, quotation]",
"description": "text",
"completed": "boolean",
"scheduled_at": "timestamp",
"completed_at": "timestamp",
"created_by": "uuid", // FK to User
"metadata": "json" // Additional data like call duration, email subject, etc.
}{
"id": "uuid",
"opportunity_id": "uuid", // FK to Opportunity
"order_number": "string",
"total_value": "decimal",
"status": "enum[pending, confirmed, delivered, cancelled]",
"invoice_generated": "boolean",
"payment_status": "enum[pending, paid, failed]",
"created_at": "timestamp",
"updated_at": "timestamp"
}POST /api/leads // Create new lead
GET /api/leads // List leads with filters
GET /api/leads/{id} // Get lead details
PUT /api/leads/{id} // Update lead
DELETE /api/leads/{id} // Delete lead
POST /api/leads/{id}/convert // Convert to opportunity
POST /api/opportunities // Create opportunity
GET /api/opportunities // List opportunities
GET /api/opportunities/{id} // Get opportunity details
PUT /api/opportunities/{id} // Update opportunity
POST /api/opportunities/{id}/close // Close as won/lost
POST /api/activities // Log activity
GET /api/activities // List activities
GET /api/{entity_type}/{id}/activities // Get entity activities
PUT /api/activities/{id} // Update activity
POST /api/leads/{id}/call // Initiate call
POST /api/leads/{id}/email // Send email
POST /api/leads/{id}/whatsapp // Send WhatsApp message
POST /api/leads/{id}/schedule // Schedule meeting
Input Sources β Lead Validation β Lead Creation β Owner Assignment β Notification
Implementation Steps:
- Validate required fields
- Determine lead source and apply source-specific logic
- Auto-assign owner based on rules (round-robin, territory, etc.)
- Send notification to assigned owner
- Log creation activity
Lead View β Action Selection β Communication β Activity Log β Follow-up Automation
Implementation Steps:
- Display lead timeline and summary
- Provide quick action buttons (call, email, WhatsApp, schedule)
- Execute selected action (integrate with VOIP, email service, WhatsApp API)
- Log activity with timestamp and details
- Trigger automated follow-up if configured
Lead Qualification β Conversion Trigger β Data Mapping β Opportunity Creation β Pipeline Entry
Implementation Steps:
- Validate lead qualification criteria
- Create opportunity record
- Map lead data to opportunity fields
- Set initial deal stage
- Maintain relationship link between lead and opportunity
Opportunity β Document Generation β Client Review β Acceptance/Rejection β Next Stage
Implementation Steps:
- Generate proposal/quotation from templates
- Send via email/WhatsApp
- Track document status (sent, viewed, accepted, rejected)
- Update opportunity stage based on response
- Log all interactions
Opportunity Won β Customer Record Creation β Onboarding Initiation β CSM Assignment
Implementation Steps:
- Create customer profile
- Copy relevant data from lead/opportunity
- Generate welcome email
- Assign Customer Success Manager
- Set up onboarding workflow
- VOIP Integration: For call functionality
- Email Service: SMTP/API for email communication
- WhatsApp Business API: For messaging
- Payment Gateways: Razorpay, Stripe for payment processing
- Calendar Integration: Google Calendar, Outlook
- Lead Capture Tools: Privy, Typeform, etc.
Lead (1) β (1) Opportunity β (1) Customer
Lead (1) β (n) Activities
Opportunity (1) β (n) Activities
Customer (1) β (n) Activities
Opportunity (1) β (1) Sales Order
- Lead Creation: Auto-assign owner, send notification
- Activity Completion: Send thank-you message, log interaction
- Opportunity Won: Create customer, initiate onboarding
- Scheduled Follow-ups: Send reminders, create tasks
- Lead Scoring: Update lead priorities based on engagement
- Opportunity Aging: Alert on stale opportunities
- Customer Check-ins: Automated periodic outreach
- Contract Renewals: Renewal reminders and alerts
- Lead list with filters and search
- Lead detail view with timeline
- Quick action buttons
- Bulk operations (import, export, assign)
- Kanban board view by stages
- Deal cards with key metrics
- Drag-and-drop stage updates
- Pipeline analytics
- Integrated email composer
- WhatsApp message templates
- Call logging interface
- Meeting scheduler
- Admin: Full access to all features
- Sales Manager: Team visibility and reporting
- Sales Rep: Own leads/opportunities only
- Customer Success: Customer records and activities
- Encrypt sensitive contact information
- Audit trail for all data changes
- GDPR compliance for data handling
- Regular backup and recovery procedures
- Index on frequently queried fields (owner_id, status, created_at)
- Partition activity tables by date
- Implement soft deletes for data retention
- Use database views for complex reporting queries
- Cache frequently accessed lead/opportunity data
- Cache user permissions and role assignments
- Implement Redis for session management
- Use CDN for static assets and documents
- Lead conversion rates by source
- Average deal size and close time
- Sales rep performance metrics
- Pipeline health indicators
- Lead source effectiveness
- Sales funnel conversion rates
- Revenue forecasting
- Activity and engagement reports