diff --git a/apps/edr-freight-web/backoffice/src/pages/operations/FirstMilePage.tsx b/apps/edr-freight-web/backoffice/src/pages/operations/FirstMilePage.tsx
index 33f7300f4..c7b7f5f8a 100644
--- a/apps/edr-freight-web/backoffice/src/pages/operations/FirstMilePage.tsx
+++ b/apps/edr-freight-web/backoffice/src/pages/operations/FirstMilePage.tsx
@@ -91,8 +91,9 @@ const cargoDesc = (r: FirstMileRecord) => {
};
const priceAmount = (r: FirstMileRecord) =>
r.booking?.totalAmount ?? r.advancedPayment;
+// First-mile destination is the origin yard (pickup → origin yard)
const destinationYardName = (r: FirstMileRecord) =>
- r.booking?.destinationYard?.name ?? "—";
+ r.booking?.originYard?.label ?? "—";
const contactPersonName = (r: FirstMileRecord) =>
r.booking?.company?.contactPersonName ?? "—";
const contactPhone = (r: FirstMileRecord) =>
@@ -102,7 +103,7 @@ const requestedDate = (r: FirstMileRecord) => {
return d ? new Date(d).toISOString().slice(0, 10) : "—";
};
const serviceTypeName = (r: FirstMileRecord) =>
- r.booking?.serviceType?.name ?? "—";
+ r.booking?.serviceType?.label ?? "—";
const InfoRow = ({ label, value }: { label: string; value: string }) => (
@@ -135,7 +136,7 @@ const BookingInfo = ({ record }: { record: FirstMileRecord }) => (
-
+
@@ -587,6 +588,12 @@ const FirstMilePage = () => {
meta: { headerClassName, cellClassName },
cell: ({ row }) => pickupLocation(row.original),
},
+ {
+ id: "destination",
+ header: "Destination",
+ meta: { headerClassName, cellClassName },
+ cell: ({ row }) => destinationYardName(row.original),
+ },
{
id: "cargo",
header: "Cargo",
@@ -903,7 +910,7 @@ const FirstMilePage = () => {
- {b.originYard?.name ?? "—"} → {b.destinationYard?.name ?? "—"}
+ {b.originYard?.label ?? "—"} → {b.destinationYard?.label ?? "—"}
{formatPrice(b.totalAmount)}
@@ -935,8 +942,8 @@ const FirstMilePage = () => {
-
-
+
+
diff --git a/apps/edr-freight-web/backoffice/src/services/first-mile.service.ts b/apps/edr-freight-web/backoffice/src/services/first-mile.service.ts
index f761719ae..b16287124 100644
--- a/apps/edr-freight-web/backoffice/src/services/first-mile.service.ts
+++ b/apps/edr-freight-web/backoffice/src/services/first-mile.service.ts
@@ -18,10 +18,10 @@ export interface FirstMileBooking {
totalAmount: number;
scheduledDate?: string | null;
company?: { id: string; name?: string; phone?: string | null; contactPersonName?: string | null; contactPersonPhone?: string | null } | null;
- serviceType?: { id: string; name?: string } | null;
- originYard?: { id: string; name?: string } | null;
- destinationYard?: { id: string; name?: string } | null;
- cargoType?: { id: string; name?: string } | null;
+ serviceType?: { id: string; label?: string } | null;
+ originYard?: { id: string; label?: string } | null;
+ destinationYard?: { id: string; label?: string } | null;
+ cargoType?: { id: string; label?: string } | null;
}
export interface FirstMileVehicle {