feat: enable requires-confirmation with seats; per-seat confirmation for BookingSeat#27914
Draft
feat: enable requires-confirmation with seats; per-seat confirmation for BookingSeat#27914
Conversation
… and per-seat confirmation; update UI and tests Co-Authored-By: peer@cal.com <peer@cal.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
There was a problem hiding this comment.
1 issue found across 14 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/trpc/server/routers/viewer/bookings/confirm.handler.ts">
<violation number="1" location="packages/trpc/server/routers/viewer/bookings/confirm.handler.ts:273">
P2: Per-seat confirmation returns before the existing confirmation/rejection workflows, so seat confirmations/rejections skip emails, calendar events, and webhook workflows. If seat-level confirmation is meant to mirror booking confirmation, this early return should trigger the same notification flows (or explicitly document that seats are silent).</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }); | ||
|
|
||
| const message = confirmed ? "Seat confirmed" : "Seat rejected"; | ||
| return { message, status: newStatus }; |
Contributor
There was a problem hiding this comment.
P2: Per-seat confirmation returns before the existing confirmation/rejection workflows, so seat confirmations/rejections skip emails, calendar events, and webhook workflows. If seat-level confirmation is meant to mirror booking confirmation, this early return should trigger the same notification flows (or explicitly document that seats are silent).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/trpc/server/routers/viewer/bookings/confirm.handler.ts, line 273:
<comment>Per-seat confirmation returns before the existing confirmation/rejection workflows, so seat confirmations/rejections skip emails, calendar events, and webhook workflows. If seat-level confirmation is meant to mirror booking confirmation, this early return should trigger the same notification flows (or explicitly document that seats are silent).</comment>
<file context>
@@ -238,12 +239,40 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
+ });
+
+ const message = confirmed ? "Seat confirmed" : "Seat rejected";
+ return { message, status: newStatus };
+ }
+
</file context>
Co-Authored-By: peer@cal.com <peer@cal.com>
Co-Authored-By: peer@cal.com <peer@cal.com>
Co-Authored-By: peer@cal.com <peer@cal.com>
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.
What does this PR do?
Enables the "Requires confirmation" feature to work with seated events. Previously, these two features were mutually exclusive. Now hosts can require confirmation for seated events and confirm/reject individual seat requests from the bookings page.
Key changes:
statusfield toBookingSeatmodel to track per-seat confirmation statusACCEPTEDfor seated events; individual seats track their ownPENDING/ACCEPTED/REJECTEDstatusseatReferenceUidparameterPendingSeatsSection) on the bookings page showing each pending attendee with Accept/Reject buttonsLink to Devin run: https://app.devin.ai/sessions/39ca226d3ca84a278ea4ac469c74d753
Requested by: @PeerRich
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
/bookings→ "Unconfirmed" tab — the booking should appear with a "Pending seats" section listing each attendee with their name/emailPer-seat confirmation returns early without sending emails or calendar events — The new seat confirmation path in
confirm.handler.ts(line ~260) returns{ message, status }early without sending confirmation emails or creating calendar events. TheonSuccesshandler inuseBookingConfirmationchecksdata?.status === BookingStatus.REJECTEDwhich may not match since the confirm handler returns the raw enum string. Verify this interaction works correctly.Parent booking always ACCEPTED for seated events — In
createBooking.ts, seated events now always getBookingStatus.ACCEPTEDregardless ofrequiresConfirmation. Verify no downstream logic relies on checkingbooking.statusto determine if confirmation is needed for the overall booking.Seat status case mismatch — The Kysely query returns lowercase DB enum values (
"pending") whileBookingStatus.PENDINGis uppercase. TheBookingListItemuses.toLowerCase() === "pending"as a workaround. Theget.handler.tsunconfirmed filter uses the lowercase"pending"string directly. This inconsistency should be verified.No unit tests for
PendingSeatsSectioncomponent — The new UI component for per-seat confirmation lacks dedicated test coverage.Checklist