Summary
The frontend currently calls the legacy endpoint PATCH /bookings/{id}/process. Backend now uses a unified endpoint PUT /bookings/{id} (UpdateBookingRequestPayload), and the legacy endpoint will be removed. This issue tracks updating the frontend to use the unified endpoint and payload shape.
Background
Required changes
-
Replace API call:
- From:
httpClient.patch(`/bookings/${id}/process`, { status, rejectionReason })
- To:
httpClient.put(`/bookings/${id}`, { status, reason: rejectionReason })
- Or rename the parameter to
reason and forward it directly: { status, reason }
-
Update bookingApi.processBooking signature to accept and forward reason, proposedStartTime, and proposedEndTime as required by UpdateBookingRequestPayload.
-
Update processBooking usage in context.tsx and all callers to pass reason instead of rejectionReason, and proposed times when status is proposed.
-
Update client-side types to match UpdateBookingRequestPayload (status, reason, proposedStartTime, proposedEndTime).
-
Keep or strengthen UI validation:
- Reject requires a non-empty
reason.
- Propose requires
reason + valid proposedStartTime < proposedEndTime, both in the future.
Acceptance criteria
- No frontend code calls
/bookings/{id}/process.
- Frontend sends
PUT /bookings/{id} with the correct payload for confirm, reject, and propose flows.
- Confirm, reject with reason, and propose with times plus reason work without API errors.
Testing checklist
Summary
The frontend currently calls the legacy endpoint
PATCH /bookings/{id}/process. Backend now uses a unified endpointPUT /bookings/{id}(UpdateBookingRequestPayload), and the legacy endpoint will be removed. This issue tracks updating the frontend to use the unified endpoint and payload shape.Background
PATCH /bookings/{id}/process(to be removed)PUT /bookings/{id}— payload fields:status(required),reason,proposedStartTime,proposedEndTimeRequired changes
Replace API call:
reasonand forward it directly:{ status, reason }Update
bookingApi.processBookingsignature to accept and forwardreason,proposedStartTime, andproposedEndTimeas required byUpdateBookingRequestPayload.Update
processBookingusage incontext.tsxand all callers to passreasoninstead ofrejectionReason, and proposed times when status isproposed.Update client-side types to match
UpdateBookingRequestPayload(status,reason,proposedStartTime,proposedEndTime).Keep or strengthen UI validation:
reason.reason+ validproposedStartTime < proposedEndTime, both in the future.Acceptance criteria
/bookings/{id}/process.PUT /bookings/{id}with the correct payload for confirm, reject, and propose flows.Testing checklist
PUT /bookings/{id}with{ status: "confirmed" }.{ status: "rejected", reason: "<text>" }.{ status: "proposed", reason, proposedStartTime, proposedEndTime }./bookings/${id}/processand confirm zero results.