Modules / los-webv1

los-webv1 PRODUCT

The borrower-facing loan-application SPA — a white-labelled, multi-brand onboarding & repayment funnel used directly by loan applicants and their guarantors.

Ground truth as of 2026-09-30

01 Actors & roles

This app has almost no role complexity — and that is itself a notable fact about it. There is no staff or internal actor represented anywhere in the repo.

Correction to the old docs los-webv1 is the borrower-facing app, not a staff console. The old documentation's page list for this repo (leads, CAM, sanctions, collections, credit-exec, admin, reports, global search…) actually describes the sibling repo los-partner, which is the internal staff/DSA CRM. The two apps share the same backend (los-backend) but serve entirely different audiences.
ActorSessionWhat they do
BorrowerOwn OTP sessionThe primary and near-exclusive user of this app. OTP login → full onboarding workflow → loan application/offer → disbursement wait → later repayment and reloan.
GuarantorOwn, separate OTP sessionBacks someone else's loan. Logs in independently, but is routed away from the create-loan (/apply) screen and instead completes only the guarantor-relevant subset of the onboarding workflow (identity/consent steps) via /loan-application, gated by UserRoleEnum.GUARANTOR.

02 End-to-end borrower journey

The full path from landing on a brand's domain to an active, repaying loan. Every step below is brand-configurable — the concrete screen a borrower sees at each step depends on which of ~30 UI templates the brand has assigned to it (see §07).

