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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5d60b2b47
ℹ️ 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".
| recurringEventId: bookingToDelete.recurringEventId, | ||
| startTime: { | ||
| gte: new Date(), | ||
| }, | ||
| }, | ||
| select: { | ||
| id: true, | ||
| startTime: true, | ||
| endTime: true, | ||
| references: { | ||
| select: { | ||
| uid: true, | ||
| type: true, | ||
| externalCalendarId: true, | ||
| credentialId: true, | ||
| }, | ||
| gte: bookingToDelete.startTime, | ||
| }, |
There was a problem hiding this comment.
Use the same cutoff when collecting cancelled recurrences
When allRemainingBookings is true but cancelSubsequentBookings is false, the cancellation update uses gte: new Date() while this lookup uses gte: bookingToDelete.startTime, so updatedBookings can miss newly-cancelled bookings between now and the cancelled booking (or include past ones). That list is later used to clear webhook triggers/workflow reminders, so those cleanups will be skipped or misapplied in that scenario. Consider reusing the same gte value used for updateMany so the side-effect cleanup covers exactly the bookings you just cancelled.
Useful? React with 👍 / 👎.
| createdDate: true, | ||
| trialEndsAt: true, | ||
| completedOnboarding: true, | ||
| locale: true, | ||
| timeFormat: true, | ||
| twoFactorSecret: true, |
There was a problem hiding this comment.
Preserve locale in userSelect for cancellation i18n
The organizer for cancellations is now loaded via UserRepository.findByIdOrThrow, which uses userSelect. Removing locale from that select means organizer.locale is always undefined, so getTranslation(organizer.locale ?? "en", ...) in the cancellation flow will always fall back to English. This is a regression for non-English organizers and will send cancellation emails/notifications in the wrong language; add locale: true back to userSelect or adjust the lookup to include it.
Useful? React with 👍 / 👎.
Benchmark PR from agentic-review-benchmarks#3