Skip to content

chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow#3

Open
tomerqodo wants to merge 2 commits into
cursor_full_base_chore_booking_cancellation_refactor_-_2_inject_repositories_and_use_them_instead_of_prisma_in_cancellation_flow_pr3from
cursor_full_head_chore_booking_cancellation_refactor_-_2_inject_repositories_and_use_them_instead_of_prisma_in_cancellation_flow_pr3
Open

chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow#3
tomerqodo wants to merge 2 commits into
cursor_full_base_chore_booking_cancellation_refactor_-_2_inject_repositories_and_use_them_instead_of_prisma_in_cancellation_flow_pr3from
cursor_full_head_chore_booking_cancellation_refactor_-_2_inject_repositories_and_use_them_instead_of_prisma_in_cancellation_flow_pr3

Conversation

@tomerqodo

@tomerqodo tomerqodo commented Jan 25, 2026

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#3


Note

Modernizes the booking cancellation path to use repository abstractions and dependency injection.

  • BookingCancelService now receives user, booking, profile, bookingReference, and bookingAttendee repositories; handler updated to consume these deps instead of direct Prisma
  • New/updated repos: adds PrismaBookingAttendeeRepository; extends BookingReferenceRepository with updateManyByBookingId; implements ProfileRepository.findFirstByUserId; augments BookingRepository with updateMany, updateIncludeWorkflowRemindersAndReferences, and findManyIncludeWorkflowRemindersAndReferences
  • Wires DI: new modules/tokens for repositories and BookingCancelService in features and Nest BookingCancelModule
  • Updates platform library exports to expose new repos
  • Adds tests for seated event attendee deletion, bulk/subsequent recurring cancellations, and booking reference cleanup

Written by Cursor Bugbot for commit e5d60b2. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

externalCalendarId: true,
credentialId: true,
},
gte: bookingToDelete.startTime,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant