K
Kizspy.me
-
Tasks:
"
409 Conflict: One or more seats are already booked or invalid.
■ 500 Internal Server Error: Server error with message.
• Validate seats as a non-empty array, where each seat has:
■ seatNumber: Non-empty string.
type: Either adult or child.
■ price: Positive number.
discount: Optional, non-negative number (default to 0 if not
provided).
o Verify the user exists in the users collection.
o Verify the showtime exists in the showtimes collection.
2025
o Check that all requested seatNumbers are available in the showtime's seats
array (status: available).
。 Calculate totalPrice as the sum of (price - discount) for each seat.
。 Create a new ticket in the tickets collection with userld, showtimeld,
formatted seats, and totalPrice.
。 Update the showtime's seats array to set the status of requested seats to
booked.
Zoom
+ 100%
Close