Back to ER Diagram
CRM & Bidding

CRM & Bidding Logic

Lead management, opportunity pipeline, bid/no-bid decisions, tender tracking, bid submissions, EMD management, and client relationship.

PostgreSQL
13 Tables
Schema: crm
Sales Pipeline

Overview

CRM module manages the pre-contract business development cycle. Leads are captured from multiple sources, qualified into opportunities, and evaluated through bid/no-bid committee decisions. Approved bids flow through tender calendar tracking, document preparation, pricing, and submission. EMD (Earnest Money Deposit) tracked per bid. Won bids convert to projects. Pipeline analytics provide revenue forecasting.


Capture Lead

Qualify

Bid/No-Bid

Prepare Bid

Submit & Track
13
CRM Tables
Pipeline
Revenue Forecast
EMD
Deposit Tracking
Win Rate
Analytics

Status States

StatusDescriptionAllowed ActionsNext States
New LeadLead captured, not yet qualifiedQualify, DiscardQualified
QualifiedLead assessed as viable opportunityCreate OpportunityOpportunity
Bid DecisionCommittee reviewing bid/no-bidApprove Bid, DeclineBidding
BiddingBid document being preparedSubmit, WithdrawSubmitted
WonBid won, contract to be signedCreate ProjectConverted
LostBid unsuccessfulAnalyze, Archive

Database Schema

crm.lead

  • lead_id — PK
  • source — advertisement | referral | portal | walk_in
  • client_name, project_name, estimated_value — Lead details
  • lead_owner_id — FK → admin.user
  • status, priority — Lifecycle and urgency

crm.crm_opportunity

  • opportunity_id — PK
  • lead_id — FK → crm.lead
  • opportunity_value, win_probability — Revenue forecast inputs
  • expected_close_date — Pipeline date
  • stage — prospecting | proposal | negotiation | closing

crm.bid_decision

  • decision_id — PK
  • opportunity_id — FK → crm.crm_opportunity
  • decision — bid | no_bid | conditional
  • committee_members, risk_assessment — Decision details
  • approved_by, decision_date — Authorization

crm.bid_submission

  • submission_id — PK
  • opportunity_id — FK → crm.crm_opportunity
  • tender_ref, submission_date, opening_date — Tender details
  • technical_score, financial_score — Evaluation results
  • emd_amount, emd_status — EMD tracking
  • result — won | lost | under_evaluation

CRM Lifecycle

1

Lead Capture

Leads captured from tender portals, client referrals, newspaper ads, and business development meetings. Enriched with client details, project scope, and estimated value.

2

Qualification

Leads assessed for alignment with company capabilities, geography, and strategy. Qualified leads become opportunities with value and probability estimates.

3

Bid/No-Bid Decision

Committee reviews opportunity using checklist — technical capability, resource availability, competition, risk level, margin potential. Decision recorded with rationale.

4

Bid Preparation

Estimation team prepares technical and commercial bid. BOQ pricing, method statement, schedule, and team composition. Internal review before submission.

5

Submission & Tracking

Bid submitted per tender requirements. EMD deposited. Track opening date, evaluation status, competitor analysis. Won bids trigger project creation.

CRM Queries

Pipeline Value by Stage

SELECT o.stage,
       COUNT(*) AS opportunity_count,
       SUM(o.opportunity_value) AS total_value,
       SUM(o.opportunity_value * o.win_probability / 100) AS weighted_value
FROM crm.crm_opportunity o
WHERE o.status = 'Active'
GROUP BY o.stage
ORDER BY weighted_value DESC;

Validation Rules

Business Rules

  • EMD Amount: EMD must be deposited before bid submission date
  • Bid Approval: Bid submission requires approved bid_decision record
  • Win Probability: Probability must be between 0-100%
  • Lead Source: Every lead must have a tracked source for conversion analytics

Integration Points

Connected Modules

  • Estimation: Won bids reference BOQ prepared during bidding phase
  • Project: Won bids auto-create project shell with scope and timeline
  • Finance: EMD tracked as advance/deposit in financial statements
  • Contract: Won bid terms feed contract creation

Best Practices

Recommended

  • Review pipeline weekly with weighted value analysis
  • Track bid win/loss ratio and analyze lost bid reasons
  • Automate tender portal monitoring for new opportunities
  • Maintain competitor database with pricing intelligence