From 1f34c06130fdbf34c627733c2c80fd55e1a81744 Mon Sep 17 00:00:00 2001 From: Roba Boru Date: Tue, 14 Jul 2026 10:14:42 +0300 Subject: [PATCH] Fix error message on passenger information --- .../portal/src/app/booking/passengers/page.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx index 607548f13..c7efd7b9b 100644 --- a/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx +++ b/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx @@ -994,8 +994,20 @@ function PassengersForm() { const onInvalid = () => { // Sections still behind the Fayda verify screen stay collapsed here — they only expand // when the user explicitly clicks "Enter details manually" (shown only when Fayda is - // unavailable). - setSubmitError('Please fix the highlighted errors before continuing.'); + // unavailable). Their name/DOB/gender fields are still empty at this point, which would + // otherwise surface as a generic "fix the highlighted errors" message that doesn't point + // at the actual cause — tell the user to verify with Fayda instead. + const needsFaydaVerification = passengers.some((p, i) => { + const isEthiopian = p?.nationality === 'ETHIOPIAN'; + const isChildPassenger = i >= adultCount; + const isLoggedInAndVerified = i === 0 && isAuthenticated && user?.faydaVerified; + return isEthiopian && faydaEnabled && !p?.formExpanded && !isLoggedInAndVerified && !isChildPassenger; + }); + setSubmitError( + needsFaydaVerification + ? 'Please verify your identity with Fayda before continuing — tap "Verify with Fayda" above to proceed.' + : 'Please fix the highlighted errors before continuing.' + ); }; const onSubmit = async (data: FormData) => {