@burdenoff/microfe-movethewheels 2026.1108.3 → 2026.1108.4

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.
@@ -424,6 +424,20 @@ export type IntegrationFilterInput = {
424
424
  status?: InputMaybe<IntegrationStatus>;
425
425
  };
426
426
  export type IntegrationStatus = 'ACTIVE' | 'DISABLED' | 'PAUSED';
427
+ export type InventoryCoverPlanInput = {
428
+ /** Scenario demand change applied to every forecast, -100 to 500 percent. Default 0. */
429
+ demandChangePct?: InputMaybe<Scalars['Float']['input']>;
430
+ /** Weeks between ordering and receiving stock, 0-26. Default 2. */
431
+ leadTimeWeeks?: InputMaybe<Scalars['Float']['input']>;
432
+ /** Maximum rows returned, 1-1000. Default 200. */
433
+ limit?: InputMaybe<Scalars['Int']['input']>;
434
+ /** Only return rows in these statuses. The summary always counts every row. */
435
+ statuses?: InputMaybe<Array<MtwInventoryCoverStatus>>;
436
+ /** Weeks of demand a replenishment should cover once it lands, 1-52. Default 6. */
437
+ targetCoverWeeks?: InputMaybe<Scalars['Float']['input']>;
438
+ /** Only plan this warehouse. Omit for every warehouse. */
439
+ warehouseId?: InputMaybe<Scalars['ID']['input']>;
440
+ };
427
441
  export type InventoryFilterInput = {
428
442
  cargoItemId?: InputMaybe<Scalars['ID']['input']>;
429
443
  inventoryItemId?: InputMaybe<Scalars['ID']['input']>;
@@ -1205,11 +1219,51 @@ export type MtwDeliveryJobStatusHistory = {
1205
1219
  updatedBy?: Maybe<Scalars['String']['output']>;
1206
1220
  workspaceId: Scalars['ID']['output'];
1207
1221
  };
1222
+ /** The model that produced a forecast row. */
1223
+ export type MtwDemandForecastModel =
1224
+ /** Reserved; never produced. Read as the moving-average heuristic. */
1225
+ 'HEURISTIC_GROWTH_RATE'
1226
+ /** Blend of 4- and 12-week moving averages with a clamped growth term. */
1227
+ | 'HEURISTIC_MOVING_AVG'
1228
+ /** Holt's linear trend exponential smoothing with a damped trend. */
1229
+ | 'HOLT_LINEAR'
1230
+ /** Additive Holt-Winters exponential smoothing with a damped trend and a seasonal cycle in weeks. */
1231
+ | 'HOLT_WINTERS';
1232
+ /** Which model forecasts a lane or customer, and why. */
1233
+ export type MtwDemandForecastModelChoice = {
1234
+ __typename?: 'MtwDemandForecastModelChoice';
1235
+ candidates: Array<MtwDemandForecastModelScore>;
1236
+ evaluatedAt: Scalars['DateTime']['output'];
1237
+ /** Closed weeks of history the forecast rests on. */
1238
+ historyWeeks: Scalars['Int']['output'];
1239
+ /** Plain-language reason for the choice, quoting the back-test errors. */
1240
+ reason: Scalars['String']['output'];
1241
+ scopeKey: Scalars['String']['output'];
1242
+ /** Display name: the customer's name for CUSTOMER rows, `Origin → Destination` for LANE rows. */
1243
+ scopeLabel: Scalars['String']['output'];
1244
+ scopeType: DemandForecastScope;
1245
+ selectedModel: MtwDemandForecastModel;
1246
+ };
1247
+ /** One candidate model's back-test result for a lane or customer. */
1248
+ export type MtwDemandForecastModelScore = {
1249
+ __typename?: 'MtwDemandForecastModelScore';
1250
+ /** Closed weeks the model was scored on, predicting each one week ahead. */
1251
+ holdoutWeeks: Scalars['Int']['output'];
1252
+ /** Mean absolute percentage error on weekly volume over the back-test weeks (0.25 = 25%). Null when no back-test week had demand. */
1253
+ mape?: Maybe<Scalars['Float']['output']>;
1254
+ model: MtwDemandForecastModel;
1255
+ /** Holt-Winters only: weeks in the seasonal cycle that scored best. */
1256
+ seasonLengthWeeks?: Maybe<Scalars['Int']['output']>;
1257
+ /** This model produces the lane's or customer's forecast. */
1258
+ selected: Scalars['Boolean']['output'];
1259
+ };
1208
1260
  export type MtwDemandForecastPoint = {
1209
1261
  __typename?: 'MtwDemandForecastPoint';
1210
1262
  actualRevenue?: Maybe<Scalars['Float']['output']>;
1211
1263
  actualVolume?: Maybe<Scalars['Int']['output']>;
1212
1264
  confidence: Scalars['Float']['output'];
1265
+ /** The model this row was forecast with. */
1266
+ model: MtwDemandForecastModel;
1213
1267
  periodEnd: Scalars['DateTime']['output'];
1214
1268
  periodStart: Scalars['DateTime']['output'];
1215
1269
  predictedRevenue: Scalars['Float']['output'];
@@ -1364,6 +1418,47 @@ export type MtwDistanceUnit =
1364
1418
  'KM'
1365
1419
  /** Miles */
1366
1420
  | 'MI';
1421
+ /**
1422
+ * A single extraction run over one platform File. `acceptedFields` is exactly
1423
+ * what a human accepted, `appliedActions` records what those accepts did —
1424
+ * the audit trail for a dispute is which file was read and which fields a
1425
+ * human accepted.
1426
+ */
1427
+ export type MtwDocumentExtraction = {
1428
+ __typename?: 'MtwDocumentExtraction';
1429
+ acceptedFields: Array<Scalars['String']['output']>;
1430
+ appliedAt?: Maybe<Scalars['DateTime']['output']>;
1431
+ appliedBy?: Maybe<Scalars['String']['output']>;
1432
+ costMicroUsd?: Maybe<Scalars['String']['output']>;
1433
+ createdAt: Scalars['DateTime']['output'];
1434
+ createdBy: Scalars['String']['output'];
1435
+ docType: MtwDocumentType;
1436
+ fields: Array<MtwExtractionField>;
1437
+ fileId: Scalars['ID']['output'];
1438
+ id: Scalars['ID']['output'];
1439
+ model: Scalars['String']['output'];
1440
+ shipmentId?: Maybe<Scalars['ID']['output']>;
1441
+ status: MtwDocumentExtractionStatus;
1442
+ workspaceId: Scalars['ID']['output'];
1443
+ };
1444
+ export type MtwDocumentExtractionStatus = 'APPLIED' | 'PARTIALLY_APPLIED' | 'PROPOSED';
1445
+ /**
1446
+ * Freight document intelligence (BOFF-3892).
1447
+ *
1448
+ * A vision model reads a freight document (BOL / POD / carrier invoice / packing
1449
+ * list) attached to a MoveTheWheels entity as a platform File and PROPOSES typed
1450
+ * fields with per-field confidence. The extraction writes nothing to the
1451
+ * operations spine by itself: a human reviews the proposed fields and accepts
1452
+ * them per-field through mtwApplyDocumentExtraction, and only the accepted,
1453
+ * mapped fields perform writes — a POD acceptance advances its shipment through
1454
+ * the normal ShipmentService.addTrackingEvent path, a carrier-invoice
1455
+ * acceptance records a freight-invoice comparison (variance) against the pinned
1456
+ * estimate. The model call is metered and ledgered on the shared AI runtime
1457
+ * (BOFF-3601) and made with store:false; extracted values stay in this
1458
+ * workspace's tables with the same lifecycle as the source file and are never
1459
+ * surfaced as assistant pageContext.
1460
+ */
1461
+ export type MtwDocumentType = 'BILL_OF_LADING' | 'CARRIER_INVOICE' | 'PACKING_LIST' | 'PROOF_OF_DELIVERY';
1367
1462
  export type MtwDriver = {
1368
1463
  __typename?: 'MtwDriver';
1369
1464
  baseSalary?: Maybe<Scalars['Float']['output']>;
@@ -1534,6 +1629,19 @@ export type MtwExportJob = {
1534
1629
  status: Scalars['String']['output'];
1535
1630
  workspaceId: Scalars['ID']['output'];
1536
1631
  };
1632
+ export type MtwExtractionCorrectionInput = {
1633
+ key: Scalars['String']['input'];
1634
+ value: Scalars['String']['input'];
1635
+ };
1636
+ /** One extracted field: a bounded, normalized value with the model's confidence in it. */
1637
+ export type MtwExtractionField = {
1638
+ __typename?: 'MtwExtractionField';
1639
+ confidence: Scalars['Float']['output'];
1640
+ key: Scalars['String']['output'];
1641
+ label: Scalars['String']['output'];
1642
+ /** Normalized value (ISO dates, plain numbers, JSON text for line items); null when the document did not show it. */
1643
+ value?: Maybe<Scalars['String']['output']>;
1644
+ };
1537
1645
  export type MtwFinanceMetrics = {
1538
1646
  __typename?: 'MtwFinanceMetrics';
1539
1647
  fuelCost: Scalars['Float']['output'];
@@ -2550,6 +2658,8 @@ export type MtwIntegration = {
2550
2658
  lastSyncAt?: Maybe<Scalars['DateTime']['output']>;
2551
2659
  name: Scalars['String']['output'];
2552
2660
  onBehalfOf: Scalars['String']['output'];
2661
+ /** Outcome of the latest poll for a pull-based integration (Geotab); null for webhook providers or before the first poll. */
2662
+ pollStatus?: Maybe<MtwIntegrationPollStatus>;
2553
2663
  provider: MtwIntegrationProvider;
2554
2664
  status: IntegrationStatus;
2555
2665
  updatedAt: Scalars['DateTime']['output'];
@@ -2586,7 +2696,150 @@ export type MtwIntegrationIngestReceipt = {
2586
2696
  trackingEventId: Scalars['ID']['output'];
2587
2697
  workspaceId: Scalars['ID']['output'];
2588
2698
  };
2589
- export type MtwIntegrationProvider = 'DESCARTES' | 'FOURKITES' | 'GENERIC_WEBHOOK' | 'PROJECT44' | 'SAMSARA' | 'SHIPROCKET';
2699
+ /** One integration's result in a poll run. */
2700
+ export type MtwIntegrationPollResult = {
2701
+ __typename?: 'MtwIntegrationPollResult';
2702
+ error?: Maybe<Scalars['String']['output']>;
2703
+ integrationId: Scalars['ID']['output'];
2704
+ recordsFetched: Scalars['Int']['output'];
2705
+ /** Why a poll was skipped: POLL_IN_PROGRESS, BACKING_OFF or STATE_UNAVAILABLE. */
2706
+ skippedReason?: Maybe<Scalars['String']['output']>;
2707
+ /** OK, PARTIAL, FAILED or SKIPPED. */
2708
+ status: Scalars['String']['output'];
2709
+ updatesAccepted: Scalars['Int']['output'];
2710
+ updatesSkipped: Scalars['Int']['output'];
2711
+ };
2712
+ export type MtwIntegrationPollRun = {
2713
+ __typename?: 'MtwIntegrationPollRun';
2714
+ integrationsFailed: Scalars['Int']['output'];
2715
+ integrationsPolled: Scalars['Int']['output'];
2716
+ ranAt: Scalars['DateTime']['output'];
2717
+ results: Array<MtwIntegrationPollResult>;
2718
+ updatesAccepted: Scalars['Int']['output'];
2719
+ };
2720
+ /** The workspace's integration-polls scheduler job. */
2721
+ export type MtwIntegrationPollSchedule = {
2722
+ __typename?: 'MtwIntegrationPollSchedule';
2723
+ cronExpression: Scalars['String']['output'];
2724
+ id: Scalars['ID']['output'];
2725
+ lastError?: Maybe<Scalars['String']['output']>;
2726
+ lastFiredAt?: Maybe<Scalars['DateTime']['output']>;
2727
+ schedulerJobId?: Maybe<Scalars['String']['output']>;
2728
+ /** PENDING, REGISTERING, ACTIVE or FAILED. */
2729
+ status: Scalars['String']['output'];
2730
+ timezone: Scalars['String']['output'];
2731
+ updatedAt: Scalars['DateTime']['output'];
2732
+ workspaceId: Scalars['ID']['output'];
2733
+ };
2734
+ /** State of a pull-based integration's polling (BOFF-10922). */
2735
+ export type MtwIntegrationPollStatus = {
2736
+ __typename?: 'MtwIntegrationPollStatus';
2737
+ consecutiveFailures: Scalars['Int']['output'];
2738
+ integrationId: Scalars['ID']['output'];
2739
+ lastErrorAt?: Maybe<Scalars['DateTime']['output']>;
2740
+ lastPollAt?: Maybe<Scalars['DateTime']['output']>;
2741
+ lastPollError?: Maybe<Scalars['String']['output']>;
2742
+ /** OK, PARTIAL (some updates were rejected) or FAILED. */
2743
+ lastPollStatus?: Maybe<Scalars['String']['output']>;
2744
+ lastRecordsFetched: Scalars['Int']['output'];
2745
+ lastSuccessAt?: Maybe<Scalars['DateTime']['output']>;
2746
+ lastUpdatesAccepted: Scalars['Int']['output'];
2747
+ /** Records skipped because their vehicle is unknown or has no in-progress route. */
2748
+ lastUpdatesSkipped: Scalars['Int']['output'];
2749
+ };
2750
+ export type MtwIntegrationProvider = 'DESCARTES' | 'FOURKITES' | 'GENERIC_WEBHOOK' | 'GEOTAB' | 'PROJECT44' | 'SAMSARA' | 'SHIPROCKET';
2751
+ export type MtwInventoryCoverPlan = {
2752
+ __typename?: 'MtwInventoryCoverPlan';
2753
+ demandChangePct: Scalars['Float']['output'];
2754
+ generatedAt: Scalars['DateTime']['output'];
2755
+ /** End of the history window: the Monday the current week began. */
2756
+ historyEnd: Scalars['DateTime']['output'];
2757
+ /** First day (Monday) of the closed-week history window. */
2758
+ historyStart: Scalars['DateTime']['output'];
2759
+ historyWeeks: Scalars['Int']['output'];
2760
+ leadTimeWeeks: Scalars['Float']['output'];
2761
+ /** Rows matching the status filter, before the limit. */
2762
+ matchingItems: Scalars['Int']['output'];
2763
+ rows: Array<MtwInventoryCoverRow>;
2764
+ summary: MtwInventoryCoverSummary;
2765
+ targetCoverWeeks: Scalars['Float']['output'];
2766
+ /** More stock lines or delivery jobs existed than were read; the plan covers the newest. */
2767
+ truncated: Scalars['Boolean']['output'];
2768
+ unattributedJobs: Scalars['Int']['output'];
2769
+ /** Outbound units of stocked SKUs whose pickup warehouse could not be resolved (workspace-wide). */
2770
+ unattributedUnits: Scalars['Float']['output'];
2771
+ warehouseId?: Maybe<Scalars['ID']['output']>;
2772
+ };
2773
+ /** One warehouse and SKU: stock on hand against forecast outbound demand. */
2774
+ export type MtwInventoryCoverRow = {
2775
+ __typename?: 'MtwInventoryCoverRow';
2776
+ allocated: Scalars['Int']['output'];
2777
+ available: Scalars['Int']['output'];
2778
+ /** Forecast weekly units before the scenario demand change. */
2779
+ baselineWeeklyDemand?: Maybe<Scalars['Float']['output']>;
2780
+ cargoItemId: Scalars['ID']['output'];
2781
+ /** Units shipped so far this (open) week. Not part of the history. */
2782
+ currentWeekUnits: Scalars['Float']['output'];
2783
+ damaged: Scalars['Int']['output'];
2784
+ demandStatus: MtwInventoryDemandStatus;
2785
+ /** Forecast weekly units after the scenario demand change. */
2786
+ forecastWeeklyDemand?: Maybe<Scalars['Float']['output']>;
2787
+ /** The stock lines (locations) aggregated into this position. */
2788
+ inventoryItemIds: Array<Scalars['ID']['output']>;
2789
+ name: Scalars['String']['output'];
2790
+ onHand: Scalars['Int']['output'];
2791
+ /** Monday of the ISO week stock is projected to run out, within two years. */
2792
+ projectedStockOutWeek?: Maybe<Scalars['DateTime']['output']>;
2793
+ reorderPoint?: Maybe<Scalars['Int']['output']>;
2794
+ safetyStock?: Maybe<Scalars['Int']['output']>;
2795
+ sku: Scalars['String']['output'];
2796
+ status: MtwInventoryCoverStatus;
2797
+ /** Stock runs out before a replenishment ordered now would arrive. */
2798
+ stockOutBeforeLeadTime: Scalars['Boolean']['output'];
2799
+ /** Units to order now so the target cover (plus safety stock) is on hand when the order lands. */
2800
+ suggestedReorderQuantity?: Maybe<Scalars['Int']['output']>;
2801
+ /** On hand minus damaged: the stock that can still ship. */
2802
+ usableStock: Scalars['Int']['output'];
2803
+ warehouseCode: Scalars['String']['output'];
2804
+ warehouseId: Scalars['ID']['output'];
2805
+ warehouseName: Scalars['String']['output'];
2806
+ /** Units shipped per closed ISO week of the history window, oldest first. */
2807
+ weeklyUnits: Array<Scalars['Float']['output']>;
2808
+ /** Usable stock divided by forecast weekly demand. */
2809
+ weeksOfCover?: Maybe<Scalars['Float']['output']>;
2810
+ /** Closed weeks the demand rate rests on. */
2811
+ weeksOfHistory: Scalars['Int']['output'];
2812
+ };
2813
+ /**
2814
+ * Where a stock position stands against forecast outbound demand (BOFF-10926).
2815
+ * Statuses are listed most urgent first.
2816
+ */
2817
+ export type MtwInventoryCoverStatus =
2818
+ /** Stock runs out before a replenishment ordered now would arrive (cover below the lead time). */
2819
+ 'AT_RISK'
2820
+ /** Stock covers the lead time and the target cover. */
2821
+ | 'HEALTHY'
2822
+ /** Fewer than 4 closed weeks since the first outbound: no demand forecast yet. */
2823
+ | 'NOT_ENOUGH_HISTORY'
2824
+ /** No outbound in the history window. */
2825
+ | 'NO_DEMAND'
2826
+ /** Demand is forecast and there is no usable stock left. */
2827
+ | 'OUT_OF_STOCK'
2828
+ /** Order now to hold the target cover, or the stock is at or below its reorder point. */
2829
+ | 'REORDER';
2830
+ export type MtwInventoryCoverSummary = {
2831
+ __typename?: 'MtwInventoryCoverSummary';
2832
+ atRisk: Scalars['Int']['output'];
2833
+ healthy: Scalars['Int']['output'];
2834
+ noDemand: Scalars['Int']['output'];
2835
+ notEnoughHistory: Scalars['Int']['output'];
2836
+ outOfStock: Scalars['Int']['output'];
2837
+ reorder: Scalars['Int']['output'];
2838
+ totalItems: Scalars['Int']['output'];
2839
+ totalSuggestedReorderQuantity: Scalars['Int']['output'];
2840
+ };
2841
+ /** Whether a stock position has a demand forecast. */
2842
+ export type MtwInventoryDemandStatus = 'FORECAST' | 'NOT_ENOUGH_HISTORY' | 'NO_DEMAND';
2590
2843
  export type MtwInventoryItem = {
2591
2844
  __typename?: 'MtwInventoryItem';
2592
2845
  allocated: Scalars['Int']['output'];
@@ -3671,6 +3924,11 @@ export type MtwRouteStats = {
3671
3924
  totalDistance: Scalars['Float']['output'];
3672
3925
  totalDuration: Scalars['Float']['output'];
3673
3926
  };
3927
+ /** Scheduler execution context, added by wspace-scheduler-svc when it fires the job. */
3928
+ export type MtwRunIntegrationPollsInput = {
3929
+ idempotencyKey?: InputMaybe<Scalars['String']['input']>;
3930
+ triggerData?: InputMaybe<Scalars['JSON']['input']>;
3931
+ };
3674
3932
  /**
3675
3933
  * Set by wspace-scheduler-svc at fire time: idempotencyKey is
3676
3934
  * "<scheduleId>:<scheduledTime>" and triggerData carries scheduledTime, firedAt,
@@ -4761,6 +5019,17 @@ export type Mutation = {
4761
5019
  * An empty list rejects the whole plan.
4762
5020
  */
4763
5021
  mtwApplyDispatchPlan: MtwDispatchPlan;
5022
+ /**
5023
+ * Accept extracted fields per-field. Accepts are cumulative and idempotent;
5024
+ * the writes each accepted field triggers happen once. POD accepts advance
5025
+ * the referenced shipment via ShipmentService.addTrackingEvent(DELIVERED);
5026
+ * invoice accepts record a freight-invoice comparison against the shipment's
5027
+ * pinned estimate. Fields with no write mapping are recorded as accepted
5028
+ * (audit) without a write.
5029
+ */
5030
+ mtwApplyDocumentExtraction: MtwDocumentExtraction;
5031
+ /** Register, verify or repair the workspace's integration-polls job. Idempotent. */
5032
+ mtwEnsureIntegrationPollSchedule?: Maybe<MtwIntegrationPollSchedule>;
4764
5033
  /** Register, verify or repair the workspace's scheduled-reports job. Idempotent. */
4765
5034
  mtwEnsureReportSchedule?: Maybe<MtwReportSchedule>;
4766
5035
  /**
@@ -4768,6 +5037,13 @@ export type Mutation = {
4768
5037
  * scheduler. Idempotent; leaves a job an operator paused alone.
4769
5038
  */
4770
5039
  mtwEnsureRiskSweepSchedule?: Maybe<MtwRiskSweepSchedule>;
5040
+ /**
5041
+ * Run the shared vision model over a platform File and store the proposed
5042
+ * fields. Reads the file bytes through wspace-files-svc (presigned URL),
5043
+ * gates on checkAiCreditsFor and charges + ledger-records the call on the
5044
+ * shared AI runtime. Writes nothing onto orders / shipments / invoices.
5045
+ */
5046
+ mtwExtractDocument: MtwDocumentExtraction;
4771
5047
  /**
4772
5048
  * Generate (or reuse) the AI narration for a shipment's current risk forecast
4773
5049
  * and return the forecast with it attached. With AI disabled, credits spent or
@@ -4797,6 +5073,12 @@ export type Mutation = {
4797
5073
  * Refused when the shipment is neither at risk nor past its promise.
4798
5074
  */
4799
5075
  mtwResolveException: MtwShipmentDecision;
5076
+ /**
5077
+ * Poll every active pull-based integration of the workspace. Fired every few
5078
+ * minutes by wspace-scheduler-svc as this service's own service actor; a
5079
+ * workspace user may also run it on demand.
5080
+ */
5081
+ mtwRunIntegrationPolls: MtwIntegrationPollRun;
4800
5082
  /**
4801
5083
  * Re-forecast every in-flight shipment of the workspace and notify for any that
4802
5084
  * started slipping. Fired by wspace-scheduler-svc as this service's own service
@@ -4813,7 +5095,10 @@ export type Mutation = {
4813
5095
  openMtwFreeTimeClock: MtwFreeTimeClock;
4814
5096
  optimizeRoute: MtwRoute;
4815
5097
  planMultiModalShipment: MtwShipment;
5098
+ /** Poll one pull-based integration (Geotab) now, outside its schedule. */
5099
+ pollIntegrationNow: MtwIntegrationPollResult;
4816
5100
  publishMtwProcedureVersion: MtwProcedureVersion;
5101
+ /** Recalculate now. `weeksOfHistory` is clamped to 4-104 closed weeks. */
4817
5102
  recalculateDemandForecasts: Scalars['Int']['output'];
4818
5103
  recordMtwConsolidationObservation: MtwConsolidationObservation;
4819
5104
  recordMtwContainerEvent: MtwContainerEvent;
@@ -5040,6 +5325,15 @@ export type MutationMtwApplyDispatchPlanArgs = {
5040
5325
  accept: Array<Scalars['ID']['input']>;
5041
5326
  planId: Scalars['ID']['input'];
5042
5327
  };
5328
+ export type MutationMtwApplyDocumentExtractionArgs = {
5329
+ accept: Array<Scalars['String']['input']>;
5330
+ corrections?: InputMaybe<Array<MtwExtractionCorrectionInput>>;
5331
+ extractionId: Scalars['ID']['input'];
5332
+ };
5333
+ export type MutationMtwExtractDocumentArgs = {
5334
+ docType: MtwDocumentType;
5335
+ fileId: Scalars['ID']['input'];
5336
+ };
5043
5337
  export type MutationMtwNarrateShipmentRiskForecastArgs = {
5044
5338
  shipmentId: Scalars['ID']['input'];
5045
5339
  };
@@ -5058,6 +5352,9 @@ export type MutationMtwRejectShipmentDecisionArgs = {
5058
5352
  export type MutationMtwResolveExceptionArgs = {
5059
5353
  shipmentId: Scalars['ID']['input'];
5060
5354
  };
5355
+ export type MutationMtwRunIntegrationPollsArgs = {
5356
+ input?: InputMaybe<MtwRunIntegrationPollsInput>;
5357
+ };
5061
5358
  export type MutationMtwRunRiskSweepArgs = {
5062
5359
  input?: InputMaybe<MtwRunRiskSweepInput>;
5063
5360
  };
@@ -5076,6 +5373,9 @@ export type MutationOptimizeRouteArgs = {
5076
5373
  export type MutationPlanMultiModalShipmentArgs = {
5077
5374
  input: PlanMultiModalShipmentInput;
5078
5375
  };
5376
+ export type MutationPollIntegrationNowArgs = {
5377
+ id: Scalars['ID']['input'];
5378
+ };
5079
5379
  export type MutationPublishMtwProcedureVersionArgs = {
5080
5380
  input: PublishMtwProcedureVersionInput;
5081
5381
  };
@@ -5359,6 +5659,8 @@ export type Query = {
5359
5659
  deliveryJobsCount: Scalars['Int']['output'];
5360
5660
  demandForecastByCustomer: Array<MtwDemandForecastPoint>;
5361
5661
  demandForecastByLane: Array<MtwDemandForecastPoint>;
5662
+ /** Model choice and back-test errors per lane or customer, most history first. `limit` caps lanes / customers (1-200). */
5663
+ demandForecastModelChoices: Array<MtwDemandForecastModelChoice>;
5362
5664
  /** Null until the workspace's forecast has been calculated once. */
5363
5665
  demandForecastRunStatus?: Maybe<MtwDemandForecastRunStatus>;
5364
5666
  demandForecastVariance: Array<MtwDemandForecastVariance>;
@@ -5382,6 +5684,12 @@ export type Query = {
5382
5684
  integrationIngestReceipts: Array<MtwIntegrationIngestReceipt>;
5383
5685
  integrations: Array<MtwIntegration>;
5384
5686
  integrationsCount: Scalars['Int']['output'];
5687
+ /**
5688
+ * Weeks of stock cover per warehouse and SKU against forecast outbound
5689
+ * demand from delivery-job cargo lines, with the projected stock-out week
5690
+ * and a suggested reorder quantity. Read-only; computed on request.
5691
+ */
5692
+ inventoryCoverPlan: MtwInventoryCoverPlan;
5385
5693
  inventoryItem?: Maybe<MtwInventoryItem>;
5386
5694
  inventoryItems: Array<MtwInventoryItem>;
5387
5695
  inventoryItemsCount: Scalars['Int']['output'];
@@ -5418,6 +5726,10 @@ export type Query = {
5418
5726
  mtwCustomerNotifications: MtwCustomerNotificationPage;
5419
5727
  mtwDispatchPlan?: Maybe<MtwDispatchPlan>;
5420
5728
  mtwDispatchPlans: Array<MtwDispatchPlan>;
5729
+ /** One extraction, by id. */
5730
+ mtwDocumentExtraction?: Maybe<MtwDocumentExtraction>;
5731
+ /** Every extraction (newest first) that ran against this platform File. */
5732
+ mtwDocumentExtractions: Array<MtwDocumentExtraction>;
5421
5733
  /** Exact immutable instruction, including a proposal's historical owner; not a current-eligibility claim. */
5422
5734
  mtwEmptyReturnInstruction: MtwEmptyReturnInstruction;
5423
5735
  mtwEmptyReturnInstructionPage: MtwEmptyReturnInstructionPage;
@@ -5443,6 +5755,8 @@ export type Query = {
5443
5755
  * entity create permission.
5444
5756
  */
5445
5757
  mtwImportSpec: Array<MtwImportEntitySpec>;
5758
+ /** The workspace's integration-polls job; null until a polled integration is first saved. */
5759
+ mtwIntegrationPollSchedule?: Maybe<MtwIntegrationPollSchedule>;
5446
5760
  /** The workspace's most recent dispatch plan, whatever its status. */
5447
5761
  mtwLatestDispatchPlan?: Maybe<MtwDispatchPlan>;
5448
5762
  /** The shipment's most recent decision of this kind, whatever its status. */
@@ -5583,6 +5897,10 @@ export type QueryDemandForecastByCustomerArgs = {
5583
5897
  export type QueryDemandForecastByLaneArgs = {
5584
5898
  weeks?: InputMaybe<Scalars['Int']['input']>;
5585
5899
  };
5900
+ export type QueryDemandForecastModelChoicesArgs = {
5901
+ limit?: InputMaybe<Scalars['Int']['input']>;
5902
+ scopeType: DemandForecastScope;
5903
+ };
5586
5904
  export type QueryDemandForecastVarianceArgs = {
5587
5905
  limit?: InputMaybe<Scalars['Int']['input']>;
5588
5906
  scopeType: DemandForecastScope;
@@ -5621,6 +5939,9 @@ export type QueryIntegrationsArgs = {
5621
5939
  export type QueryIntegrationsCountArgs = {
5622
5940
  filter?: InputMaybe<IntegrationFilterInput>;
5623
5941
  };
5942
+ export type QueryInventoryCoverPlanArgs = {
5943
+ input?: InputMaybe<InventoryCoverPlanInput>;
5944
+ };
5624
5945
  export type QueryInventoryItemArgs = {
5625
5946
  id: Scalars['ID']['input'];
5626
5947
  };
@@ -5733,6 +6054,12 @@ export type QueryMtwDispatchPlansArgs = {
5733
6054
  pagination?: InputMaybe<PaginationInput>;
5734
6055
  status?: InputMaybe<MtwDispatchPlanStatus>;
5735
6056
  };
6057
+ export type QueryMtwDocumentExtractionArgs = {
6058
+ id: Scalars['ID']['input'];
6059
+ };
6060
+ export type QueryMtwDocumentExtractionsArgs = {
6061
+ fileId: Scalars['ID']['input'];
6062
+ };
5736
6063
  export type QueryMtwEmptyReturnInstructionArgs = {
5737
6064
  id: Scalars['ID']['input'];
5738
6065
  };
@@ -1,11 +1,11 @@
1
1
  import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
2
  import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
- import { CREATE_INTEGRATION_MUTATION as n, DELETE_INTEGRATION_MUTATION as r, INTEGRATION_COUNTS_QUERY as i, INTEGRATION_EVENTS_QUERY as a, LIST_INTEGRATIONS_QUERY as o, UPDATE_INTEGRATION_MUTATION as s } from "../utils/carrierIntegrations.js";
4
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
3
+ import { CREATE_INTEGRATION_MUTATION as n, DELETE_INTEGRATION_MUTATION as r, INTEGRATION_COUNTS_QUERY as i, INTEGRATION_EVENTS_QUERY as a, LIST_INTEGRATIONS_QUERY as o, POLL_INTEGRATION_NOW_MUTATION as s, UPDATE_INTEGRATION_MUTATION as c } from "../utils/carrierIntegrations.js";
4
+ import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
5
5
  //#region src/movethewheels/hooks/useCarrierIntegrations.ts
6
- function p() {
6
+ function m() {
7
7
  let { apiGatewayUrl: t, authToken: n, workspaceToken: r, workspaceId: i, tenantId: a, currentUser: o } = e();
8
- return u(() => ({
8
+ return d(() => ({
9
9
  apiGatewayUrl: t,
10
10
  authToken: n,
11
11
  workspaceToken: r,
@@ -21,11 +21,11 @@ function p() {
21
21
  o?.id
22
22
  ]);
23
23
  }
24
- function m(e, t) {
24
+ function h(e, t) {
25
25
  return e instanceof Error ? e : Error(t);
26
26
  }
27
- function h(e) {
28
- let n = p(), { status: r, limit: i, offset: a } = e, [s, u] = f([]), [h, g] = f(0), [_, v] = f(!1), [y, b] = f(null), x = d(0), S = c(async () => {
27
+ function g(e) {
28
+ let n = m(), { status: r, limit: i, offset: a } = e, [s, c] = p([]), [d, g] = p(0), [_, v] = p(!1), [y, b] = p(null), x = f(0), S = l(async () => {
29
29
  let e = ++x.current;
30
30
  v(!0), b(null);
31
31
  try {
@@ -37,10 +37,10 @@ function h(e) {
37
37
  }
38
38
  });
39
39
  if (e !== x.current) return;
40
- u(s.integrations), g(s.integrationsCount);
40
+ c(s.integrations), g(s.integrationsCount);
41
41
  } catch (t) {
42
42
  if (e !== x.current) return;
43
- b(m(t, "Failed to load integrations"));
43
+ b(h(t, "Failed to load integrations"));
44
44
  } finally {
45
45
  e === x.current && v(!1);
46
46
  }
@@ -50,25 +50,25 @@ function h(e) {
50
50
  i,
51
51
  a
52
52
  ]);
53
- l(() => (S(), () => {
53
+ u(() => (S(), () => {
54
54
  x.current += 1;
55
55
  }), [S]);
56
- let C = d(S);
57
- return l(() => {
56
+ let C = f(S);
57
+ return u(() => {
58
58
  C.current = S;
59
59
  }, [S]), {
60
60
  integrations: s,
61
- total: h,
61
+ total: d,
62
62
  isLoading: _,
63
63
  error: y,
64
- refetch: c(() => C.current(), [])
64
+ refetch: l(() => C.current(), [])
65
65
  };
66
66
  }
67
- function g() {
68
- let e = p(), [n, r] = f({
67
+ function _() {
68
+ let e = m(), [n, r] = p({
69
69
  all: 0,
70
70
  active: 0
71
- }), a = d(0), o = c(async () => {
71
+ }), a = f(0), o = l(async () => {
72
72
  let n = ++a.current;
73
73
  try {
74
74
  let o = await t(e, i, {});
@@ -78,22 +78,22 @@ function g() {
78
78
  });
79
79
  } catch {}
80
80
  }, [e]);
81
- return l(() => (o(), () => {
81
+ return u(() => (o(), () => {
82
82
  a.current += 1;
83
83
  }), [o]), {
84
84
  ...n,
85
85
  refetch: o
86
86
  };
87
87
  }
88
- function _(e, n, r = 20) {
89
- let i = p(), [o, s] = f([]), [c, u] = f(!1), [d, h] = f(null);
90
- return l(() => {
88
+ function v(e, n, r = 20) {
89
+ let i = m(), [o, s] = p([]), [c, l] = p(!1), [d, f] = p(null);
90
+ return u(() => {
91
91
  if (!e) {
92
92
  s([]);
93
93
  return;
94
94
  }
95
95
  let n = !1;
96
- return u(!0), h(null), t(i, a, {
96
+ return l(!0), f(null), t(i, a, {
97
97
  integrationId: e,
98
98
  pagination: {
99
99
  limit: r,
@@ -102,9 +102,9 @@ function _(e, n, r = 20) {
102
102
  }).then((e) => {
103
103
  n || s(e.integrationEvents);
104
104
  }).catch((e) => {
105
- n || h(m(e, "Failed to load deliveries"));
105
+ n || f(h(e, "Failed to load deliveries"));
106
106
  }).finally(() => {
107
- n || u(!1);
107
+ n || l(!1);
108
108
  }), () => {
109
109
  n = !0;
110
110
  };
@@ -119,23 +119,24 @@ function _(e, n, r = 20) {
119
119
  error: d
120
120
  };
121
121
  }
122
- function v() {
123
- let e = p();
124
- return u(() => ({
122
+ function y() {
123
+ let e = m();
124
+ return d(() => ({
125
125
  create: async (r) => (await t(e, n, { input: {
126
126
  ...r,
127
127
  name: r.name.trim(),
128
128
  status: "ACTIVE"
129
129
  } }, "SINGLE_ATTEMPT")).createIntegration,
130
- update: async (n, r) => (await t(e, s, {
130
+ update: async (n, r) => (await t(e, c, {
131
131
  id: n,
132
132
  input: r.name === void 0 ? r : {
133
133
  ...r,
134
134
  name: r.name.trim()
135
135
  }
136
136
  })).updateIntegration,
137
+ pollNow: async (n) => (await t(e, s, { id: n }, "SINGLE_ATTEMPT")).pollIntegrationNow,
137
138
  remove: async (n) => (await t(e, r, { id: n })).deleteIntegration
138
139
  }), [e]);
139
140
  }
140
141
  //#endregion
141
- export { v as useCarrierIntegrationActions, g as useCarrierIntegrationCounts, _ as useCarrierIntegrationEvents, h as useCarrierIntegrations };
142
+ export { y as useCarrierIntegrationActions, _ as useCarrierIntegrationCounts, v as useCarrierIntegrationEvents, g as useCarrierIntegrations };
@@ -1,10 +1,14 @@
1
- import { CarrierIntegration, CarrierIntegrationEvent, IntegrationStatus, SupportedProvider } from '../utils/carrierIntegrations';
1
+ import { CarrierIntegration, CarrierIntegrationEvent, GeotabConfig, IntegrationPollResult, IntegrationStatus, SupportedProvider } from '../utils/carrierIntegrations';
2
2
  export interface CreateCarrierIntegrationInput {
3
3
  provider: SupportedProvider;
4
4
  name: string;
5
5
  apiSecret: string;
6
- /** Provider mapping settings (e.g. Samsara's shipment external id key). Never secrets. */
7
- config?: Record<string, string>;
6
+ /**
7
+ * Provider settings (Samsara's shipment external id key, Geotab's server,
8
+ * database, user and rule mappings). Never secrets: a Geotab password goes
9
+ * in `apiSecret`, which the service stores encrypted.
10
+ */
11
+ config?: Record<string, string> | GeotabConfig;
8
12
  }
9
13
  export interface UpdateCarrierIntegrationInput {
10
14
  name?: string;
@@ -37,5 +41,7 @@ export declare function useCarrierIntegrationEvents(integrationId: string | null
37
41
  export declare function useCarrierIntegrationActions(): {
38
42
  create: (input: CreateCarrierIntegrationInput) => Promise<CarrierIntegration>;
39
43
  update: (id: string, input: UpdateCarrierIntegrationInput) => Promise<CarrierIntegration>;
44
+ /** Polls a pulled feed (Geotab) now, outside its schedule. */
45
+ pollNow: (id: string) => Promise<IntegrationPollResult>;
40
46
  remove: (id: string) => Promise<boolean>;
41
47
  };