@burdenoff/microfe-movethewheels 2026.1107.6 → 2026.1107.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CarrierRecommendationDialog.js +21 -0
- package/dist/components/DispatchDecisionCard.js +111 -97
- package/dist/components/ShipmentDecisionPanel.js +362 -0
- package/dist/components/ShipmentRiskDialog.js +134 -89
- package/dist/generated/tracking-quality-operations.d.ts +288 -0
- package/dist/hooks/useShipmentDecision.js +111 -0
- package/dist/movethewheels/components/CarrierRecommendationDialog.d.ts +20 -0
- package/dist/movethewheels/components/DispatchDecisionCard.d.ts +5 -1
- package/dist/movethewheels/components/ShipmentDecisionPanel.d.ts +14 -0
- package/dist/movethewheels/hooks/useDispatchPlan.d.ts +1 -1
- package/dist/movethewheels/hooks/useShipmentDecision.d.ts +67 -0
- package/dist/pages/DispatchPlanPage.js +198 -171
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +321 -0
- package/src/movethewheels/components/CarrierRecommendationDialog.tsx +54 -0
- package/src/movethewheels/components/DispatchDecisionCard.tsx +17 -2
- package/src/movethewheels/components/ShipmentDecisionPanel.tsx +459 -0
- package/src/movethewheels/components/ShipmentRiskDialog.tsx +67 -1
- package/src/movethewheels/hooks/useShipmentDecision.ts +318 -0
- package/src/movethewheels/pages/DispatchPlanPage.tsx +30 -1
|
@@ -507,6 +507,29 @@ export type MtwAssignmentSuggestions = {
|
|
|
507
507
|
vehicles: Array<MtwVehicleSuggestion>;
|
|
508
508
|
};
|
|
509
509
|
|
|
510
|
+
export type MtwCapacityBasis = {
|
|
511
|
+
__typename?: 'MtwCapacityBasis';
|
|
512
|
+
/** Vehicles with status ACTIVE or IN_TRANSIT. */
|
|
513
|
+
activeVehicles: Scalars['Int']['output'];
|
|
514
|
+
/** Null when the capacity is unknown. */
|
|
515
|
+
jobsPerVehiclePerWeek?: Maybe<Scalars['Float']['output']>;
|
|
516
|
+
laneShareBasis: MtwLaneShareBasis;
|
|
517
|
+
/** Vehicles whose job history the observed throughput rests on. */
|
|
518
|
+
observedVehicles: Scalars['Int']['output'];
|
|
519
|
+
source: MtwCapacitySource;
|
|
520
|
+
/** activeVehicles x jobsPerVehiclePerWeek, before any scenario capacity change. Null when unknown. */
|
|
521
|
+
weeklyFleetCapacity?: Maybe<Scalars['Float']['output']>;
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
/** Where the jobs-per-vehicle-per-week figure behind the fleet capacity comes from. */
|
|
525
|
+
export type MtwCapacitySource =
|
|
526
|
+
/** Observed: the median across vehicles of each vehicle's busiest closed week in the last 12 weeks. */
|
|
527
|
+
| 'OBSERVED'
|
|
528
|
+
/** Supplied by the caller in jobsPerVehiclePerWeek. */
|
|
529
|
+
| 'OVERRIDE'
|
|
530
|
+
/** No vehicle-assigned jobs in the history and no override: capacity is unknown. */
|
|
531
|
+
| 'UNKNOWN';
|
|
532
|
+
|
|
510
533
|
/**
|
|
511
534
|
* MoveTheWheels-owned cargo/item master used for warehouse inventory and shipment payloads.
|
|
512
535
|
* This is not a sellable storefront product; commerce SKUs must live in global-store-svc
|
|
@@ -1430,6 +1453,46 @@ export type MtwDemandForecastVariance = {
|
|
|
1430
1453
|
volumeVariance: Scalars['Int']['output'];
|
|
1431
1454
|
};
|
|
1432
1455
|
|
|
1456
|
+
export type MtwDemandScenarioComparison = {
|
|
1457
|
+
__typename?: 'MtwDemandScenarioComparison';
|
|
1458
|
+
/** The forecast with no changes, compared against current capacity. */
|
|
1459
|
+
baseline: MtwScenarioResult;
|
|
1460
|
+
capacity: MtwCapacityBasis;
|
|
1461
|
+
generatedAt: Scalars['DateTime']['output'];
|
|
1462
|
+
/** One result per input scenario, in input order. */
|
|
1463
|
+
scenarios: Array<MtwScenarioResult>;
|
|
1464
|
+
weeks: Scalars['Int']['output'];
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
export type MtwDemandScenarioComparisonInput = {
|
|
1468
|
+
/** Jobs one available vehicle handles per week. When omitted the throughput observed over the last 12 closed weeks is used. */
|
|
1469
|
+
jobsPerVehiclePerWeek?: InputMaybe<Scalars['Float']['input']>;
|
|
1470
|
+
/** Up to 4 scenarios to compare side by side with the baseline. An empty list gives the baseline capacity-vs-demand view. */
|
|
1471
|
+
scenarios?: InputMaybe<Array<MtwDemandScenarioInput>>;
|
|
1472
|
+
/** Forecast weeks to compare, starting this ISO week. Clamped to 1..12, like the forecast queries. */
|
|
1473
|
+
weeks?: InputMaybe<Scalars['Int']['input']>;
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
export type MtwDemandScenarioInput = {
|
|
1477
|
+
/** Fleet capacity change in percent, from -100 to 500 (for example +20 for two extra trucks on a fleet of ten). */
|
|
1478
|
+
capacityChangePct?: InputMaybe<Scalars['Float']['input']>;
|
|
1479
|
+
/** Lane keys to close (at most 200). A closed lane carries no demand; what it would have carried is reported as lost. */
|
|
1480
|
+
closedLanes?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
1481
|
+
/** Demand change on every lane in percent, from -100 to 500. */
|
|
1482
|
+
demandChangePct?: InputMaybe<Scalars['Float']['input']>;
|
|
1483
|
+
/** Per-lane demand changes (at most 200). */
|
|
1484
|
+
laneAdjustments?: InputMaybe<Array<MtwDemandScenarioLaneAdjustmentInput>>;
|
|
1485
|
+
/** Unique within the comparison, 1 to 80 characters; "Baseline" is reserved for the unchanged forecast. */
|
|
1486
|
+
name: Scalars['String']['input'];
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
export type MtwDemandScenarioLaneAdjustmentInput = {
|
|
1490
|
+
/** Demand change on this lane in percent, from -100 to 500, applied on top of the scenario-wide change. */
|
|
1491
|
+
demandChangePct: Scalars['Float']['input'];
|
|
1492
|
+
/** Lane key as returned in MtwDemandForecastPoint.scopeKey (Origin->Destination). */
|
|
1493
|
+
laneKey: Scalars['String']['input'];
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1433
1496
|
/** One proposed shipment -> vehicle + driver pairing. */
|
|
1434
1497
|
export type MtwDispatchAssignment = {
|
|
1435
1498
|
__typename?: 'MtwDispatchAssignment';
|
|
@@ -3105,6 +3168,15 @@ export type MtwInventoryTransferResult = {
|
|
|
3105
3168
|
source: MtwInventoryItem;
|
|
3106
3169
|
};
|
|
3107
3170
|
|
|
3171
|
+
/** How the fleet capacity is divided between lanes. */
|
|
3172
|
+
export type MtwLaneShareBasis =
|
|
3173
|
+
/** No vehicle-assigned history: capacity follows each lane's share of the baseline forecast. */
|
|
3174
|
+
| 'DEMAND_SHARE'
|
|
3175
|
+
/** Capacity is unknown, or there is no demand to divide it by. */
|
|
3176
|
+
| 'NONE'
|
|
3177
|
+
/** Each lane's share of the vehicle-assigned jobs in the last 12 closed weeks. */
|
|
3178
|
+
| 'VEHICLE_HISTORY';
|
|
3179
|
+
|
|
3108
3180
|
export type MtwMarketplaceStats = {
|
|
3109
3181
|
__typename?: 'MtwMarketplaceStats';
|
|
3110
3182
|
activeProviders: Scalars['Int']['output'];
|
|
@@ -4331,6 +4403,71 @@ export type MtwRunScheduledReportsInput = {
|
|
|
4331
4403
|
triggerData?: InputMaybe<Scalars['JSON']['input']>;
|
|
4332
4404
|
};
|
|
4333
4405
|
|
|
4406
|
+
export type MtwScenarioLaneResult = {
|
|
4407
|
+
__typename?: 'MtwScenarioLaneResult';
|
|
4408
|
+
baselineRevenue: Scalars['Float']['output'];
|
|
4409
|
+
/** Totals over the compared weeks. */
|
|
4410
|
+
baselineVolume: Scalars['Int']['output'];
|
|
4411
|
+
/** Own-fleet capacity for this lane over the compared weeks. Null when unknown or when no fleet share is observed on the lane. */
|
|
4412
|
+
capacity?: Maybe<Scalars['Float']['output']>;
|
|
4413
|
+
closed: Scalars['Boolean']['output'];
|
|
4414
|
+
/** The lane-specific demand change applied in this scenario. */
|
|
4415
|
+
demandChangePct: Scalars['Float']['output'];
|
|
4416
|
+
/** Demand exceeds the lane's capacity in at least one week. */
|
|
4417
|
+
flagged: Scalars['Boolean']['output'];
|
|
4418
|
+
laneKey: Scalars['String']['output'];
|
|
4419
|
+
laneLabel: Scalars['String']['output'];
|
|
4420
|
+
lostRevenue: Scalars['Float']['output'];
|
|
4421
|
+
lostVolume: Scalars['Int']['output'];
|
|
4422
|
+
scenarioRevenue: Scalars['Float']['output'];
|
|
4423
|
+
scenarioVolume: Scalars['Int']['output'];
|
|
4424
|
+
/** Scenario volume above the lane's capacity, summed week by week. */
|
|
4425
|
+
shortfall: Scalars['Float']['output'];
|
|
4426
|
+
};
|
|
4427
|
+
|
|
4428
|
+
export type MtwScenarioResult = {
|
|
4429
|
+
__typename?: 'MtwScenarioResult';
|
|
4430
|
+
capacityChangePct: Scalars['Float']['output'];
|
|
4431
|
+
/** Closed lanes the forecast knows. */
|
|
4432
|
+
closedLanes: Array<Scalars['String']['output']>;
|
|
4433
|
+
demandChangePct: Scalars['Float']['output'];
|
|
4434
|
+
/** Lanes ordered by shortfall, then scenario volume. */
|
|
4435
|
+
lanes: Array<MtwScenarioLaneResult>;
|
|
4436
|
+
lostRevenue: Scalars['Float']['output'];
|
|
4437
|
+
lostVolume: Scalars['Int']['output'];
|
|
4438
|
+
name: Scalars['String']['output'];
|
|
4439
|
+
revenueDelta: Scalars['Float']['output'];
|
|
4440
|
+
/** Lanes flagged for a shortfall. */
|
|
4441
|
+
shortfallLanes: Scalars['Int']['output'];
|
|
4442
|
+
/** Fleet capacity over the compared weeks. Null when unknown. */
|
|
4443
|
+
totalCapacity?: Maybe<Scalars['Float']['output']>;
|
|
4444
|
+
totalRevenue: Scalars['Float']['output'];
|
|
4445
|
+
/** Weekly fleet shortfalls summed over the compared weeks. */
|
|
4446
|
+
totalShortfall: Scalars['Float']['output'];
|
|
4447
|
+
totalVolume: Scalars['Int']['output'];
|
|
4448
|
+
/** Lane keys named in the scenario that have no forecast; they change nothing. */
|
|
4449
|
+
unknownLanes: Array<Scalars['String']['output']>;
|
|
4450
|
+
/** totalVolume / totalCapacity. Null without a positive capacity. */
|
|
4451
|
+
utilization?: Maybe<Scalars['Float']['output']>;
|
|
4452
|
+
/** totalVolume minus the baseline's. */
|
|
4453
|
+
volumeDelta: Scalars['Int']['output'];
|
|
4454
|
+
weeks: Array<MtwScenarioWeekResult>;
|
|
4455
|
+
};
|
|
4456
|
+
|
|
4457
|
+
export type MtwScenarioWeekResult = {
|
|
4458
|
+
__typename?: 'MtwScenarioWeekResult';
|
|
4459
|
+
baselineRevenue: Scalars['Float']['output'];
|
|
4460
|
+
baselineVolume: Scalars['Int']['output'];
|
|
4461
|
+
/** Fleet capacity for the week after the scenario's capacity change. Null when unknown. */
|
|
4462
|
+
capacity?: Maybe<Scalars['Float']['output']>;
|
|
4463
|
+
periodEnd: Scalars['DateTime']['output'];
|
|
4464
|
+
periodStart: Scalars['DateTime']['output'];
|
|
4465
|
+
scenarioRevenue: Scalars['Float']['output'];
|
|
4466
|
+
scenarioVolume: Scalars['Int']['output'];
|
|
4467
|
+
/** Scenario volume above capacity; 0 when capacity is unknown. */
|
|
4468
|
+
shortfall: Scalars['Float']['output'];
|
|
4469
|
+
};
|
|
4470
|
+
|
|
4334
4471
|
/** Outcome of one scheduled-reports fire. */
|
|
4335
4472
|
export type MtwScheduledReportsRun = {
|
|
4336
4473
|
__typename?: 'MtwScheduledReportsRun';
|
|
@@ -4521,6 +4658,127 @@ export type MtwShipmentTrackingEventsArgs = {
|
|
|
4521
4658
|
pagination?: InputMaybe<PaginationInput>;
|
|
4522
4659
|
};
|
|
4523
4660
|
|
|
4661
|
+
export type MtwShipmentDecision = {
|
|
4662
|
+
__typename?: 'MtwShipmentDecision';
|
|
4663
|
+
/** Provider-qualified model that wrote the rationale, when one did. */
|
|
4664
|
+
aiModel?: Maybe<Scalars['String']['output']>;
|
|
4665
|
+
aiStatus: MtwDecisionRationaleStatus;
|
|
4666
|
+
aiSummary?: Maybe<Scalars['String']['output']>;
|
|
4667
|
+
breached?: Maybe<Scalars['Boolean']['output']>;
|
|
4668
|
+
chosenOptionId?: Maybe<Scalars['ID']['output']>;
|
|
4669
|
+
createdAt: Scalars['DateTime']['output'];
|
|
4670
|
+
createdBy: Scalars['String']['output'];
|
|
4671
|
+
/** The shipment's carrier when the proposal was made. */
|
|
4672
|
+
currentCarrierId?: Maybe<Scalars['String']['output']>;
|
|
4673
|
+
decidedAt?: Maybe<Scalars['DateTime']['output']>;
|
|
4674
|
+
decidedBy?: Maybe<Scalars['String']['output']>;
|
|
4675
|
+
decisionReason?: Maybe<Scalars['String']['output']>;
|
|
4676
|
+
expiresAt: Scalars['DateTime']['output'];
|
|
4677
|
+
/** Carrier recommendation: delivered shipments the ranking looked at. */
|
|
4678
|
+
historyCount?: Maybe<Scalars['Int']['output']>;
|
|
4679
|
+
id: Scalars['ID']['output'];
|
|
4680
|
+
kind: MtwShipmentDecisionKind;
|
|
4681
|
+
/** Carrier recommendation: whether the shipment had an origin and destination to match a lane on. */
|
|
4682
|
+
laneKnown?: Maybe<Scalars['Boolean']['output']>;
|
|
4683
|
+
/** The deterministic ranker that produced the options. */
|
|
4684
|
+
method: Scalars['String']['output'];
|
|
4685
|
+
/** Ranked options, best first. Empty when there is nothing to recommend (no carrier history yet). */
|
|
4686
|
+
options: Array<MtwShipmentDecisionOption>;
|
|
4687
|
+
outcome?: Maybe<MtwShipmentDecisionOutcome>;
|
|
4688
|
+
predictedSlipMinutes?: Maybe<Scalars['Int']['output']>;
|
|
4689
|
+
/** The shipment's promised delivery when the proposal was made. */
|
|
4690
|
+
promisedDelivery?: Maybe<Scalars['DateTime']['output']>;
|
|
4691
|
+
riskLevel?: Maybe<Scalars['String']['output']>;
|
|
4692
|
+
/** Exception remediation: the forecast the options were ranked from. */
|
|
4693
|
+
riskScore?: Maybe<Scalars['Int']['output']>;
|
|
4694
|
+
shipmentId: Scalars['ID']['output'];
|
|
4695
|
+
shipmentNumber?: Maybe<Scalars['String']['output']>;
|
|
4696
|
+
signals: Array<Scalars['String']['output']>;
|
|
4697
|
+
status: MtwShipmentDecisionStatus;
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4700
|
+
export type MtwShipmentDecisionAction =
|
|
4701
|
+
/** Keep the shipment as it is and accept the delay. */
|
|
4702
|
+
| 'ACCEPT_SLIP'
|
|
4703
|
+
/** Move the shipment's order to another vehicle (follow-up on the order). */
|
|
4704
|
+
| 'REASSIGN_VEHICLE'
|
|
4705
|
+
/** Move the promised delivery to the predicted time. */
|
|
4706
|
+
| 'REPROMISE_DELIVERY'
|
|
4707
|
+
/** Get a fresh tracking update from the driver or carrier (follow-up). */
|
|
4708
|
+
| 'REQUEST_TRACKING_UPDATE'
|
|
4709
|
+
/** Hand the not-yet-collected shipment to a carrier with a better record on its lane. */
|
|
4710
|
+
| 'SWITCH_CARRIER'
|
|
4711
|
+
/** Use this carrier for the shipment. */
|
|
4712
|
+
| 'USE_CARRIER';
|
|
4713
|
+
|
|
4714
|
+
export type MtwShipmentDecisionExecution =
|
|
4715
|
+
/** Accepting changes the shipment. */
|
|
4716
|
+
| 'APPLY'
|
|
4717
|
+
/** Accepting records the decision; followUpMutation names the manual step that carries it out. */
|
|
4718
|
+
| 'FOLLOW_UP'
|
|
4719
|
+
/** Accepting only records the decision. */
|
|
4720
|
+
| 'RECORD';
|
|
4721
|
+
|
|
4722
|
+
export type MtwShipmentDecisionKind =
|
|
4723
|
+
| 'CARRIER_RECOMMENDATION'
|
|
4724
|
+
| 'EXCEPTION_REMEDIATION';
|
|
4725
|
+
|
|
4726
|
+
/** One ranked option of a shipment decision. */
|
|
4727
|
+
export type MtwShipmentDecisionOption = {
|
|
4728
|
+
__typename?: 'MtwShipmentDecisionOption';
|
|
4729
|
+
action: MtwShipmentDecisionAction;
|
|
4730
|
+
/** Model-written rationale, when AI produced one. */
|
|
4731
|
+
aiRationale?: Maybe<Scalars['String']['output']>;
|
|
4732
|
+
/** The carrier accepting assigns (USE_CARRIER, SWITCH_CARRIER). */
|
|
4733
|
+
carrierId?: Maybe<Scalars['String']['output']>;
|
|
4734
|
+
/** Ranker confidence from 0 to 1, from how much evidence the option stands on. Not a probability of success. */
|
|
4735
|
+
confidence: Scalars['Float']['output'];
|
|
4736
|
+
currency?: Maybe<Scalars['String']['output']>;
|
|
4737
|
+
/** Delivered shipments of this carrier in the history window (carrier options). */
|
|
4738
|
+
deliveredCount?: Maybe<Scalars['Int']['output']>;
|
|
4739
|
+
execution: MtwShipmentDecisionExecution;
|
|
4740
|
+
/** Arguments for followUpMutation, e.g. the delivery job or shipment id. */
|
|
4741
|
+
followUpArgs?: Maybe<Scalars['JSON']['output']>;
|
|
4742
|
+
/** The existing mutation that carries out a FOLLOW_UP option. */
|
|
4743
|
+
followUpMutation?: Maybe<Scalars['String']['output']>;
|
|
4744
|
+
id: Scalars['ID']['output'];
|
|
4745
|
+
/** Delivered shipments of this carrier on this shipment's lane. */
|
|
4746
|
+
laneDeliveredCount?: Maybe<Scalars['Int']['output']>;
|
|
4747
|
+
laneOnTimeCount?: Maybe<Scalars['Int']['output']>;
|
|
4748
|
+
/** Median recorded freight cost of this carrier on the lane, in currency. */
|
|
4749
|
+
medianLaneCost?: Maybe<Scalars['Float']['output']>;
|
|
4750
|
+
/** The promised delivery accepting sets (REPROMISE_DELIVERY). */
|
|
4751
|
+
newEstimatedDelivery?: Maybe<Scalars['DateTime']['output']>;
|
|
4752
|
+
onTimeCount?: Maybe<Scalars['Int']['output']>;
|
|
4753
|
+
rank: Scalars['Int']['output'];
|
|
4754
|
+
/** The ranker's own factual rationale. */
|
|
4755
|
+
rationale: Scalars['String']['output'];
|
|
4756
|
+
/** Reason codes, e.g. LANE_HISTORY, ON_TIME_STRONG, LOWEST_LANE_COST, PREDICTED_SLIP, TRACKING_STALE. */
|
|
4757
|
+
reasons: Array<Scalars['String']['output']>;
|
|
4758
|
+
/** Carrier ranking score from 0 to 1 (carrier options only). */
|
|
4759
|
+
score?: Maybe<Scalars['Float']['output']>;
|
|
4760
|
+
};
|
|
4761
|
+
|
|
4762
|
+
export type MtwShipmentDecisionOutcome =
|
|
4763
|
+
/** The shipment was changed. */
|
|
4764
|
+
| 'APPLIED'
|
|
4765
|
+
/** The decision was recorded; the follow-up step is still to be done. */
|
|
4766
|
+
| 'FOLLOW_UP'
|
|
4767
|
+
/** The decision was recorded; nothing on the shipment changed. */
|
|
4768
|
+
| 'RECORDED';
|
|
4769
|
+
|
|
4770
|
+
export type MtwShipmentDecisionStatus =
|
|
4771
|
+
/** An option was accepted; outcome says what that did. */
|
|
4772
|
+
| 'ACCEPTED'
|
|
4773
|
+
/** Superseded by a newer proposal or past its expiry without a decision. */
|
|
4774
|
+
| 'EXPIRED'
|
|
4775
|
+
/** Waiting for a decision. */
|
|
4776
|
+
| 'PROPOSED'
|
|
4777
|
+
/** Rejected; nothing on the shipment changed. */
|
|
4778
|
+
| 'REJECTED'
|
|
4779
|
+
/** An option was accepted but the shipment had changed since the proposal; decisionReason says how. Nothing was changed. */
|
|
4780
|
+
| 'STALE';
|
|
4781
|
+
|
|
4524
4782
|
export type MtwShipmentLeg = {
|
|
4525
4783
|
__typename?: 'MtwShipmentLeg';
|
|
4526
4784
|
actualArrival?: Maybe<Scalars['DateTime']['output']>;
|
|
@@ -5409,6 +5667,13 @@ export type Mutation = {
|
|
|
5409
5667
|
importMtwDrivers: MtwImportResult;
|
|
5410
5668
|
importMtwVehicles: MtwImportResult;
|
|
5411
5669
|
importMtwWarehouses: MtwImportResult;
|
|
5670
|
+
/**
|
|
5671
|
+
* Accept one option of an open decision. An APPLY option changes the shipment
|
|
5672
|
+
* (carrier or promised delivery); FOLLOW_UP and RECORD options only record the
|
|
5673
|
+
* decision. When the shipment changed since the proposal the decision is marked
|
|
5674
|
+
* STALE and nothing is changed.
|
|
5675
|
+
*/
|
|
5676
|
+
mtwAcceptShipmentDecision: MtwShipmentDecision;
|
|
5412
5677
|
/**
|
|
5413
5678
|
* Accept the listed assignments of an open plan and reject the rest. One PLANNED
|
|
5414
5679
|
* route is created per accepted assignment, through the normal route checks.
|
|
@@ -5435,8 +5700,22 @@ export type Mutation = {
|
|
|
5435
5700
|
* expires any older open one.
|
|
5436
5701
|
*/
|
|
5437
5702
|
mtwPlanDispatch: MtwDispatchPlan;
|
|
5703
|
+
/**
|
|
5704
|
+
* Rank the workspace's carriers for a PLANNED shipment's lane from its own
|
|
5705
|
+
* delivery history. Proposal only: the shipment's carrier is unchanged until an
|
|
5706
|
+
* option is accepted. A newer proposal expires the shipment's open one.
|
|
5707
|
+
*/
|
|
5708
|
+
mtwRecommendCarrier: MtwShipmentDecision;
|
|
5438
5709
|
/** Reject every assignment of an open plan. Writes no route or delivery job. */
|
|
5439
5710
|
mtwRejectDispatchPlan: MtwDispatchPlan;
|
|
5711
|
+
/** Reject every option of an open decision. Nothing on the shipment changes. */
|
|
5712
|
+
mtwRejectShipmentDecision: MtwShipmentDecision;
|
|
5713
|
+
/**
|
|
5714
|
+
* Rank remediations for a shipment its risk forecast says is late or at risk.
|
|
5715
|
+
* Proposal only: nothing on the shipment changes until an option is accepted.
|
|
5716
|
+
* Refused when the shipment is neither at risk nor past its promise.
|
|
5717
|
+
*/
|
|
5718
|
+
mtwResolveException: MtwShipmentDecision;
|
|
5440
5719
|
/**
|
|
5441
5720
|
* Re-forecast every in-flight shipment of the workspace and notify for any that
|
|
5442
5721
|
* started slipping. Fired by wspace-scheduler-svc as this service's own service
|
|
@@ -5776,6 +6055,12 @@ export type MutationImportMtwWarehousesArgs = {
|
|
|
5776
6055
|
};
|
|
5777
6056
|
|
|
5778
6057
|
|
|
6058
|
+
export type MutationMtwAcceptShipmentDecisionArgs = {
|
|
6059
|
+
decisionId: Scalars['ID']['input'];
|
|
6060
|
+
optionId: Scalars['ID']['input'];
|
|
6061
|
+
};
|
|
6062
|
+
|
|
6063
|
+
|
|
5779
6064
|
export type MutationMtwApplyDispatchPlanArgs = {
|
|
5780
6065
|
accept: Array<Scalars['ID']['input']>;
|
|
5781
6066
|
planId: Scalars['ID']['input'];
|
|
@@ -5792,11 +6077,26 @@ export type MutationMtwPlanDispatchArgs = {
|
|
|
5792
6077
|
};
|
|
5793
6078
|
|
|
5794
6079
|
|
|
6080
|
+
export type MutationMtwRecommendCarrierArgs = {
|
|
6081
|
+
shipmentId: Scalars['ID']['input'];
|
|
6082
|
+
};
|
|
6083
|
+
|
|
6084
|
+
|
|
5795
6085
|
export type MutationMtwRejectDispatchPlanArgs = {
|
|
5796
6086
|
planId: Scalars['ID']['input'];
|
|
5797
6087
|
};
|
|
5798
6088
|
|
|
5799
6089
|
|
|
6090
|
+
export type MutationMtwRejectShipmentDecisionArgs = {
|
|
6091
|
+
decisionId: Scalars['ID']['input'];
|
|
6092
|
+
};
|
|
6093
|
+
|
|
6094
|
+
|
|
6095
|
+
export type MutationMtwResolveExceptionArgs = {
|
|
6096
|
+
shipmentId: Scalars['ID']['input'];
|
|
6097
|
+
};
|
|
6098
|
+
|
|
6099
|
+
|
|
5800
6100
|
export type MutationMtwRunRiskSweepArgs = {
|
|
5801
6101
|
input?: InputMaybe<MtwRunRiskSweepInput>;
|
|
5802
6102
|
};
|
|
@@ -6237,6 +6537,8 @@ export type Query = {
|
|
|
6237
6537
|
/** Null until the workspace's forecast has been calculated once. */
|
|
6238
6538
|
demandForecastRunStatus?: Maybe<MtwDemandForecastRunStatus>;
|
|
6239
6539
|
demandForecastVariance: Array<MtwDemandForecastVariance>;
|
|
6540
|
+
/** Compare what-if scenarios on the lane forecast side by side, each against fleet capacity. */
|
|
6541
|
+
demandScenarioComparison: MtwDemandScenarioComparison;
|
|
6240
6542
|
driver?: Maybe<MtwDriver>;
|
|
6241
6543
|
drivers: Array<MtwDriver>;
|
|
6242
6544
|
driversCount: Scalars['Int']['output'];
|
|
@@ -6318,6 +6620,8 @@ export type Query = {
|
|
|
6318
6620
|
mtwImportSpec: Array<MtwImportEntitySpec>;
|
|
6319
6621
|
/** The workspace's most recent dispatch plan, whatever its status. */
|
|
6320
6622
|
mtwLatestDispatchPlan?: Maybe<MtwDispatchPlan>;
|
|
6623
|
+
/** The shipment's most recent decision of this kind, whatever its status. */
|
|
6624
|
+
mtwLatestShipmentDecision?: Maybe<MtwShipmentDecision>;
|
|
6321
6625
|
/** The workspace's MoveTheWheels operational defaults; platform defaults when none were saved. */
|
|
6322
6626
|
mtwModuleSettings: MtwModuleSettings;
|
|
6323
6627
|
mtwPalletGeometryPreview: MtwPalletGeometryPreview;
|
|
@@ -6349,6 +6653,7 @@ export type Query = {
|
|
|
6349
6653
|
mtwRiskSweepSchedule?: Maybe<MtwRiskSweepSchedule>;
|
|
6350
6654
|
/** Recent risk sweeps of the workspace, newest first. */
|
|
6351
6655
|
mtwRiskSweeps: Array<MtwRiskSweep>;
|
|
6656
|
+
mtwShipmentDecision?: Maybe<MtwShipmentDecision>;
|
|
6352
6657
|
/** The shipment's current or last risk episode, or null if it has never been at risk. */
|
|
6353
6658
|
mtwShipmentRiskEpisode?: Maybe<MtwShipmentRiskEpisode>;
|
|
6354
6659
|
mtwShipmentRiskForecast: MtwRiskForecast;
|
|
@@ -6491,6 +6796,11 @@ export type QueryDemandForecastVarianceArgs = {
|
|
|
6491
6796
|
};
|
|
6492
6797
|
|
|
6493
6798
|
|
|
6799
|
+
export type QueryDemandScenarioComparisonArgs = {
|
|
6800
|
+
input?: InputMaybe<MtwDemandScenarioComparisonInput>;
|
|
6801
|
+
};
|
|
6802
|
+
|
|
6803
|
+
|
|
6494
6804
|
export type QueryDriverArgs = {
|
|
6495
6805
|
id: Scalars['ID']['input'];
|
|
6496
6806
|
};
|
|
@@ -6798,6 +7108,12 @@ export type QueryMtwFreightInvoiceReviewPageArgs = {
|
|
|
6798
7108
|
};
|
|
6799
7109
|
|
|
6800
7110
|
|
|
7111
|
+
export type QueryMtwLatestShipmentDecisionArgs = {
|
|
7112
|
+
kind: MtwShipmentDecisionKind;
|
|
7113
|
+
shipmentId: Scalars['ID']['input'];
|
|
7114
|
+
};
|
|
7115
|
+
|
|
7116
|
+
|
|
6801
7117
|
export type QueryMtwPalletGeometryPreviewArgs = {
|
|
6802
7118
|
input: MtwPalletGeometryPreviewInput;
|
|
6803
7119
|
};
|
|
@@ -6930,6 +7246,11 @@ export type QueryMtwRiskSweepsArgs = {
|
|
|
6930
7246
|
};
|
|
6931
7247
|
|
|
6932
7248
|
|
|
7249
|
+
export type QueryMtwShipmentDecisionArgs = {
|
|
7250
|
+
id: Scalars['ID']['input'];
|
|
7251
|
+
};
|
|
7252
|
+
|
|
7253
|
+
|
|
6933
7254
|
export type QueryMtwShipmentRiskEpisodeArgs = {
|
|
6934
7255
|
shipmentId: Scalars['ID']['input'];
|
|
6935
7256
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CarrierRecommendationDialog (BOFF-10908)
|
|
3
|
+
*
|
|
4
|
+
* Carrier recommendation cards for one PLANNED shipment, opened from the
|
|
5
|
+
* dispatch planner when the shipment should go with a carrier rather than the
|
|
6
|
+
* own fleet (no free vehicle, or the dispatcher prefers a carrier). Accepting
|
|
7
|
+
* a card assigns that carrier to the shipment; rejecting changes nothing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './ui';
|
|
11
|
+
import { ShipmentDecisionPanel } from './ShipmentDecisionPanel';
|
|
12
|
+
|
|
13
|
+
type Translate = (key: string, fallback: string) => string;
|
|
14
|
+
|
|
15
|
+
interface CarrierRecommendationDialogProps {
|
|
16
|
+
shipment: { id: string; number: string | null } | null;
|
|
17
|
+
onOpenChange: (open: boolean) => void;
|
|
18
|
+
onApplied?: () => void;
|
|
19
|
+
t: Translate;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function CarrierRecommendationDialog({
|
|
23
|
+
shipment,
|
|
24
|
+
onOpenChange,
|
|
25
|
+
onApplied,
|
|
26
|
+
t,
|
|
27
|
+
}: CarrierRecommendationDialogProps) {
|
|
28
|
+
return (
|
|
29
|
+
<Dialog open={shipment !== null} onOpenChange={onOpenChange}>
|
|
30
|
+
<DialogContent className="max-h-[90vh] max-w-xl overflow-y-auto">
|
|
31
|
+
<DialogHeader>
|
|
32
|
+
<DialogTitle>
|
|
33
|
+
{t('movethewheels.carrierDecision.title', 'Carrier recommendation')}
|
|
34
|
+
{shipment ? ` · ${shipment.number ?? shipment.id}` : ''}
|
|
35
|
+
</DialogTitle>
|
|
36
|
+
<DialogDescription>
|
|
37
|
+
{t(
|
|
38
|
+
'movethewheels.carrierDecision.description',
|
|
39
|
+
'Carriers ranked for this shipment’s lane from your own delivery history: on-time record on the lane and overall, and recorded lane cost. Nothing changes until you accept one.'
|
|
40
|
+
)}
|
|
41
|
+
</DialogDescription>
|
|
42
|
+
</DialogHeader>
|
|
43
|
+
{shipment && (
|
|
44
|
+
<ShipmentDecisionPanel
|
|
45
|
+
shipmentId={shipment.id}
|
|
46
|
+
kind="CARRIER_RECOMMENDATION"
|
|
47
|
+
onApplied={onApplied}
|
|
48
|
+
t={t}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
</DialogContent>
|
|
52
|
+
</Dialog>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* until the person applies their decisions.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { Check, Route as RouteIcon, Sparkles, Truck, User, X } from 'lucide-react';
|
|
15
|
+
import { Building2, Check, Route as RouteIcon, Sparkles, Truck, User, X } from 'lucide-react';
|
|
16
16
|
|
|
17
17
|
import { Badge, Button, Card, CardContent } from './ui';
|
|
18
18
|
import type { DispatchAssignment } from '../hooks/useDispatchPlan';
|
|
@@ -52,7 +52,8 @@ export function reasonLabel(reason: string, t: Translate): string {
|
|
|
52
52
|
return entry ? t(entry[0], entry[1]) : reason;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
/** Text colour for a 0..1 confidence; shared by every decision card. */
|
|
56
|
+
export function confidenceTone(confidence: number): string {
|
|
56
57
|
if (confidence >= 0.75) return 'text-status-success-text';
|
|
57
58
|
if (confidence >= 0.5) return 'text-status-warning-text';
|
|
58
59
|
return 'text-status-error-text';
|
|
@@ -66,6 +67,8 @@ interface DispatchDecisionCardProps {
|
|
|
66
67
|
disabled: boolean;
|
|
67
68
|
onChoose: (choice: DispatchChoice) => void;
|
|
68
69
|
onOpenRoute: (routeId: string) => void;
|
|
70
|
+
/** When set, an open card also offers a carrier recommendation for its shipment. */
|
|
71
|
+
onRecommendCarrier?: (shipmentId: string, shipmentNumber: string | null) => void;
|
|
69
72
|
t: Translate;
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -118,6 +121,7 @@ export function DispatchDecisionCard({
|
|
|
118
121
|
disabled,
|
|
119
122
|
onChoose,
|
|
120
123
|
onOpenRoute,
|
|
124
|
+
onRecommendCarrier,
|
|
121
125
|
t,
|
|
122
126
|
}: DispatchDecisionCardProps) {
|
|
123
127
|
const percent = Math.round(assignment.confidence * 100);
|
|
@@ -233,6 +237,17 @@ export function DispatchDecisionCard({
|
|
|
233
237
|
<X size={14} aria-hidden="true" />
|
|
234
238
|
{t('movethewheels.dispatch.reject', 'Reject')}
|
|
235
239
|
</Button>
|
|
240
|
+
{onRecommendCarrier && (
|
|
241
|
+
<Button
|
|
242
|
+
size="sm"
|
|
243
|
+
variant="ghost"
|
|
244
|
+
disabled={disabled}
|
|
245
|
+
onClick={() => onRecommendCarrier(assignment.shipmentId, assignment.shipmentNumber)}
|
|
246
|
+
>
|
|
247
|
+
<Building2 size={14} aria-hidden="true" />
|
|
248
|
+
{t('movethewheels.carrierDecision.useCarrier', 'Use a carrier instead')}
|
|
249
|
+
</Button>
|
|
250
|
+
)}
|
|
236
251
|
</div>
|
|
237
252
|
) : (
|
|
238
253
|
<DecisionOutcome assignment={assignment} onOpenRoute={onOpenRoute} t={t} />
|