chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow#3
chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow#3tomerqodo wants to merge 2 commits into
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.
| createdDate: true, | ||
| trialEndsAt: true, | ||
| completedOnboarding: true, | ||
| locale: true, |
There was a problem hiding this comment.
Organizer locale removed from user select breaks translations
Medium Severity
The locale: true field was removed from userSelect in UserRepository. The handleCancelBooking.ts code now uses userRepository.findByIdOrThrow to fetch the organizer, which relies on this select. Since locale is no longer fetched, organizer.locale will always be undefined, causing the translation and language settings to silently default to English ("en") via the fallback operator.
Additional Locations (1)
| externalCalendarId: true, | ||
| credentialId: true, | ||
| }, | ||
| gte: bookingToDelete.startTime, |
There was a problem hiding this comment.
Recurring booking find query uses wrong date filter
Medium Severity
The query to find cancelled recurring bookings changed from gte: new Date() to gte: bookingToDelete.startTime. When allRemainingBookings is true, the update query uses gte: new Date() but the find query now uses bookingToDelete.startTime. This mismatch causes the find to potentially return bookings that weren't actually cancelled, or miss bookings that were, depending on whether the booking's start time is before or after the current time.
Benchmark PR from agentic-review-benchmarks#3
Note
Modernizes the booking cancellation path to use repository abstractions and dependency injection.
BookingCancelServicenow receivesuser,booking,profile,bookingReference, andbookingAttendeerepositories; handler updated to consume these deps instead of direct PrismaPrismaBookingAttendeeRepository; extendsBookingReferenceRepositorywithupdateManyByBookingId; implementsProfileRepository.findFirstByUserId; augmentsBookingRepositorywithupdateMany,updateIncludeWorkflowRemindersAndReferences, andfindManyIncludeWorkflowRemindersAndReferencesBookingCancelServicein features and NestBookingCancelModuleWritten by Cursor Bugbot for commit e5d60b2. Configure here.