Borrower onboarding → offer → disbursement → repayment
flowchart TD START(["Borrower lands on
brand hostname"]) --> RESOLVE["Hostname resolves lender brand
(domain header)"] RESOLVE --> HASTOKEN{"Has access
token?"} HASTOKEN -- no --> OTP["Phone OTP login
(Turnstile-gated)"] HASTOKEN -- yes --> BOOT OTP --> BOOT["Brand/step bootstrap
theme, workflow_steps, template version"] BOOT --> WIZARD["Onboarding workflow wizard
(/loan-application)"] subgraph WIZARDSTEPS ["Ordered onboarding steps (brand-configurable)"] direction TB W1["Basic info"] --> W2["Mobile OTP
(if not already done)"] W2 --> W3["Email verification"] W3 --> W4["Geo-location permission"] W4 --> W5["PAN verify / KYC details"] W5 --> W6["Bank account verification"] W6 --> W7["Income proof
(bank statement or AA consent)"] W7 --> W8["Aadhaar verification
(Digilocker via Digitap/Signzy)"] W8 --> W9["Liveness capture
(AWS Amplify / webcam)"] W9 --> W10["Employment details"] W10 --> W11["Alternate phone number"] W11 --> W12["Document uploads"] W12 --> W13["Existing-loan /
debt-consolidation declaration"] W13 --> W14["Add guarantor(s)"] W14 --> W15["BRE wait screen"] end WIZARD --> W1 W15 --> OUTCOME{"Underwriting
outcome"} OUTCOME -- "hard reject /
blocked / deleted" --> REJECTED(["/rejected"]) OUTCOME -- "soft reject" --> REVIEW(["/review
manual ops pending"]) OUTCOME -- "approved" --> OFFER["Loan offer
(/apply — borrower only)"] OFFER --> CREATE["Amount + tenure selection
create-loan"] CREATE --> AGREEMENT["Agreement e-sign / disbursement
(backend + los-partner driven)"] AGREEMENT --> ACTIVE["Loan ACTIVE"] ACTIVE --> REPAY["Repayment
(/repay-now, /profile)"] REPAY --> RELOAN["Re-loan / top-up
(/loan/:loanId/request)"]
  1. Entry & brand resolution
    Borrower lands on a lender's own domain; the hostname resolves the brand server-side (sent as a domain header on every API call). / redirects to /loan-application if a token is present, otherwise to /phone-verification.
  2. Phone verification / OTP login
    Enters mobile number, passes Turnstile captcha, receives & submits OTP (useSignup hook). On success, access/refresh tokens are issued and the session begins. Referral-code capture happens here too if the URL carried ?ref=... or via a /r/:code landing.
  3. Brand/step bootstrap
    App fetches the brand index config (theme, logo, ordered workflow_steps with per-step web_template_version) and the user's currentLoan/status, deciding which template renders each step and whether to fast-path straight to /rejected or /review.
  4. Onboarding workflow wizard
    /loan-application, driven by WorkflowPage + features/workflow/* — an ordered, brand-configurable step list: basic info → mobile OTP (if not already done) → email verification → geo-location permission → PAN verify/KYC → bank account verification → income proof (bank-statement upload or Account Aggregator consent) → Aadhaar verification (Digilocker via Digitap/Signzy redirect) → liveness capture (AWS Amplify face liveness / webcam) → employment details → alternate phone number → document uploads → existing-loan/debt-consolidation declaration → guarantor add → BRE wait screen. Each step is skippable/required per brand config.
  5. Branch — underwriting outcome
    Hard reject / BRE reject / blocked / deleted → /rejected (terminal screen). Soft reject → /review ("Application Under Review", manual ops review pending). Approved → proceeds to loan offer.
  6. Loan offer
    Borrower-only /apply (guarantors are redirected back to their own workflow via BorrowerOnlyRoutes) — amount & tenure selection, submits create-loan; may show a pre-approved amount (recent feature).
  7. Agreement & disbursement
    Agreement e-sign and disbursement itself are backend/los-partner-driven — this app's remaining borrower touchpoints during this phase are status/profile viewing.
  8. Repayment
    /repay-now (public + authenticated variants) and a repay section on /profile; payment via Cashfree or Razorpay (/payment/cashfree, /payment/status-sync, /payment/razorpay-status handle gateway redirect/status reconciliation back into the SPA).
  9. Re-loan / top-up
    Existing borrowers can hit /loan/:loanId/request (features/loanRequest) to request against an existing loan without repeating full onboarding.

03 Guarantor flow

A separate, shorter flow layered on the same app.

  • A guarantor is invited (by the borrower, during the "Add guarantor(s)" workflow step, or by staff via los-partner).
  • The guarantor logs in with their own OTP session — same /phone-verification entry point, independent token.
  • They complete only the guarantor-relevant subset of the onboarding workflow — their own identity/KYC/consent steps — via /loan-application.
  • They are explicitly blocked from the create-loan /apply screen by BorrowerOnlyRoutes (which checks selectIsGuarantor); the backend also rejects create-loan calls from a guarantor account.

04 Repayment & reloan

  • /repay-now — exists both as a public route (no auth needed to start a payment, e.g. from an SMS/WhatsApp reminder link) and as an authenticated flow reachable from /profile.
  • Payment gateways — Cashfree (@cashfreepayments/pg-react SDK, in-app checkout) and Razorpay (redirect/status-callback only, no SDK dependency). Gateway completion is reconciled back into the SPA via /payment/cashfree, /payment/status-sync, and /payment/razorpay-status.
  • Re-loan / top-up — /loan/:loanId/request (features/loanRequest) lets an existing borrower request against an already-disbursed loan without repeating the full onboarding wizard — a materially shorter path than first-time application.

05 Referral flow

/r/:code landing page + URL-param capture (captureReferralCodeFromUrl, callable from anywhere in the app) attributes the eventual signup to a referrer.

Likely downstream effect This app only captures and forwards the referral code — it does not display any reward/coin balance itself. The sibling staff console los-partner exposes a coinWallet concept, suggesting referrals captured here feed a rewards/coin mechanism managed on the staff side.

06 Support & compliance side-channels

Available at any time, independent of login state — none of these are auth-gated.

RoutePurpose
/contact-usGeneral contact form
/grievance_redressal_complaintGrievance redressal complaint form — Turnstile-gated, submits to a dedicated backend grievance service
/complaintWhistleblower complaint form — Turnstile-gated, submits to a dedicated backend whistleblower service

All three are open to anyone — not just applicants — and are gated only by Turnstile captcha, not by authentication, consistent with regulatory expectations that grievance and whistleblower channels not be restricted to existing customers.

07 UX quirks worth documenting

~30 versioned UI templates per step Rather than one canonical design per onboarding step, most workflow steps have up to ~30 alternate UI template implementations (t1…t30), selected per brand + step via backend config (web_template_version, resolved by src/config/brand-version.config.ts). Several dedicated per-brand variant folders exist under features/workflow/common/v8|v16|v19|v24|v29. In practice, "the onboarding flow" is a family of configurable flows, not a single fixed screen sequence — any given borrower's actual screens depend entirely on which brand they're applying through.
Forced-reload version gate On bootstrap, InternalPages calls ensureLatestWebVersion(res.web_version), which forces a reload/update when the deployed build is stale. Given how frequently brand-specific fixes ship (per the commit history), this keeps all brand users on the latest release without relying on a manual cache-bust.
Minor known issue — stale title on /rejected The /rejected terminal screen carries an "Employment Information" page title left over from earlier copy — a low-key, low-severity leftover rather than a functional bug. Worth a cleanup pass but not urgent.