ACCEPTANCE CRITERIA (12/12)
☑ LeadScoringService created with `calculateScore`, `classifyLead`, `getScoreBreakdown` methods
☑ Scoring criteria implemented: customer type (CNPJ/CPF), volume interest, urgency, data provided, engagement, history
☑ Classification thresholds: HOT (70+), WARM (30-69), COLD (0-29)
☑ SegmentationService created with `detectSegment` and `getBANTStatus` methods
☑ BANT adapted for Propek: Budget, Authority, Need, Timeline
☑ Customer segment detection: consumidor vs revendedor vs indefinido
☑ Integration in whatsapp.handler.ts — non-blocking background scoring after every message
☑ HOT leads flagged for commercial handoff in logs
☑ Database migration 016 for lead_scores table with proper indexes
☑ All operations non-blocking (do not affect main message flow)
☑ TypeScript compiles without errors (`npx tsc --noEmit`)
☑ Follows existing code patterns (query, logger, service class pattern)
ARQUIVOS (5)
src/services/lead-scoring.service.ts Created
src/services/segmentation.service.ts Created
src/handlers/whatsapp.handler.ts Modified (added imports + background scoring)
src/migrations/016_create_lead_scores.sql Created
docs/stories/story-3.2-bot-phase2-lead-scoring-sdr.md Created