Use tripdata payload to get reservations setup#63853
Conversation
|
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@hoangzinh Ready for initial testing and Q&A. I will add tests and checklist tomorrow. |
|
Thank you @parasharrajat. I will try to review the PR soon |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-06-18.at.23.32.05.android.movAndroid: mWeb ChromeScreen.Recording.2025-06-18.at.23.34.15.android.chrome.moviOS: HybridAppScreen.Recording.2025-06-18.at.23.37.20.moviOS: mWeb SafariScreen.Recording.2025-06-18.at.23.19.32.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-06-18.at.23.12.13.web.movMacOS: DesktopScreen.Recording.2025-06-18.at.23.15.29.desktop.mov |
src/pages/Travel/TripDetailsPage.tsx
Outdated
| const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID ?? route.params.reportID}`, {canBeMissing: true}); | ||
| console.debug('[TripDetailsPage] Rendering', parentReport?.tripData); |
There was a problem hiding this comment.
Will we revert those change? If parentReport doesn't exist, we already have fallback in getReservationsFromTripReport
There was a problem hiding this comment.
I reverted the comment. What else are you suggesting to revert?
| if (!tripRoomReport) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
It makes sense for me to return null here. But I prefer we should revert it to avoid hidden logic that we haven't been aware of
There was a problem hiding this comment.
But the next logic with throw an error as it requires the tripRoomReport data. Also, if data is not present, there will be no data for reservationsData; thus, reservationsData for loop will not render anything. There will be an empty header called tripSummary. So I don't think there is any hidden logic here. When data is available, the tripsummary header and data is shown as once instead of first showing empty trip summary header.
|
@parasharrajat can you add unit tests for this new func? |
|
@hoangzinh Let's start testing. I will add unit tests along the way when we are finalized on payload. |
rlinoz
left a comment
There was a problem hiding this comment.
It looks really good and tests are going well!
|
@rlinoz I'm unable to book a train in Spotnana staging. If you can, can you help test |
|
Bug1: I think we are missing a merge with main, the messages are recently merged. Great catches btw. I will check about the train. |
|
This is where I think my parsing is correct, then what we have currently on staging. We are showing post code and countries, etc., in other bookings, but not for the car on staging. Is there any special reason for it? Or if you want me to follow the same mapping as staging, I can update that. |
|
I had to use another key called sequenceIndex to refer to the correct booking in all the reservations. It is just incremental via and remains unique across all reservations. The Reservation Index in `transaction.receipt.reservationList was referring to the reservations in a single transaction/booking. Normally, we can have multiple bookings under the same PNR, and a single booking can be multiple reservations, for example, connecting flights. The reservation index refers to the reservation in a booking. Thus, they can be the same under a single PNR. This makes it bad to use them to refer to a particular reservation when we are parsing all PNRs together from the payload into a list of reservations. We still need this reservationsIndex when we need to calculate the layover time, as we need to know the previous connecting flight. cc: @hoangzinh @rlinoz |
|
Ready for review. |
|
Done. |
|
Nice, let's get this done! Rails is working correctly, going over the PR now.
@hoangzinh are you able to finish the review today? |
|
Yes, I can |
rlinoz
left a comment
There was a problem hiding this comment.
Just one very minor nitpick, then we can merge
|
Thanks! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.1.70-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.70-7 🚀
|
3 similar comments
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.70-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.70-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.70-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.70-7 🚀
|








Explanation of Change
Fixed Issues
$ #63256
PROPOSAL:
Tests
Offline tests
You can't book travel offline.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
18.06.2025_02.24.35_REC.mp4
Android: mWeb Chrome
18.06.2025_02.18.31_REC.mp4
iOS: Native
18.06.2025_02.19.37_REC.mp4
iOS: mWeb Safari
18.06.2025_02.16.24_REC.mp4
MacOS: Chrome / Safari
18.06.2025_02.06.57_REC.mp4
MacOS: Desktop
18.06.2025_02.23.57_REC.mp4