Subversion Repositories SmartDukaan

Rev

Rev 36984 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36984 Rev 37120
Line 63... Line 63...
63
    public void persistLeadDetail(LeadDetailModel leadDetailModel, AuthUser authUser) throws ProfitMandiBusinessException;
63
    public void persistLeadDetail(LeadDetailModel leadDetailModel, AuthUser authUser) throws ProfitMandiBusinessException;
64
 
64
 
65
    Lead selectByMobileNumber(String mobileNumber);
65
    Lead selectByMobileNumber(String mobileNumber);
66
 
66
 
67
    Lead selectByMobileNumberAndSource(String mobileNumber, String source);
67
    Lead selectByMobileNumberAndSource(String mobileNumber, String source);
-
 
68
 
-
 
69
    // ---- LMS dashboard aggregation (SOP §18) -------------------------------------------------
-
 
70
    // All aggregates bucket EVERY lead: rows with a real `stage` use it; legacy rows (stage NULL)
-
 
71
    // derive a stage from `status` in SQL, mirroring LeadStage.fromLegacy. Read-only, no schema change.
-
 
72
 
-
 
73
    /** (derivedStage, count) for the optional region + created-date window. */
-
 
74
    java.util.List<Object[]> countByDerivedStage(Integer regionId, LocalDateTime from, LocalDateTime to);
-
 
75
 
-
 
76
    /** (derivedStage, SUM(potential)) for the optional region + window — for the onboarded-value KPI. */
-
 
77
    java.util.List<Object[]> sumPotentialByDerivedStage(Integer regionId, LocalDateTime from, LocalDateTime to);
-
 
78
 
-
 
79
    /** (regionCode, derivedStage, count) across all regions in the window — feeds the state funnel. */
-
 
80
    java.util.List<Object[]> countByRegionAndDerivedStage(LocalDateTime from, LocalDateTime to);
-
 
81
 
-
 
82
    /** (regionCode, totalWithDue, onTime) — first-contact SLA compliance per region. */
-
 
83
    java.util.List<Object[]> slaComplianceByRegion(LocalDateTime from, LocalDateTime to);
-
 
84
 
-
 
85
    /** (ownerBmId, isoYearWeek, totalWithDue, onTime) — SLA compliance per BM per week, for the heat-map. */
-
 
86
    java.util.List<Object[]> slaComplianceByBmAndWeek(LocalDateTime from, LocalDateTime to);
-
 
87
 
-
 
88
    /** (derivedStage, count) of OPEN leads not touched since {@code olderThan} — the ageing widget. */
-
 
89
    java.util.List<Object[]> ageingByDerivedStage(LocalDateTime olderThan);
-
 
90
 
-
 
91
    /** Single row of conditional-sum attention counts (see impl) for the optional region. */
-
 
92
    Object[] attentionCounts(Integer regionId, LocalDateTime now, LocalDateTime nowPlus1h);
-
 
93
 
-
 
94
    /** Lead ids for a drill-down bucket (STAGE / ATTENTION / REGION), newest first, capped at {@code limit}. */
-
 
95
    java.util.List<Integer> selectLeadIdsForBucket(String bucketType, String bucketKey, Integer regionId,
-
 
96
                                                   LocalDateTime now, LocalDateTime nowPlus1h,
-
 
97
                                                   LocalDateTime from, LocalDateTime to, int limit);
68
}
98
}