| Line 73... |
Line 73... |
| 73 |
public void persistLeadDetail(LeadDetailModel leadDetailModel, AuthUser authUser) throws ProfitMandiBusinessException;
|
73 |
public void persistLeadDetail(LeadDetailModel leadDetailModel, AuthUser authUser) throws ProfitMandiBusinessException;
|
| 74 |
|
74 |
|
| 75 |
Lead selectByMobileNumber(String mobileNumber);
|
75 |
Lead selectByMobileNumber(String mobileNumber);
|
| 76 |
|
76 |
|
| 77 |
/**
|
77 |
/**
|
| - |
|
78 |
* Every lead on this mobile that is OPEN and actually workable, newest activity first.
|
| - |
|
79 |
*
|
| - |
|
80 |
* "Workable" is two conditions, not one. The status must be open (pending/followUp), AND the
|
| - |
|
81 |
* assignee must still be an active auth_user. The second half matters: 331 open leads are
|
| - |
|
82 |
* assigned to 11 DEACTIVATED accounts (157 of them to sm@smartdukaan.com alone). Without the
|
| - |
|
83 |
* owner check each of those would block a fresh enquiry forever, held by an account nobody can
|
| - |
|
84 |
* log in to and therefore nobody can close. Filtering them out defuses all 331 without
|
| - |
|
85 |
* retiring a single row, which is what the "no auto-retirement" rule requires.
|
| - |
|
86 |
*
|
| - |
|
87 |
* Returns a LIST on purpose. 5,137 mobiles already carry duplicates and 10 carry more than one
|
| - |
|
88 |
* OPEN lead, so any uniqueness assumption here throws -- which is exactly what
|
| - |
|
89 |
* selectByMobileNumber does today (GlitchTip #99, #1359).
|
| - |
|
90 |
*/
|
| - |
|
91 |
List<Lead> selectActiveByMobile(String mobileNumber);
|
| - |
|
92 |
|
| - |
|
93 |
/**
|
| - |
|
94 |
* Last time anything happened to this lead: the later of its own updated/created stamp and its
|
| - |
|
95 |
* newest lead_activity row. Drives the 6-month staleness test.
|
| - |
|
96 |
*/
|
| - |
|
97 |
LocalDateTime selectLastActivityAt(int leadId);
|
| - |
|
98 |
|
| - |
|
99 |
/**
|
| 78 |
* Batch mobile lookup for bulk imports — one query instead of one per row.
|
100 |
* Batch mobile lookup for bulk imports — one query instead of one per row.
|
| 79 |
*
|
101 |
*
|
| 80 |
* <p>Takes normalised 10-digit numbers and also matches the prefixed forms that exist in the
|
102 |
* <p>Takes normalised 10-digit numbers and also matches the prefixed forms that exist in the
|
| 81 |
* data ({@code 91…}, {@code 0…}): of ~37k leads, 121 are stored 11- or 12-digit, so an exact
|
103 |
* data ({@code 91…}, {@code 0…}): of ~37k leads, 121 are stored 11- or 12-digit, so an exact
|
| 82 |
* 10-digit match would miss them and a bulk import would create duplicates for real retailers.
|
104 |
* 10-digit match would miss them and a bulk import would create duplicates for real retailers.
|