:Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/user_management_UI

This commit is contained in:
natib21
2026-07-11 05:49:29 +00:00
64 changed files with 1484 additions and 553 deletions

View File

@@ -197,12 +197,14 @@ const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[] => [
icon: <Send />,
permission: FREIGHT_PERMS.contracts.createBooking,
},
// {
// label: "Self-Clearance Review",
// href: "/dashboard/contracts/ops-clearance",
// icon: <ShieldCheck />,
// permission: FREIGHT_PERMS.contracts.opsClearanceReview,
// },
// Operations Path A queue: per-booking self-clearance review for
// GENERAL non-customs booking instances (and legacy self-clear bookings).
{
label: "Self-Clearance Review",
href: "/dashboard/contracts/ops-clearance",
icon: <ShieldCheck />,
permission: FREIGHT_PERMS.contracts.opsClearanceReview,
},
{
label: "GL Djibouti Clearance",
href: "/dashboard/gl-djibouti/clearance",

View File

@@ -380,6 +380,31 @@ export function ClearanceReviewSection({
</Text>
</Group>
</Paper>
) : clearance.status !== "DOCUMENTS_UNDER_REVIEW" ? (
// Finalize is only valid from DOCUMENTS_UNDER_REVIEW (the API rejects
// any other status with a 409) — once the booking moved on, show the
// finalized state instead of a button that can only fail.
<Paper withBorder radius="md" p="md">
<Group gap={8} wrap="nowrap" style={{ minWidth: 0 }}>
<ThemeIcon
variant="light"
color={clearance.allApproved ? "edr-green" : "gray"}
radius="md"
size={28}
>
{clearance.allApproved ? (
<CheckCircle2 size={15} />
) : (
<FileCheck2 size={15} />
)}
</ThemeIcon>
<Text fz="12.5px" c="dimmed">
{clearance.allApproved
? "Clearance has been finalized. The customer can now pick a shipment day and proceed to operation."
: "Finalization unlocks once the customer submits their documents and every required document is approved."}
</Text>
</Group>
</Paper>
) : (
<Paper withBorder radius="md" p="md">
<Group justify="space-between" wrap="nowrap">