-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Integrate confirmation booking audit #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: greptile_combined_20260121_qodo_grep_cursor_copilot_1_base_chore_integrate_confirmation_booking_audit_pr714
Are you sure you want to change the base?
Conversation
Greptile SummaryThis PR integrates booking audit tracking into the confirmation flow by adding Key changes:
Critical issue found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Client/User
participant API as API Route/TRPC
participant ConfirmHandler as confirmHandler
participant HandleConfirmation as handleConfirmation
participant BookingEventHandler as BookingEventHandlerService
participant Prisma as Database
participant EventManager as EventManager
participant Webhooks as Webhooks/Workflows
Client->>API: Confirm booking request
Note over Client,API: Via WEBAPP, API_V2, or MAGIC_LINK
API->>API: Create actor (makeUserActor/makeAppActor)
API->>API: Set actionSource
API->>ConfirmHandler: confirmHandler(input, ctx)
ConfirmHandler->>Prisma: Get booking details
Prisma-->>ConfirmHandler: Booking data
ConfirmHandler->>ConfirmHandler: Authorize user access
alt Booking Confirmed
ConfirmHandler->>HandleConfirmation: handleConfirmation(...)
HandleConfirmation->>EventManager: Create calendar events
EventManager-->>HandleConfirmation: Event creation results
alt Recurring Event
HandleConfirmation->>Prisma: Find unconfirmed recurring bookings
HandleConfirmation->>BookingEventHandler: fireBookingAcceptedEvent (bulk)
BookingEventHandler->>Prisma: Queue audit tasks
HandleConfirmation->>Prisma: Update all recurring bookings
else Single Event
HandleConfirmation->>Prisma: Update booking status
HandleConfirmation->>BookingEventHandler: fireBookingAcceptedEvent (single)
BookingEventHandler->>Prisma: Queue audit task
end
HandleConfirmation->>Webhooks: Send confirmation emails
HandleConfirmation->>Webhooks: Schedule workflow reminders
HandleConfirmation->>Webhooks: Trigger webhooks (BOOKING_CREATED)
HandleConfirmation-->>ConfirmHandler: Success
else Booking Rejected
ConfirmHandler->>Prisma: Update booking status to REJECTED
ConfirmHandler->>BookingEventHandler: fireRejectionEvent
BookingEventHandler->>Prisma: Queue rejection audit task
ConfirmHandler->>Webhooks: Send rejection emails
ConfirmHandler->>Webhooks: Trigger webhooks (BOOKING_REJECTED)
ConfirmHandler-->>Client: Rejection confirmed
end
ConfirmHandler-->>API: Return result
API-->>Client: Confirmation/Rejection response
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
26 files reviewed, 1 comment
| updatedBookings.push(updatedBooking); | ||
| acceptedBookings = [ | ||
| { | ||
| oldStatus: BookingStatus.ACCEPTED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: oldStatus incorrectly set to BookingStatus.ACCEPTED; should be booking.status (the booking's status before confirmation)
| oldStatus: BookingStatus.ACCEPTED, | |
| oldStatus: booking.status, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/features/bookings/lib/handleConfirmation.ts
Line: 413:413
Comment:
**logic:** `oldStatus` incorrectly set to `BookingStatus.ACCEPTED`; should be `booking.status` (the booking's status before confirmation)
```suggestion
oldStatus: booking.status,
```
How can I resolve this? If you propose a fix, please make it concise.
Benchmark PR from qodo-benchmark#714