diff --git a/apps/edr-passenger-web/portal/src/app/booking/auth-check/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/auth-check/page.tsx index 0ef5c74ec..43775b1c7 100644 --- a/apps/edr-passenger-web/portal/src/app/booking/auth-check/page.tsx +++ b/apps/edr-passenger-web/portal/src/app/booking/auth-check/page.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useAuthStore } from '@/lib/auth-store'; +import { useBookingStore } from '@/lib/booking-store'; import { LogIn, UserPlus, ChevronLeft } from 'lucide-react'; function Tooltip({ children, content }: { children: React.ReactNode; content: string[] }) { @@ -41,6 +42,23 @@ function Tooltip({ children, content }: { children: React.ReactNode; content: st export default function AuthCheckPage() { const router = useRouter(); const { isAuthenticated, initialize } = useAuthStore(); + const searchCriteria = useBookingStore((s) => s.searchCriteria); + + const buildResultsUrl = () => { + if (!searchCriteria) return '/booking/results'; + const params = new URLSearchParams({ + tripType: searchCriteria.tripType, + origin: searchCriteria.originStationId, + destination: searchCriteria.destinationStationId, + date: searchCriteria.departureDate, + adults: searchCriteria.adultCount.toString(), + children: searchCriteria.childCount.toString(), + nationality: searchCriteria.nationality, + }); + if (searchCriteria.returnDate) params.set('returnDate', searchCriteria.returnDate); + if (searchCriteria.promoCode) params.set('promoCode', searchCriteria.promoCode); + return `/booking/results?${params}`; + }; useEffect(() => { initialize(); @@ -94,7 +112,7 @@ export default function AuthCheckPage() {
+ This phone number and email will be used for booking and ticketing communication for all passengers. +
+{errors.contactEmail.message}
+ )} +{submitError}
++ Your booking is successfully reserved +
++ Booking Reference: {pnr} +
++ Please complete the payment below to confirm your booking. Your seats are held temporarily until payment is completed. +
+Order ID: {merchantOrderId}
} {trxRef &&Ref: {trxRef}
}Ref: {referenceId || transactionId}
)}{searchData.date ? format(new Date(searchData.date), 'EEEE, MMMM d, yyyy') : ''}
- {searchData.returnDate ? format(new Date(searchData.returnDate), 'EEEE, MMMM d, yyyy') : ''} -
-Outbound journey selected
++ {outboundScheduleData.origin} → {outboundScheduleData.destination} + {outboundScheduleData.selectedSeatClassName ? ` · ${outboundScheduleData.selectedSeatClassName}` : ''} +
++ {searchData.returnDate ? format(new Date(searchData.returnDate), 'EEEE, MMMM d, yyyy') : ''} +
+{(p as any).outboundSeatId ? (seatDetails[`outbound-${(p as any).outboundSeatId}`] || 'Loading...') : 'Auto-assign'}
+ {(p as any).outboundSeatId && ( +{formatSeatClass(outboundSchedule)}
+ )}Return Seat
{(p as any).inboundSeatId ? (seatDetails[`inbound-${(p as any).inboundSeatId}`] || 'Loading...') : 'Auto-assign'}
+ {(p as any).inboundSeatId && ( +{formatSeatClass(inboundSchedule)}
+ )}Seat
{p.seatId ? (seatDetails[p.seatId] || 'Loading...') : 'Auto-assign'}
+ {p.seatId && ( +{formatSeatClass(selectedSchedule)}
+ )}+ Now selecting: {activePassenger?.name || `Passenger ${activePassengerIndex + 1}`} +
+ )} +