BRD Stage 0 — SESSION_INIT: Before the customer types anything, the platform silently captures their entry point, creates a session, runs fraud pre-checks, and assigns a journey variant. No customer input required.
No explicit Stage 0 in old code. Session was implicit in .NET server context.
RegistrationController.SignUp() received UTM params as part of the registration payload — no separate session creation step.USP_CLIENT_REGISTRATION_SJET — UTM params (utm_source, utm_medium, utm_campaign, GCLID, etc.) passed as parameters and stored directly in TBL_DEDUPE_DATA_DUMP.TBL_DEDUPE_DATA_DUMP (UTM columns), TBL_OAO_DETAILSJoruney_imp_code\Registration\RegistrationController.cs, RegistrationRepository.csDedicated Stage 0 with explicit session creation before registration.
ArrivalController.Init() — GET /api/v1/journey/initArrivalService.InitJourneyAsync()LeadSession — stores UTM params, device info, location, IP, referral code, firebase tokenlead_sessionsServices/Stage0/ArrivalService.cs, Controllers/Stage0/ArrivalController.csPlatform requests location permission immediately on page load. If granted, reverse geocode lat/lng to city/state. If city is in KA/TN/KL/AP/TG → tag SOUTH, else OTHERS. Location denied → re-prompt until granted. Customer cannot proceed to Stage 1 without location.
USP_CAPTURE_SOUTHDETAILS_SJETTBL_OAO_DETAILS and pushed to Zoho CRM directlyRegistrationController.GeoLocation()ArrivalService captures lat/lng in LeadSessionRegistrationService.ResolveSouthTagFromSessionAsync() — looks up LeadSession.LocationTagstate_master.IsSouth flagLead.SouthTag (SOUTH or OTHERS)DownstreamEvent to ZOHO_CRM (async, not direct API call)If referral code present in URL, validate against referral registry. Valid → store as referral_code. Invalid/expired → referral_code = null. Journey continues. No error shown to customer.
[DIY].[USP_VALIDATE_REFERALCODE_SJET]MOSL_FEED_CLIENT_DETAILS — matched CL_code columnRegistrationController.VALIDATEREFERALCODE()Joruney_imp_code\Common\StoreProcedures.cs line 188RegistrationService checks referral_codes table (own table)BackOfficeCheckService.ValidateReferralCodeViaClientMasterAsync() — queries client_master.ClCodelead.ReferralCode = null (cleared silently)Services/Stage1/RegistrationService.cs, Services/Common/BackOfficeCheckService.csreferral_codes table first, then falls back to client_master (synced from MOSL_FEED).Mobile: 10 digits starting 6-9. Name: 2-100 chars alpha+spaces. 3 mandatory consents (Account Opening, Communication/WhatsApp opt-in, T&C). Each consent stored with version, timestamp, IP, platform. Proceed button enabled only when all valid.
CommonClass.CheckDangerousString() — SQL injection check on all fieldsValidation.chk_PhoneNo() — 10-digit Indian mobile. NRI variant: chk_PhoneNo_NRI()Joruney_imp_code\Common\Validation.cs, RegistrationController.cs line 142RegistrationService.ValidateInput()^[6-9]\d{9}$ (compiled)^[a-zA-Z\s]{2,100}$ (alpha + spaces, 2-100 chars)ConsentAccountOpening, ConsentCommunication, ConsentTermsSaveConsentsAsync() creates 3 Consent records with version, IP, platform, timestampServices/Stage1/RegistrationService.cs line 454BRD Priority 1: Mobile on MOFSL negative list OR SEBI debarred list → journey ends permanently. Error: "This number is not eligible." DROP_NEGATIVE_LIST.
USP_CLIENT_REGISTRATION_SJET (5,780 lines)RegistrationService.SignupAsync() — standalone check BEFORE dedupe_db.Set<RestrictedMobile>().AnyAsync(r => (r.Mobile == mobile || r.MobileHash == mobileHash) && r.IsActive)restricted_mobiles (has both Mobile plain and MobileHash)MOBILE_RESTRICTEDServices/Stage1/RegistrationService.csDevice fingerprint check: same device >2 leads in 30 days → flag DEVICE_DEDUP on session. Not blocked at Stage 0, checked again at Stage 1. Suspicious contacts flagged for ops visibility only.
Usp_GetSuspiciousPhoneOrEMailIdLoginRepository.GenerateEmailOTP(), LoginController.GENERATEEMAILOTP()_db.Set<SuspiciousContact>().AnyAsync(s => s.IdentifierHash == mobileHash && s.IdentifierType == "MOBILE" && s.IsActive)suspicious_contactsBRD Priority 2: Active Demat account exists in CBOS for this mobile → journey ends. Error: "An active account already exists. Please log in to RIISE." BE_REG_001. Includes check against back-office client master.
[DIY].[USP_Check_Direct_Offline_Client_EXP_SJET]LoginRepository.AuthenticateLogin() — _accountOpening.Check_Direct_Offline_Client_EXP(strUserID)Joruney_imp_code\Registration\LoginRepository.cs line 163BackOfficeCheckService.CheckOfflineClientAsync(mobile)client_master WHERE Mobile matches AND IsActive AND BranchCode NOT IN ('DIRECT','DAD') AND BranchCode IS NOT NULLBE_REG_OFFLINE_CLIENT — same message as old systemServices/Common/BackOfficeCheckService.cs, called from RegistrationService.SignupAsync()Negative list check on mobile + IP. If API unavailable → proceed with NEGATIVE_LIST_CHECK_SKIPPED flag, manual check triggered post-eSign. Non-blocking with flag.
TBL_FFF_NOT_ALLOW — checked inside Proc_DedupeCheck_LeadSquare_LSQ_SJETRegistrationService.CheckNegativeListWithFallbackAsync(mobileHash, ipAddress)negative_list_entries — supports MOBILE, PAN, IP_ADDRESS types with expiry datesWasSkipped = true, lead tagged NEGATIVE_LIST_CHECK_SKIPPED, ops review post-eSignDROP_NEGATIVE_LISTCBOS dedupe API checks for existing active Demat account. If unavailable → proceed with CBOS_DEDUPE_SKIPPED flag, ops review post-eSign. Run in parallel with negative list and EKYC dedupe.
[DIY].[USP_CHECK_MOBILE_EXISTS_BO_EXP_SJET] (96 lines)VW_MOSL_FEED_CLIENT_DETAILS — active records (InactiveDate IS NULL)TBL_CLIENT_PERSONALDETAILS + TBL_CLIENT_STAGEDETAILS — in-progress leadsTBL_DEDUPE_DATA_DUMP — DedupParam IN (N, EPO, MPO)TBL_DPMASTER — DP master with CM_MOBILETBL_PAN_MOBILE_EMAIL_WHITELIST — exemptions deleted from temp table before check@IsMobileExists (BIT), @Status, @MessageRegistrationService.CheckCbosDedupeAsync(mobile, mobileHash)leads table — WHERE Mobile matches AND IsCompleted AND CurrentState = "ACTIVATED"client_master — WHERE Mobile matches AND IsActive AND InactiveDate IS NULLBackOfficeCheckService.CheckBypassEligibilityAsync("MOBILE", mobile)WasSkipped = true, lead tagged CBOS_DEDUPE_SKIPPEDServices/Stage1/RegistrationService.csBRD does not explicitly define bypass logic — this is carried over from old system's business rules. Bypass allows legitimate users whose mobile/email/PAN is in BO (inactive accounts, PMS-only, branch/subbroker owner) to register.
[DIY].[USP_BYPASS_MOBILE_EMAIL_PAN_SJET] (283 lines)MOSL_FEED_CLIENT_DETAILS, MOSL_FEED_BRANCH, MOSL_FEED_SUBBROKERS@ISBYPASS (1=allowed, 0=blocked)TBL_TRACK_BYPASS_MOBILE_EMAIL_PANBackOfficeCheckService.CheckBypassEligibilityAsync(type, identifierValue)CheckMobileBypassAsync() or CheckEmailBypassAsync()client_master, branch_master, subbroker_master, duplicate_bypass_whitelistduplicate_bypass_whitelistFraudCheck record with CheckType=BYPASSServices/Common/BackOfficeCheckService.cs8-priority eligibility table: P1=Negative list, P2=Active Demat, P3=Old platform redirect, P4=Same channel/BA/RM resume, P5=Different channel block, P6=REJECTED/PERMANENTLY_CLOSED → new lead, P7=CS_EXPIRED → archive + new, P8=No application → new lead. Mobile freed on reset.
Proc_DedupeCheck_LeadSquare_LSQ_SJET (802 lines) — main CRM dedupeUSP_CHECK_NINTY_DAY_LOGIC_LSQ_SJET — 90-day check on Tbl_DAD_TO_RETAIL_TRANSFERRED_LEADSProc_Dedupe_UserIDExistProcess_Revamp_LSQ_SJET — user ID existence + product transitionproc_execute_dad_dedupe_discard_LSQ_SJET — discard/archive old lead for re-registrationTBL_DEDUPE_DATA_DUMP, TBL_LSQ_LEADID_STAGEDETAILS, TBL_DAD_TO_RETAIL_TRANSFERRED_LEADS, TBL_FFF_NOT_ALLOW, TBL_ZOHOEKYC_MAPPERRegistrationService.CheckEkycDedupeAsync(mobile)leads WHERE Mobile matches, NOT completed, CreatedAt >= 90-day cutoff, NOT DROPPED/ARCHIVEDApplyEligibilityDecisionTable() with 8-priority rulesBackOfficeCheckService.CountActiveLeadsAsync() + ArchiveOlderDuplicateLeadsAsync()Services/Stage1/RegistrationService.csLead created with lead_id (UUID), mobile_hash (SHA-256), registration_name, channel, source, UTM, device_type, location_tag. State = INITIATED. Consent records saved before OTP sent. Lead creation retry: 3x at 2-sec intervals. Consent save must succeed before OTP.
[DIY].[USP_CLIENT_REGISTRATION_SJET] — 5,780 lines, 200+ parametersTBL_DEDUPE_DATA_DUMP (plain mobile stored)MOSL_SSO.dbo.tblUser + USR_ADDITIONAL_INFOTBL_STATE_CITY_MASTER_LSQ / MST_CITY_STATETBL_TRACKINGINPUT_USP_CLIENT_REGISTRATION_SJETJoruney_imp_code\Common\StoreProcedures.cs line 186RegistrationService.SaveLeadWithRetryAsync(lead) — 3 retries at 2-sec intervalsLead — stores Mobile (plain) + MobileHashSaveConsentsAsync() — 3 Consent recordsCampaignRoutingService.AssignRmAndBranchAsync(lead) — INDUSIND, IIBLMICROSITE, AUFSB, CBIreferral_codes then client_master.ClCode fallbackServices/Stage1/RegistrationService.cs4-digit OTP, 5-min validity, stored in memory only (never DB). Max 5 wrong attempts → DROPPED. Max 3 resends in 30 min. 30-sec cooldown. Delivery cascade: SMS → WhatsApp → Push → RCS (only SMS implemented currently). All channels fail → CS Journey CS_OTP_PROVIDER_DOWN.
SEND_RESUME_OTP — generated OTP, stored in databaseSingleMessageService SOAP API (Netcore) — SMS only, no cascadeSMSTemplate class[DIY].[USP_INSERT_SMS_SEND_API_LOG_SJET]Joruney_imp_code\Registration\LoginRepository.csOtpGeneratorService.GenerateOtp(4) — 4-digit cryptographic randomInMemoryOtpStore (ConcurrentDictionary keyed by mobile, TTL 5 min). Never in DB.NetcoreSmsProvider — MOSL internal SMS service (mosms.motilaloswal.com)SmsTemplateServiceOtpVerification entity tracks attempts/resends (but OTP value only in memory)Services/Stage1/RegistrationService.cs, Caching/InMemoryOtpStore.csOn lead creation, push to: CleverTap (registration_proceed_en, lead_created_en), Zoho CRM (new lead with mobile_hash, source, location_tag), RIISE App (pre-create customer profile), GCM, Datalake, CDP. All async, non-blocking.
PROC_DEDUPECHECK_LEADSQUARE_LSQ_SJET, USP_LEADSQUARED_REQUEST_RESPONSE_LOG_SJET, USP_UPDATE_LSQLEADID_SJETIsZohoLead flagJoruney_imp_code\Registration\RegistrationRepository.cs, ExternalAPI\LeadSquare\LeadSquare.cs, ExternalAPI\Zoho\zohoApi.csRegistrationService.PublishDownstreamEventsAsync(lead)DownstreamEvent records (async, non-blocking)Services/Stage1/RegistrationService.csPer Product team decision: When RM resumes a dropped-off journey from Zoho CRM, OTP is bypassed. Customer proceeds directly to last completed stage. This applies to RM-assisted Zoho resume only (not franchise users).
[DIY].[USP_INSERT_UPDATE_MOBILE_EMAIL_OTP_BYPASS_SJET]TBL_MOBILE_EMAIL_OTP_BYPASS_DETAILS — ISMOBILEBYPASS / ISEMAILBYPASS flagsRegistrationService.SignupAsync() checks command.Source == "ZOHO_RM_RESUME" || command.IsRmResumeexistingLead.IsRmResumeBypass = trueOtpVerificationService.VerifyOtpAsync() — if lead.IsRmResumeBypass, skips OTP entirely, transitions directly to OTP_VERIFIED, fires background checksServices/Stage1/RegistrationService.cs, Services/Stage2/OtpVerificationService.cs