chore: Integrate confirmation booking audit#10
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| oldStatus: BookingStatus.ACCEPTED, | ||
| uid: booking.uid, | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
Wrong old status recorded for non-recurring booking acceptance
Medium Severity
When accepting a non-recurring booking, oldStatus is hardcoded to BookingStatus.ACCEPTED instead of using booking.status. This records the new status as both old and new in the audit log, defeating the purpose of tracking status changes. The booking parameter already contains the original status property which represents the state before the update.
| rejectedBookings = updatedRecurringBookings.map((recurringBooking) => ({ | ||
| uid: recurringBooking.uid, | ||
| oldStatus: recurringBooking.status, | ||
| })); |
There was a problem hiding this comment.
Wrong old status recorded for recurring booking rejection
Medium Severity
For recurring booking rejection, rejectedBookings is populated from updatedRecurringBookings which is fetched AFTER the status update to REJECTED. This means oldStatus contains the new status (REJECTED) instead of the original status (PENDING). The existing unconfirmedRecurringBookings variable (fetched before the update) contains the correct pre-update status and should be used instead.
Benchmark PR from agentic-review-benchmarks#10
Note
Integrates booking-audit into confirmation/rejection flows with explicit
actorandactionSourcepropagation and bulk handling.actorviamakeUserActorandactionSource(API_V2,WEBAPP,WEBHOOK,MAGIC_LINK) toconfirmHandler, API v2 services, and magic-link routeshandleConfirmationto fire booking accepted audit events (single/bulk) viaBookingEventHandlerService; add equivalent rejection flow inconfirm.handlergetAppActorand pass app actors to payment success path; refactorhandlePaymentSuccessto new param object and includeactorRejectedAuditActionService; producer interface/tasker supportsqueueBulkRejectedAuditBookingAuditSource.MAGIC_LINKand migration; exportmakeUserActorin platformappSlugWritten by Cursor Bugbot for commit 0626d90. Configure here.