Implement a Lodging Reservation Widget
Context
You are building a reservation widget for a property details page. The widget must let guests select dates and guest counts, show a price, validate inputs and availability, and submit a reservation. Assume there is an API that exposes availability by date, rate rules, capacity, and a quote endpoint.
Requirements
-
Inputs and Pricing
-
Inputs: Check-in date, Check-out date, Adults, Children.
-
Compute total price based on: nightly rate, number of nights, and dynamic pricing that depends on selected adults and children.
-
Show an itemized price breakdown.
-
Validation
-
Check-out must be after check-in.
-
Guest counts must not exceed capacity and must satisfy rate plan rules (e.g., max adults/children, min nights).
-
Booking Action
-
Disable the "Book Now" button if the room is sold out for any selected night or the selection is otherwise invalid.
-
Confirmation
-
On submit, display a confirmation dialog summarizing dates, guests, and the price breakdown before finalizing.
-
Design Artifacts to Provide
-
Describe component state, data models, and error states.
-
Outline how you would test edge cases (minimum nights, partial availability, timezone/daylight-saving transitions, and price rounding).