Skip to content

fix: v2 cancelling seated booking as a host #21743

Description

@linear

Problem

If host is cancelling a seated booking by making POST request to /v2/bookings/:bookingUid/cancel and request body:

{
    "seatUid": "a8f2ca7a-3a8a-4eb6-b364-75f94401eaab"
}

and bearer header containing credential of the host

Authorization: Bearer abc

response is returned

{
    "statusCode": 400,
    "message": "Cancellation reason is required when you are the host"
}

and if cancellation reason is provided in the request body

{
    "seatUid": "a8f2ca7a-3a8a-4eb6-b364-75f94401eaab",
    "cancellationReason": "asd"
}

then response happens

"cancellationReason property is wrong,property cancellationReason should not exist ",

Reason

The user most probably is adding Authorization: Bearer token where token equal to booking owner credential and if booking owner cancels the booking cancellation reason is needed, but at the same time he / she is passing seatUid in the body, but we don't allow passing cancellation reason per seat because even if 4 seats are booked there is only 1 entry in booking table and 4 in booking seat table. The user is mixing 2 things.

Solution

  1. Update docs in bookings.controller.ts explaining how to cancel a seated booking as an attendee and how to cancel booking as a whole removing all seats as a host.
  2. Add a test in seated-bookings.e2e-spec.ts testing that when host cancels a seated booking that it is not possible to do without cancellation reason and that once provided all seats are removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiarea: API, enterprise API, access token, OAuthdocsarea: docs, documentation, cal.com/docsplatformAnything related to our platform planseatsarea: seats, guest meetings, multiple people

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions