[CLEAN] Synthetic Benchmark PR #24159 - chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow#659
Open
tomerqodo wants to merge 1 commit intobase_pr_24159_20260121_7441from
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR calcom#24159
Type: Clean (correct implementation)
Original PR Title: chore: [Booking Cancellation Refactor - 2] Inject repositories and use them instead of Prisma in cancellation flow
Original PR Description: ## What does this PR do?
This PR refactors the booking cancellation flow (
handleCancelBooking.ts) to use the repository pattern with dependency injection instead of direct Prisma client usage. This is part of a broader architectural improvement to make the codebase more modular and testable.Key Changes:
Repositories Added/Modified:
PrismaBookingAttendeeRepository- handles attendee deletion operationsBookingReferenceRepository- handles booking reference cleanupProfileRepository- handles profile lookupsBookingRepository- extended with cancellation-specific methodsUpdates since last revision
onBookingCancelledcall - Removed an accidental duplicate call tobookingEventHandlerService.onBookingCancelled()that was introduced during merge conflict resolution. The audit event is now correctly triggered only once per booking cancellation.How should this be tested?
Environment Setup:
Test Scenarios:
Expected Behavior:
Critical Review Areas
Repository method implementations - Verify that each new repository method exactly replicates the original Prisma behavior, including:
Transaction behavior - Ensure the repository abstraction doesn't break any implicit transaction boundaries from the original code
Conditional logic simplification - The PR changes from
uid ? { uid } : { id }to always usingbookingToDelete.uid- verify this is safe for all booking typesDependency injection setup - Review the module bindings and ensure all dependencies are correctly wired
Fallback path consistency - The code maintains dual paths (repository vs direct Prisma) - ensure they remain in sync
Mandatory Tasks (DO NOT REMOVE)
Link to Devin run: https://app.devin.ai/sessions/469183c6bfa54d5d8f4b69873c2e8b6a
Requested by: @hariombalhara
Original PR URL: calcom#24159