chore: Integrate confirmation booking audit#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0626d90923
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| acceptedBookings = [ | ||
| { | ||
| oldStatus: BookingStatus.ACCEPTED, | ||
| uid: booking.uid, |
There was a problem hiding this comment.
Preserve pre-accept status in audit payload
When confirming a non-recurring booking, acceptedBookings is populated with oldStatus: BookingStatus.ACCEPTED, which is the post-update status rather than the pre-update one. This makes the booking-audit event record a no-op transition (ACCEPTED -> ACCEPTED) even when the booking was previously PENDING, so downstream audit/reporting loses the true state change. Use the original booking.status (or capture it before the update) as oldStatus.
Useful? React with 👍 / 👎.
| rejectedBookings = updatedRecurringBookings.map((recurringBooking) => ({ | ||
| uid: recurringBooking.uid, | ||
| oldStatus: recurringBooking.status, | ||
| })); |
There was a problem hiding this comment.
Use pre-update status for recurring rejection audit
In the recurring rejection flow, rejectedBookings is derived from updatedRecurringBookings after the status update, so oldStatus is captured as REJECTED. This loses the original status (typically PENDING) and records an incorrect transition in booking-audit events for recurring series. Use the statuses from unconfirmedRecurringBookings (captured before the update) for oldStatus.
Useful? React with 👍 / 👎.
Benchmark PR from agentic-review-benchmarks#10