Every check performed by the old code during Stage 2 (OTP Verification) and Stage 3 (Email Verification), mapped to the new backend.
| # |
Check / Logic |
Old Code (SP / Method) |
New Backend |
Status |
| STAGE 2 — OTP Verification (Checks 1–18) |
| 1 |
OTP stored in Redis only (not DB) |
Old: stored in DB via SP |
ICacheService.StoreOtpAsync, TTL 5 min, Redis only |
PRESENT |
| 2 |
4-digit OTP generation |
Generated in SP |
OtpGeneratorService, 4-digit cryptographic random |
PRESENT |
| 3 |
Max 5 wrong attempts → DROPPED |
Attempt tracking in DB |
OtpVerificationService, MaxWrongAttempts=5, state → DROPPED, IsLocked=true |
PRESENT |
| 4 |
Max 3 resends in 30 min |
Rate limiting in DB |
MaxResendCount=3, MinResendIntervalSeconds=30 |
PRESENT |
| 5 |
30-sec cooldown between resends |
Embedded in SP |
Checks ResendCount timing in OtpVerificationService |
PRESENT |
| 6 |
OTP delivery via SMS |
Netcore SOAP |
NetcoreSmsProvider, MOSL SMS |
PRESENT |
| 7 |
OTP cascade (SMS → WhatsApp → Push → RCS) |
Old: SMS only |
Interface INotificationService.SendOtpCascadeAsync ready, only SMS implemented |
PARTIAL (interface ready, only SMS impl) |
| 8 |
CS Journey on all OTP channels fail |
Not in old code |
ICsJourneyService.CreateHoldAsync |
PRESENT |
| 9 |
Background checks fire async after OTP verify |
Called later in old flow |
FireBackgroundChecksAsync via Task.Run |
PRESENT |
| 10 |
Zintlr phone-to-PAN with plain mobile |
Not in old reg code |
Uses lead.Mobile directly after fix |
PRESENT |
| 11 |
Hyperverge name+DOB fetch |
Called at PAN stage in old code |
HypervergePanProvider.FetchPanDetailsAsync |
PRESENT |
| 12 |
NSDL PAN validation |
PanAPI.VerifyPAN_NSDL() |
NsdlPanProvider.ValidatePanAsync |
PRESENT |
| 13 |
UTI fallback when NSDL DOWN only |
Implicit fallback |
Fixed: checks IsSuccess=false AND exception path |
PRESENT |
| 14 |
CVL KRA status fetch + data download |
USP_INSERT_KRA_LOGS_SJET |
CvlKraPanProvider with status mapping |
PRESENT |
| 15 |
C-safe AML/SEBI/PEP check |
USP_INSERT_CSAFE_Req_Resp |
CsafeProvider.CheckPanAsync with PAN hash |
PRESENT |
| 16 |
Pipeline order: Zintlr → (HV+Csafe) → (NSDL+CVL) |
Sequential in old SPs |
Fixed in BackgroundCheckService |
PRESENT |
| 17 |
Downstream events after OTP verify (CleverTap, Zoho, Datalake, CDP) |
Inline calls in old code |
4 events published via DownstreamEventPublisher |
PRESENT |
| 18 |
KRA raw code mapping to internal status |
Hardcoded in SP |
MapKraRawCodeToStatusAsync with cvl_status_mapping table + hardcoded fallback |
PRESENT |
| STAGE 3 — Email Verification (Checks 19–41) |
| 19 |
Three email paths (KRA prefill, Google OAuth, Manual OTP) |
Manual OTP only in old code |
EmailVerificationService with HandleKraPrefillVerificationAsync, HandleGoogleOAuthVerificationAsync, HandleManualOtpInitiationAsync |
PRESENT |
| 20 |
KRA prefill email confirm (no OTP needed) |
Not in old code |
KraPrefillEmailUsed=true |
PRESENT |
| 21 |
Google OAuth email capture (no OTP needed) |
Not in old code |
EmailSource="GOOGLE_OAUTH" |
PRESENT |
| 22 |
Manual email entry with 4-digit OTP |
OTP via SP in old code |
OtpLength=4, OtpTtlMinutes=10 |
PRESENT |
| 23 |
Email OTP in Redis (TTL 10 min) |
Old: stored in DB |
ICacheService, 10 min TTL |
PRESENT |
| 24 |
Max 5 wrong email OTP attempts → must change email |
Attempt tracking in DB |
MaxOtpAttempts=5, IsLocked=true |
PRESENT |
| 25 |
Max 3 email resends, 30-sec cooldown |
Rate limiting in DB |
MaxResends=3, ResendCooldownSeconds=30 |
PRESENT |
| 26 |
Attempt counter resets on new email |
Implicit in old code |
New OtpVerification created per email |
PRESENT |
| 27 |
Email duplicate check (post-eSign leads) |
Embedded in SP |
Checks CurrentStage >= Esign |
PRESENT |
| 28 |
Restricted email domain check |
Embedded in SP |
RestrictedEmailDomain table query |
PRESENT |
| 29 |
Suspicious email flag (don't block) |
Usp_GetSuspiciousPhoneOrEMailId |
SuspiciousContact check, logs warning |
PRESENT |
| 30 |
Email delivery failure → continue with email_verified=false |
Block on failure in old code |
SendEmailOtpAsync catches exception, sets false |
PRESENT |
| 31 |
Google OAuth failure → silent fallback |
Not in old code |
Handled in controller, returns to manual |
PRESENT |
| 32 |
Downstream events on email verified (CleverTap, Zoho CRM, CDP, Datalake) |
Inline calls in old code |
4 events: CLEVERTAP, ZOHO_CRM, CDP, DATALAKE |
PRESENT |
| 33 |
Email bypass logic (INACTIVE/PMS/OWNER) |
USP_BYPASS_MOBILE_EMAIL_PAN_SJET checks MOSL_FEED for email bypass |
Not found in new backend. No email bypass check. |
MISSING |
| 34 |
Real-time email validation (CYBRIDGE) REMOVED |
REALTIME_EMAIL_VALIDATION API to check deliverability |
No equivalent in new code |
MISSING |
| 35 |
Karza email validation REMOVED |
KARZA_EMAIL_VALIDATION API |
Not required per Product team. N/A |
MISSING |
| 36 |
Custom email validation (SP-based format check) |
USP_CUSTOM_EMAIL_VALIDATION_SJET — extensive checks: no @, multiple @, starts with number, ends with period, forbidden patterns |
New code only does basic format check |
MISSING |
| 37 |
Email whitelist (TBL_ALLOW_EMAIL equivalent) |
TBL_ALLOW_EMAIL — whitelisted domains bypass all validation |
No whitelist table in new code |
MISSING |
| 38 |
OTP bypass for RM-assisted Zoho resume |
USP_INSERT_UPDATE_MOBILE_EMAIL_OTP_BYPASS_SJET — Updated scope: bypass when RM resumes drop-off journey from Zoho CRM only (not franchise) |
No equivalent in new code |
MISSING |
| 39 |
Email validation config flags |
GET_EMAILVALIDATION_FLAG SP controlling which validations to run |
No configurable validation flags in new code |
PARTIAL |
| 40 |
Wait for KRA background check (max 3 sec) |
BRD: wait max 3 seconds for CVL result before rendering Stage 3 |
Background checks fire but no explicit wait/poll for KRA completion |
PARTIAL |
| 41 |
IIBL customer check REMOVED |
ISUSER_IIBL_CUSTOMER — not required per Product team |
No equivalent in new code |
MISSING |
| Priority | Gap | Why It Matters | Recommended Fix |
| P1 |
#33 — Email bypass logic (still needed) |
Without this, legitimate users whose email is in back-office (INACTIVE clients, PMS-only clients, branch/sub-broker OWNERs) will be blocked from proceeding. |
Add email bypass in BackOfficeCheckService. Check client_master for INACTIVE/PMS/OWNER conditions on email. |
| P1 |
#34 — Real-time email validation (Cybridge) |
Without deliverability check, OTPs may be sent to non-existent or undeliverable email addresses, wasting resources and creating poor user experience. |
CYBRIDGE/Karza email validation — REMOVED per Product team. No action needed. |
| P1 |
#35 — Karza email validation |
Secondary validation layer for email deliverability. Provides redundancy when primary provider is down. |
REMOVED per Product team. No action needed. |
| P1 |
#36 — Custom email validation (format checks) |
Pattern checks prevent obviously fake emails (e.g., notprovided@, noemail@, xyz@, domains starting with numbers, trailing periods). Without these, fraudulent or junk emails pass through. |
Add validation rules to EmailVerificationService: forbidden patterns (notprovided, noemail, xyz), domain starts with number, ends with period, multiple @, etc. |
| P1 |
#37 — Email whitelist |
Known-good domains (corporate, government) should skip extended validation. Without this, legitimate corporate emails may be unnecessarily flagged or delayed. |
Create allowed_email_domains table and add whitelist check before blocking. |
| P2 |
#38 — OTP bypass for RM-assisted Zoho resume |
When an RM resumes a dropped-off journey from Zoho CRM, OTP should be bypassed so the RM can continue the application without waiting for customer OTP. |
Add IsRmResumeBypass flag on Lead. When source=ZOHO_RM_RESUME, skip OTP and proceed directly to last completed stage. |
| P2 |
#39 — Email validation config flags |
Runtime control of which validations run allows ops team to toggle checks without deployment. Without this, any validation change requires a code release. |
Use application_config table for flags: ENABLE_CUSTOM_FORMAT_CHECK, ENABLE_WHITELIST_CHECK, ENABLE_RESTRICTED_DOMAIN_CHECK. (CYBRIDGE/Karza flags removed.) |
| P2 |
#40 — KRA wait with 3-sec timeout |
Pre-fill works better with KRA data available. BRD says wait max 3 seconds for CVL result before rendering Stage 3. Without this, Stage 3 may render without KRA prefill even when data arrives 1-2 seconds later. |
Add polling with timeout in GetEmailDetailsAsync: check KRA result every 500ms up to 3 seconds. |
| P2 |
#41 — IIBL customer check |
REMOVED per Product team. Not required. |
No action needed. |
These are the old system's operational tables for Stage 2 and Stage 3. Your new backend has its own equivalents. Do NOT use these tables — they belong to the old EKYC system.