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
- 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.
- 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.
Problem
If host is cancelling a seated booking by making POST request to
/v2/bookings/:bookingUid/canceland request body:and bearer header containing credential of the host
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
then response happens
"cancellationReason property is wrong,property cancellationReason should not exist ",Reason
The user most probably is adding
Authorization: Bearer tokenwhere 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 passingseatUidin 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