{"record":{"id":"2bda63b8c7368b16","repo":"calcom/cal.diy","slug":"booking-with-seatuid-seatuid-was-not-found-in-t","errorCode":null,"errorMessage":"Booking with seatUid=${seatUid} was not found in the database","messagePattern":"Booking with seatUid=(.+?) was not found in the database","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts","lineNumber":599,"sourceCode":"      throw new NotFoundException(`Booking with uid=${uid} was not found in the database`);\n    }\n    const ids = recurringBooking.map((booking) => booking.id);\n    const isRecurringSeated = !!recurringBooking[0].eventType?.seatsPerTimeSlot;\n    if (isRecurringSeated) {\n      const showAttendees =\n        userIsEventTypeAdminOrOwner || !!recurringBooking[0].eventType?.seatsShowAttendees;\n      return this.outputService.getOutputRecurringSeatedBookings(ids, showAttendees);\n    }\n\n    return this.outputService.getOutputRecurringBookings(ids);\n  }\n\n  async getBookingBySeatUid(seatUid: string, authUser: AuthOptionalUser) {\n    const bookingSeat =\n      await this.bookingSeatRepository.getByReferenceUidIncludeBookingWithAttendeesAndUserAndEvent(seatUid);\n\n    if (!bookingSeat || !bookingSeat.booking) {\n      throw new NotFoundException(`Booking with seatUid=${seatUid} was not found in the database`);\n    }\n\n    const booking = bookingSeat.booking;\n    const userIsEventTypeAdminOrOwner =\n      authUser && booking.eventType\n        ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(\n            authUser,\n            booking.eventType as EventType\n          )\n        : false;\n\n    const isRecurring = !!booking.recurringEventId;\n    const seatsShowAttendees = !!booking.eventType?.seatsShowAttendees;\n    const showAllAttendees = userIsEventTypeAdminOrOwner || seatsShowAttendees;\n\n    // When user is not admin and seatsShowAttendees is false, show only the attendee for this seatUid\n    if (!showAllAttendees) {\n      const seatAttendee = booking.attendees.find(","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts#L581-L617","documentation":"Thrown by getBookingBySeatUid when the booking seat lookup (bookingSeatRepository.getByReferenceUidIncludeBookingWithAttendeesAndUserAndEvent) returns null or returns a seat with no associated booking. Maps to NotFoundException (HTTP 404).","triggerScenarios":"A GET request that resolves a booking by its seat UID (e.g. individual seat in a seated event) where the seatUid does not exist, was cancelled, or never created.","commonSituations":"Using the booking uid instead of the seat uid; seat was cancelled via cancelBooking with seatUid; seatUid from a different environment.","solutions":["Confirm the value passed is a seatUid (returned when booking a seat), not the parent booking uid.","If the seat was cancelled, it is removed — retrieve the parent booking and use a valid seat uid.","List seats via the booking detail endpoint to find an active seatUid."],"exampleFix":"// before\nconst res = await client.get(`/v2/bookings?seatUid=${bookingUid}`);\n// after — use the seatUid from the original seated booking response\nconst res = await client.get(`/v2/bookings?seatUid=${seat.seatUid}`);","handlingStrategy":"validation","validationCode":"const booking = await client.get(`/v2/bookings/${parentUid}`);\nconst seat = booking.seats?.find(s => s.seatUid === seatUid);\nif (!seat) throw new Error('seatUid not active under booking');","typeGuard":"function isSeatUid(uid: string, knownSeats: string[]): boolean {\n  return knownSeats.includes(uid);\n}","tryCatchPattern":"try { return await client.get(`/v2/bookings?seatUid=${seatUid}`); }\ncatch (e) {\n  if (e.status === 404 && /seatUid/.test(e.message)) { /* fetch parent, find active seat */ }\n  else throw e;\n}","preventionTips":["Differentiate seatUid from bookingUid in your domain model","Refresh seat list from the parent booking","Do not reuse cancelled seat uids"],"tags":["api-v2","bookings","seats","not-found","uid"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}