fix: return rescheduledByEmail in V2 bookings#22804
Conversation
WalkthroughThe changes update the logic for retrieving and handling rescheduling information in the booking output service. The previous method, which returned only the UID of a rescheduled booking, is replaced with a new method that returns both the UID and the email of the user who performed the rescheduling. Calls to the old method are updated to use the new method, and the returned object is destructured accordingly. The construction of booking output objects is modified to use the newly obtained email information, and the method signature is updated to reflect the new return type. Additionally, a new end-to-end test case is added to verify that the rescheduled booking output correctly includes the email of the user who performed the reschedule. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
| databaseBooking.status === "CANCELLED" ? databaseBooking.cancellationReason : undefined, | ||
| cancelledByEmail: databaseBooking.status === "CANCELLED" ? databaseBooking.cancelledBy : undefined, | ||
| reschedulingReason: bookingResponses?.rescheduledReason, | ||
| rescheduledByEmail: databaseBooking.rescheduledBy || undefined, |
There was a problem hiding this comment.
The current (rescheduled) booking would not contain this detail as it is stored in the previous (original) booking, just like rescheduledToUid. So we fetch it from there.
No, maybe we should add it for both original and new bookings. Let me update 🙏 |
E2E results are ready! |
Both points addressed! |
What does this PR do?
Fixes the bug where we try to fetch rescheduledByEmail from the new booking instead of the original booking that was rescheduled.
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?