mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 00:45:41 +00:00
feat: Implement consolidated booking functionality
- Added support for viewing and managing consolidated bookings in BookingRequestDetailPage. - Enhanced BookingRequestsPage to display paired bookings in a single row. - Introduced pairedDecision method in bookings service to handle decisions for both halves of a consolidated pair. - Updated contracts service to include methods for manual consolidation of odd-20ft bookings. - Created new components for selecting and editing consolidation partners. - Added tests for paired decision logic and manual consolidation scenarios. - Updated UI to reflect changes in booking handling and provide user feedback for odd container counts.
This commit is contained in:
@@ -323,6 +323,26 @@ export const bookingsService = {
|
||||
cancel: (id: string, reason: string) =>
|
||||
postBooking<BookingDetail>(B.CANCEL(id), { reason }),
|
||||
|
||||
/**
|
||||
* Apply one staff decision to BOTH halves of a consolidated pair. The two
|
||||
* bookings share a wagon, so they advance or cancel together — all-or-nothing
|
||||
* on the server. Each half keeps its own invoice and payment.
|
||||
*/
|
||||
pairedDecision: async (
|
||||
id: string,
|
||||
decision: "accept" | "cancel" | "operationAccept" | "requestChanges",
|
||||
options: { reason?: string; note?: string; validityDays?: number } = {},
|
||||
): Promise<{ booking: BookingDetail; partner: BookingDetail }> => {
|
||||
const response = await client.post(B.PAIRED_DECISION(id), {
|
||||
decision,
|
||||
...options,
|
||||
});
|
||||
return unwrap(response.data) as {
|
||||
booking: BookingDetail;
|
||||
partner: BookingDetail;
|
||||
};
|
||||
},
|
||||
|
||||
create: async (payload: Record<string, unknown>): Promise<BookingDetail> => {
|
||||
const response = await client.post<{ booking: BookingDetail } | BookingDetail>(
|
||||
B.BASE,
|
||||
|
||||
Reference in New Issue
Block a user