mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 14:08:11 +00:00
enhance contract and train scheduling features
- Added pricing service integration to ContractsService for pre-persistence contract pricing. - Updated LegCapacityPanel to display cargo weight instead of gross weight for better clarity on booked cargo. - Enhanced train scheduling service to include cargo weight in booking details. - Modified ClearanceDocumentsPage to include FULLY_EXECUTED status in booking status options. - Refactored FileUploadSettingsPage to categorize file upload settings into tabs for better organization. - Removed legacy onboarding fields and settings from file upload settings seeder. - Improved type definitions for train scheduling to include cargo weight without wagon tare.
This commit is contained in:
@@ -105,7 +105,10 @@ export function LegCapacityPanel({ schedule }: { schedule: TrainScheduleDetail }
|
||||
bookingId: b.id,
|
||||
reference: b.reference ?? b.id,
|
||||
wagons: Number(b.wagonsRequired) || 0,
|
||||
grossTons: round1(Number(b.weightTons) || 0),
|
||||
// The booking's OWN weight (cargo VGM/bulk tons) — no wagon tare, so
|
||||
// each row shows exactly what the customer booked and the leg total
|
||||
// is the plain sum of its rows.
|
||||
grossTons: round1(Number(b.cargoWeightTons ?? b.weightTons) || 0),
|
||||
route: b.origin && b.destination ? `${b.origin} → ${b.destination}` : null,
|
||||
}))
|
||||
.sort((a, b) => b.grossTons - a.grossTons);
|
||||
@@ -164,9 +167,10 @@ export function LegCapacityPanel({ schedule }: { schedule: TrainScheduleDetail }
|
||||
<Stack gap={2}>
|
||||
<Text fw={700}>Per-leg utilization</Text>
|
||||
<Text size="sm" c="dimmed">
|
||||
Each adjacent leg lists every booking riding it — a through
|
||||
booking counts on all its legs. Totals are checked against the
|
||||
train limits{weightCap != null ? ` (${weightCap}T incl. tolerance` : ""}
|
||||
Each adjacent leg lists every booking riding it with its own booked
|
||||
cargo weight — a through booking counts on all its legs, and the
|
||||
leg total is the plain sum of its rows. Checked against the train
|
||||
limits{weightCap != null ? ` (${weightCap}T pull` : ""}
|
||||
{weightCap != null && wagonCap != null ? `, ${wagonCap} wagons` : ""}
|
||||
{weightCap != null ? ")" : ""}.
|
||||
</Text>
|
||||
@@ -178,7 +182,7 @@ export function LegCapacityPanel({ schedule }: { schedule: TrainScheduleDetail }
|
||||
<Table.Th style={{ width: 28 }} />
|
||||
<Table.Th>Leg</Table.Th>
|
||||
<Table.Th>Wagons</Table.Th>
|
||||
<Table.Th>Gross weight</Table.Th>
|
||||
<Table.Th>Cargo weight</Table.Th>
|
||||
<Table.Th>Bookings</Table.Th>
|
||||
<Table.Th>Status</Table.Th>
|
||||
</Table.Tr>
|
||||
|
||||
Reference in New Issue
Block a user