mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 16:35:42 +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:
@@ -38,6 +38,7 @@ export function BookingActionsMenu({
|
||||
reference: row.reference,
|
||||
schedulingStatus: row.schedulingStatus,
|
||||
customsClearingEnabled: row.customsClearingEnabled,
|
||||
consolidationPartnerId: row.consolidationPartnerId,
|
||||
};
|
||||
|
||||
const flow = useBookingActionDialog(row.id, context);
|
||||
@@ -92,7 +93,13 @@ export function BookingActionsMenu({
|
||||
);
|
||||
})}
|
||||
</Group>
|
||||
<ActionDialog flow={flow} pendingAction={pendingAction} onSuppressRowClick={onSuppressRowClick} />
|
||||
<ActionDialog
|
||||
flow={flow}
|
||||
pendingAction={pendingAction}
|
||||
onSuppressRowClick={onSuppressRowClick}
|
||||
consolidationPartnerId={row.consolidationPartnerId}
|
||||
consolidationPartnerReference={row.consolidationPartnerReference}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -149,7 +156,13 @@ export function BookingActionsMenu({
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
|
||||
<ActionDialog flow={flow} pendingAction={pendingAction} onSuppressRowClick={onSuppressRowClick} />
|
||||
<ActionDialog
|
||||
flow={flow}
|
||||
pendingAction={pendingAction}
|
||||
onSuppressRowClick={onSuppressRowClick}
|
||||
consolidationPartnerId={row.consolidationPartnerId}
|
||||
consolidationPartnerReference={row.consolidationPartnerReference}
|
||||
/>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
@@ -158,10 +171,14 @@ function ActionDialog({
|
||||
flow,
|
||||
pendingAction,
|
||||
onSuppressRowClick,
|
||||
consolidationPartnerId,
|
||||
consolidationPartnerReference,
|
||||
}: {
|
||||
flow: ReturnType<typeof useBookingActionDialog>;
|
||||
pendingAction: ReturnType<typeof useBookingActionDialog>["pendingAction"];
|
||||
onSuppressRowClick?: () => void;
|
||||
consolidationPartnerId?: string | null;
|
||||
consolidationPartnerReference?: string | null;
|
||||
}) {
|
||||
return (
|
||||
<BookingConfirmDialog
|
||||
@@ -182,6 +199,17 @@ function ActionDialog({
|
||||
}}
|
||||
isPending={flow.mutations.isPending || flow.detailLoading}
|
||||
confirmDisabled={flow.confirmDisabled}
|
||||
// Only the four pairable decisions land on both halves; the rest stay
|
||||
// per booking, so the warning must not appear for them.
|
||||
pairedWithReference={
|
||||
consolidationPartnerId &&
|
||||
pendingAction &&
|
||||
["accept", "cancel", "operationAccept", "requestChanges"].includes(
|
||||
pendingAction.id,
|
||||
)
|
||||
? (consolidationPartnerReference ?? "its wagon partner")
|
||||
: null
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user