@burdenoff/microfe-movethewheels 2026.1031.2 → 2026.1031.3

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.
Files changed (29) hide show
  1. package/dist/MoveTheWheelsRoot.js +144 -136
  2. package/dist/MoveTheWheelsRoutes.js +61 -57
  3. package/dist/generated/tracking-quality-operations.d.ts +84 -0
  4. package/dist/hooks/useEntityImport.js +68 -0
  5. package/dist/movethewheels/hooks/useEntityImport.d.ts +19 -0
  6. package/dist/movethewheels/pages/ImportExportPage.d.ts +9 -0
  7. package/dist/movethewheels/utils/entityImport.d.ts +109 -0
  8. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-up.js +22 -0
  9. package/dist/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js +30 -0
  10. package/dist/node_modules/lucide-react/dist/esm/icons/file-up.js +22 -0
  11. package/dist/pages/CustomersPage.js +88 -79
  12. package/dist/pages/DriversPage.js +115 -106
  13. package/dist/pages/ImportExportPage.js +435 -0
  14. package/dist/pages/ProductsPage.js +85 -76
  15. package/dist/pages/VehiclesPage.js +99 -90
  16. package/dist/pages/WarehousesPage.js +97 -88
  17. package/dist/utils/entityImport.js +73 -0
  18. package/package.json +3 -2
  19. package/src/generated/tracking-quality-operations.ts +122 -0
  20. package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
  21. package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
  22. package/src/movethewheels/hooks/useEntityImport.ts +108 -0
  23. package/src/movethewheels/pages/CustomersPage.tsx +6 -1
  24. package/src/movethewheels/pages/DriversPage.tsx +6 -0
  25. package/src/movethewheels/pages/ImportExportPage.tsx +483 -0
  26. package/src/movethewheels/pages/ProductsPage.tsx +14 -1
  27. package/src/movethewheels/pages/VehiclesPage.tsx +6 -0
  28. package/src/movethewheels/pages/WarehousesPage.tsx +6 -1
  29. package/src/movethewheels/utils/entityImport.ts +239 -0
@@ -28,8 +28,8 @@ function d() {
28
28
  })
29
29
  });
30
30
  }
31
- var f = r(() => import("./pages/DashboardPage.js")), ee = r(() => import("./pages/OrdersListPage.js")), p = r(() => import("./pages/OrderDetailsPage.js")), m = r(() => import("./pages/CreateOrderPage.js")), h = r(() => import("./pages/TrackingPage.js")), g = r(() => import("./pages/TrackingEventQualityPage.js")), _ = r(() => import("./pages/ShipmentStatusAuthorityPage.js")), v = r(() => import("./pages/LiveTrackingPage.js")), y = r(() => import("./pages/FleetPage.js")), b = r(() => import("./pages/VehiclesPage.js")), x = r(() => import("./pages/VehicleDetailsPage.js")), S = r(() => import("./pages/DriversPage.js")), C = r(() => import("./pages/DriverDetailsPage.js")), w = r(() => import("./pages/InventoryPage.js")), T = r(() => import("./pages/ProductsPage.js")), E = r(() => import("./pages/ProductDetailsPage.js")), D = r(() => import("./pages/PalletPreviewPage.js")), O = r(() => import("./pages/WarehousesPage.js")), k = r(() => import("./pages/WarehouseDetailsPage.js")), A = r(() => import("./pages/CustomersPage.js")), j = r(() => import("./pages/CustomerDetailsPage.js")), M = r(() => import("./pages/MarketplacePage.js")), N = r(() => import("./pages/RoutesPage.js")), P = r(() => import("./pages/RouteDetailsPage.js")), F = r(() => import("./pages/AnalyticsPage.js")), I = r(() => import("./pages/FinancePage.js")), L = r(() => import("./pages/FreightEstimatePage.js")), R = r(() => import("./pages/FreightInvoicePage.js")), z = r(() => import("./pages/ConsolidationPage.js")), B = r(() => import("./pages/LogisticsProceduresPage.js")), V = r(() => import("./pages/AIAssistantPage.js")), H = r(() => import("./pages/DeliveryCapturePage.js")), U = r(() => import("./pages/MultiModalShipmentPage.js")), W = r(() => import("./pages/ShippingRatesPage.js")), G = r(() => import("./pages/ContainersPage.js")), K = r(() => import("./pages/ContainerConditionPage.js")), q = r(() => import("./pages/FreeTimePage.js")), J = r(() => import("./pages/PendingPickPage.js")), Y = r(() => import("./pages/StockObservationsPage.js")), X = r(() => import("./pages/StockBindingPage.js")), Z = r(() => import("./pages/TripUtilizationPage.js")), Q = r(() => import("./pages/ConsumedFuelPreviewPage.js")), $ = r(() => import("./pages/EmptyReusePage.js"));
32
- function te() {
31
+ var f = r(() => import("./pages/DashboardPage.js")), p = r(() => import("./pages/OrdersListPage.js")), m = r(() => import("./pages/OrderDetailsPage.js")), h = r(() => import("./pages/CreateOrderPage.js")), g = r(() => import("./pages/TrackingPage.js")), _ = r(() => import("./pages/TrackingEventQualityPage.js")), v = r(() => import("./pages/ShipmentStatusAuthorityPage.js")), y = r(() => import("./pages/LiveTrackingPage.js")), b = r(() => import("./pages/FleetPage.js")), x = r(() => import("./pages/VehiclesPage.js")), S = r(() => import("./pages/VehicleDetailsPage.js")), C = r(() => import("./pages/DriversPage.js")), w = r(() => import("./pages/DriverDetailsPage.js")), T = r(() => import("./pages/InventoryPage.js")), E = r(() => import("./pages/ProductsPage.js")), D = r(() => import("./pages/ProductDetailsPage.js")), O = r(() => import("./pages/PalletPreviewPage.js")), k = r(() => import("./pages/WarehousesPage.js")), A = r(() => import("./pages/WarehouseDetailsPage.js")), j = r(() => import("./pages/CustomersPage.js")), M = r(() => import("./pages/CustomerDetailsPage.js")), N = r(() => import("./pages/MarketplacePage.js")), P = r(() => import("./pages/ImportExportPage.js")), ee = r(() => import("./pages/RoutesPage.js")), F = r(() => import("./pages/RouteDetailsPage.js")), I = r(() => import("./pages/AnalyticsPage.js")), L = r(() => import("./pages/FinancePage.js")), R = r(() => import("./pages/FreightEstimatePage.js")), z = r(() => import("./pages/FreightInvoicePage.js")), B = r(() => import("./pages/ConsolidationPage.js")), V = r(() => import("./pages/LogisticsProceduresPage.js")), H = r(() => import("./pages/AIAssistantPage.js")), U = r(() => import("./pages/DeliveryCapturePage.js")), W = r(() => import("./pages/MultiModalShipmentPage.js")), G = r(() => import("./pages/ShippingRatesPage.js")), K = r(() => import("./pages/ContainersPage.js")), q = r(() => import("./pages/ContainerConditionPage.js")), J = r(() => import("./pages/FreeTimePage.js")), Y = r(() => import("./pages/PendingPickPage.js")), X = r(() => import("./pages/StockObservationsPage.js")), Z = r(() => import("./pages/StockBindingPage.js")), Q = r(() => import("./pages/TripUtilizationPage.js")), $ = r(() => import("./pages/ConsumedFuelPreviewPage.js")), te = r(() => import("./pages/EmptyReusePage.js"));
32
+ function ne() {
33
33
  return /* @__PURE__ */ s(n, {
34
34
  fallback: /* @__PURE__ */ s(d, {}),
35
35
  children: /* @__PURE__ */ c(a, { children: [
@@ -39,219 +39,223 @@ function te() {
39
39
  }),
40
40
  /* @__PURE__ */ s(i, {
41
41
  path: "orders",
42
- element: /* @__PURE__ */ s(ee, {})
42
+ element: /* @__PURE__ */ s(p, {})
43
43
  }),
44
44
  /* @__PURE__ */ s(i, {
45
45
  path: "orders/new",
46
- element: /* @__PURE__ */ s(m, {})
46
+ element: /* @__PURE__ */ s(h, {})
47
47
  }),
48
48
  /* @__PURE__ */ s(i, {
49
49
  path: "orders/:orderId",
50
- element: /* @__PURE__ */ s(p, {})
50
+ element: /* @__PURE__ */ s(m, {})
51
51
  }),
52
52
  /* @__PURE__ */ s(i, {
53
53
  path: "orders/:orderId/edit",
54
- element: /* @__PURE__ */ s(m, {})
54
+ element: /* @__PURE__ */ s(h, {})
55
55
  }),
56
56
  /* @__PURE__ */ s(i, {
57
57
  path: "tracking",
58
- element: /* @__PURE__ */ s(h, {})
58
+ element: /* @__PURE__ */ s(g, {})
59
59
  }),
60
60
  /* @__PURE__ */ s(i, {
61
61
  path: "tracking/live",
62
- element: /* @__PURE__ */ s(v, {})
62
+ element: /* @__PURE__ */ s(y, {})
63
63
  }),
64
64
  /* @__PURE__ */ s(i, {
65
65
  path: "tracking/event-quality",
66
- element: /* @__PURE__ */ s(g, {})
66
+ element: /* @__PURE__ */ s(_, {})
67
67
  }),
68
68
  /* @__PURE__ */ s(i, {
69
69
  path: "shipments/status-authority",
70
- element: /* @__PURE__ */ s(_, {})
70
+ element: /* @__PURE__ */ s(v, {})
71
71
  }),
72
72
  /* @__PURE__ */ s(i, {
73
73
  path: "deliveries/mine",
74
- element: /* @__PURE__ */ s(H, {})
74
+ element: /* @__PURE__ */ s(U, {})
75
75
  }),
76
76
  /* @__PURE__ */ s(i, {
77
77
  path: "shipments/multi-modal",
78
- element: /* @__PURE__ */ s(U, {})
78
+ element: /* @__PURE__ */ s(W, {})
79
79
  }),
80
80
  /* @__PURE__ */ s(i, {
81
81
  path: "shipments/rates",
82
- element: /* @__PURE__ */ s(W, {})
82
+ element: /* @__PURE__ */ s(G, {})
83
83
  }),
84
84
  /* @__PURE__ */ s(i, {
85
85
  path: "containers",
86
- element: /* @__PURE__ */ s(G, {})
86
+ element: /* @__PURE__ */ s(K, {})
87
87
  }),
88
88
  /* @__PURE__ */ s(i, {
89
89
  path: "containers/condition",
90
- element: /* @__PURE__ */ s(K, {})
90
+ element: /* @__PURE__ */ s(q, {})
91
91
  }),
92
92
  /* @__PURE__ */ s(i, {
93
93
  path: "containers/free-time",
94
- element: /* @__PURE__ */ s(q, {})
94
+ element: /* @__PURE__ */ s(J, {})
95
95
  }),
96
96
  /* @__PURE__ */ s(i, {
97
97
  path: "containers/empty-reuse",
98
- element: /* @__PURE__ */ s($, {})
98
+ element: /* @__PURE__ */ s(te, {})
99
99
  }),
100
100
  /* @__PURE__ */ s(i, {
101
101
  path: "containers/consolidation",
102
- element: /* @__PURE__ */ s(z, {})
102
+ element: /* @__PURE__ */ s(B, {})
103
103
  }),
104
104
  /* @__PURE__ */ s(i, {
105
105
  path: "containers/procedures",
106
- element: /* @__PURE__ */ s(B, {})
106
+ element: /* @__PURE__ */ s(V, {})
107
107
  }),
108
108
  /* @__PURE__ */ s(i, {
109
109
  path: "fleet",
110
- element: /* @__PURE__ */ s(y, {})
110
+ element: /* @__PURE__ */ s(b, {})
111
111
  }),
112
112
  /* @__PURE__ */ s(i, {
113
113
  path: "fleet/vehicles",
114
- element: /* @__PURE__ */ s(b, {})
114
+ element: /* @__PURE__ */ s(x, {})
115
115
  }),
116
116
  /* @__PURE__ */ s(i, {
117
117
  path: "fleet/vehicles/new",
118
- element: /* @__PURE__ */ s(x, {})
118
+ element: /* @__PURE__ */ s(S, {})
119
119
  }),
120
120
  /* @__PURE__ */ s(i, {
121
121
  path: "fleet/vehicles/:vehicleId",
122
- element: /* @__PURE__ */ s(x, {})
122
+ element: /* @__PURE__ */ s(S, {})
123
123
  }),
124
124
  /* @__PURE__ */ s(i, {
125
125
  path: "fleet/vehicles/:vehicleId/edit",
126
- element: /* @__PURE__ */ s(x, {})
126
+ element: /* @__PURE__ */ s(S, {})
127
127
  }),
128
128
  /* @__PURE__ */ s(i, {
129
129
  path: "fleet/drivers",
130
- element: /* @__PURE__ */ s(S, {})
130
+ element: /* @__PURE__ */ s(C, {})
131
131
  }),
132
132
  /* @__PURE__ */ s(i, {
133
133
  path: "fleet/drivers/new",
134
- element: /* @__PURE__ */ s(C, {})
134
+ element: /* @__PURE__ */ s(w, {})
135
135
  }),
136
136
  /* @__PURE__ */ s(i, {
137
137
  path: "fleet/drivers/:driverId",
138
- element: /* @__PURE__ */ s(C, {})
138
+ element: /* @__PURE__ */ s(w, {})
139
139
  }),
140
140
  /* @__PURE__ */ s(i, {
141
141
  path: "fleet/drivers/:driverId/edit",
142
- element: /* @__PURE__ */ s(C, {})
142
+ element: /* @__PURE__ */ s(w, {})
143
143
  }),
144
144
  /* @__PURE__ */ s(i, {
145
145
  path: "inventory",
146
- element: /* @__PURE__ */ s(w, {})
146
+ element: /* @__PURE__ */ s(T, {})
147
147
  }),
148
148
  /* @__PURE__ */ s(i, {
149
149
  path: "inventory/source-assessments",
150
- element: /* @__PURE__ */ s(X, {})
150
+ element: /* @__PURE__ */ s(Z, {})
151
151
  }),
152
152
  /* @__PURE__ */ s(i, {
153
153
  path: "inventory/reported-issues",
154
- element: /* @__PURE__ */ s(Y, {})
154
+ element: /* @__PURE__ */ s(X, {})
155
155
  }),
156
156
  /* @__PURE__ */ s(i, {
157
157
  path: "inventory/pending-picks",
158
- element: /* @__PURE__ */ s(J, {})
158
+ element: /* @__PURE__ */ s(Y, {})
159
159
  }),
160
160
  /* @__PURE__ */ s(i, {
161
161
  path: "inventory/products",
162
- element: /* @__PURE__ */ s(T, {})
162
+ element: /* @__PURE__ */ s(E, {})
163
163
  }),
164
164
  /* @__PURE__ */ s(i, {
165
165
  path: "inventory/products/new",
166
- element: /* @__PURE__ */ s(E, {})
166
+ element: /* @__PURE__ */ s(D, {})
167
167
  }),
168
168
  /* @__PURE__ */ s(i, {
169
169
  path: "inventory/products/:productId",
170
- element: /* @__PURE__ */ s(E, {})
170
+ element: /* @__PURE__ */ s(D, {})
171
171
  }),
172
172
  /* @__PURE__ */ s(i, {
173
173
  path: "inventory/products/:productId/edit",
174
- element: /* @__PURE__ */ s(E, {})
174
+ element: /* @__PURE__ */ s(D, {})
175
175
  }),
176
176
  /* @__PURE__ */ s(i, {
177
177
  path: "inventory/warehouses",
178
- element: /* @__PURE__ */ s(O, {})
178
+ element: /* @__PURE__ */ s(k, {})
179
179
  }),
180
180
  /* @__PURE__ */ s(i, {
181
181
  path: "inventory/warehouses/pallet-preview",
182
- element: /* @__PURE__ */ s(D, {})
182
+ element: /* @__PURE__ */ s(O, {})
183
183
  }),
184
184
  /* @__PURE__ */ s(i, {
185
185
  path: "inventory/warehouses/new",
186
- element: /* @__PURE__ */ s(k, {})
186
+ element: /* @__PURE__ */ s(A, {})
187
187
  }),
188
188
  /* @__PURE__ */ s(i, {
189
189
  path: "inventory/warehouses/:warehouseId",
190
- element: /* @__PURE__ */ s(k, {})
190
+ element: /* @__PURE__ */ s(A, {})
191
191
  }),
192
192
  /* @__PURE__ */ s(i, {
193
193
  path: "inventory/warehouses/:warehouseId/edit",
194
- element: /* @__PURE__ */ s(k, {})
194
+ element: /* @__PURE__ */ s(A, {})
195
195
  }),
196
196
  /* @__PURE__ */ s(i, {
197
197
  path: "customers",
198
- element: /* @__PURE__ */ s(A, {})
198
+ element: /* @__PURE__ */ s(j, {})
199
199
  }),
200
200
  /* @__PURE__ */ s(i, {
201
201
  path: "customers/new",
202
- element: /* @__PURE__ */ s(j, {})
202
+ element: /* @__PURE__ */ s(M, {})
203
203
  }),
204
204
  /* @__PURE__ */ s(i, {
205
205
  path: "customers/:customerId",
206
- element: /* @__PURE__ */ s(j, {})
206
+ element: /* @__PURE__ */ s(M, {})
207
207
  }),
208
208
  /* @__PURE__ */ s(i, {
209
209
  path: "marketplace",
210
- element: /* @__PURE__ */ s(M, {})
210
+ element: /* @__PURE__ */ s(N, {})
211
+ }),
212
+ /* @__PURE__ */ s(i, {
213
+ path: "import-export",
214
+ element: /* @__PURE__ */ s(P, {})
211
215
  }),
212
216
  /* @__PURE__ */ s(i, {
213
217
  path: "routes",
214
- element: /* @__PURE__ */ s(N, {})
218
+ element: /* @__PURE__ */ s(ee, {})
215
219
  }),
216
220
  /* @__PURE__ */ s(i, {
217
221
  path: "routes/trip-utilization",
218
- element: /* @__PURE__ */ s(Z, {})
222
+ element: /* @__PURE__ */ s(Q, {})
219
223
  }),
220
224
  /* @__PURE__ */ s(i, {
221
225
  path: "fuel-preview",
222
- element: /* @__PURE__ */ s(Q, {})
226
+ element: /* @__PURE__ */ s($, {})
223
227
  }),
224
228
  /* @__PURE__ */ s(i, {
225
229
  path: "routes/new",
226
- element: /* @__PURE__ */ s(P, {})
230
+ element: /* @__PURE__ */ s(F, {})
227
231
  }),
228
232
  /* @__PURE__ */ s(i, {
229
233
  path: "routes/:routeId",
230
- element: /* @__PURE__ */ s(P, {})
234
+ element: /* @__PURE__ */ s(F, {})
231
235
  }),
232
236
  /* @__PURE__ */ s(i, {
233
237
  path: "routes/:routeId/edit",
234
- element: /* @__PURE__ */ s(P, {})
238
+ element: /* @__PURE__ */ s(F, {})
235
239
  }),
236
240
  /* @__PURE__ */ s(i, {
237
241
  path: "analytics",
238
- element: /* @__PURE__ */ s(F, {})
242
+ element: /* @__PURE__ */ s(I, {})
239
243
  }),
240
244
  /* @__PURE__ */ s(i, {
241
245
  path: "finance",
242
- element: /* @__PURE__ */ s(I, {})
246
+ element: /* @__PURE__ */ s(L, {})
243
247
  }),
244
248
  /* @__PURE__ */ s(i, {
245
249
  path: "finance/freight-estimates",
246
- element: /* @__PURE__ */ s(L, {})
250
+ element: /* @__PURE__ */ s(R, {})
247
251
  }),
248
252
  /* @__PURE__ */ s(i, {
249
253
  path: "finance/freight-invoice-comparisons",
250
- element: /* @__PURE__ */ s(R, {})
254
+ element: /* @__PURE__ */ s(z, {})
251
255
  }),
252
256
  /* @__PURE__ */ s(i, {
253
257
  path: "ai-assistant",
254
- element: /* @__PURE__ */ s(V, {})
258
+ element: /* @__PURE__ */ s(H, {})
255
259
  }),
256
260
  /* @__PURE__ */ s(i, {
257
261
  path: "*",
@@ -261,4 +265,4 @@ function te() {
261
265
  });
262
266
  }
263
267
  //#endregion
264
- export { te as MoveTheWheelsRoutes };
268
+ export { ne as MoveTheWheelsRoutes };
@@ -2034,6 +2034,63 @@ export type MtwFuelVolumeObservationInput = {
2034
2034
  sourceReference?: InputMaybe<Scalars['String']['input']>;
2035
2035
  sourceRevision?: InputMaybe<Scalars['String']['input']>;
2036
2036
  };
2037
+ export type MtwImportColumn = {
2038
+ __typename?: 'MtwImportColumn';
2039
+ allowedValues?: Maybe<Array<Scalars['String']['output']>>;
2040
+ description: Scalars['String']['output'];
2041
+ max?: Maybe<Scalars['Float']['output']>;
2042
+ maxLength?: Maybe<Scalars['Int']['output']>;
2043
+ min?: Maybe<Scalars['Float']['output']>;
2044
+ name: Scalars['String']['output'];
2045
+ required: Scalars['Boolean']['output'];
2046
+ type: MtwImportColumnType;
2047
+ };
2048
+ export type MtwImportColumnType = 'BOOLEAN' | 'DATE' | 'EMAIL' | 'ENUM' | 'INTEGER' | 'JSON' | 'NUMBER' | 'STRING';
2049
+ export type MtwImportEntitySpec = {
2050
+ __typename?: 'MtwImportEntitySpec';
2051
+ columns: Array<MtwImportColumn>;
2052
+ entityType: MtwImportEntityType;
2053
+ /** Column that must be unique in the workspace, if any. */
2054
+ keyColumn?: Maybe<Scalars['String']['output']>;
2055
+ };
2056
+ export type MtwImportEntityType = 'CARGO_ITEM' | 'CUSTOMER' | 'DRIVER' | 'VEHICLE' | 'WAREHOUSE';
2057
+ export type MtwImportFormat = 'CSV' | 'JSON';
2058
+ export type MtwImportInput = {
2059
+ /** Import the valid rows even when other rows are invalid. */
2060
+ allowPartial?: InputMaybe<Scalars['Boolean']['input']>;
2061
+ /** The CSV (with a header row) or JSON (array of objects) document, at most 2 MB and 1000 rows. */
2062
+ content: Scalars['String']['input'];
2063
+ /** Validate every row without writing anything. */
2064
+ dryRun?: InputMaybe<Scalars['Boolean']['input']>;
2065
+ format: MtwImportFormat;
2066
+ };
2067
+ export type MtwImportResult = {
2068
+ __typename?: 'MtwImportResult';
2069
+ createdIds: Array<Scalars['ID']['output']>;
2070
+ dryRun: Scalars['Boolean']['output'];
2071
+ entityType: MtwImportEntityType;
2072
+ errors: Array<MtwImportRowError>;
2073
+ /** True when more row errors exist than are returned (the first 500 are returned). */
2074
+ errorsTruncated: Scalars['Boolean']['output'];
2075
+ failedRows: Scalars['Int']['output'];
2076
+ importedRows: Scalars['Int']['output'];
2077
+ status: MtwImportStatus;
2078
+ totalRows: Scalars['Int']['output'];
2079
+ validRows: Scalars['Int']['output'];
2080
+ };
2081
+ export type MtwImportRowError = {
2082
+ __typename?: 'MtwImportRowError';
2083
+ field?: Maybe<Scalars['String']['output']>;
2084
+ message: Scalars['String']['output'];
2085
+ /** 1-based data row number (the CSV header is not counted). */
2086
+ row: Scalars['Int']['output'];
2087
+ };
2088
+ /**
2089
+ * DRY_RUN: validated only, nothing written. COMPLETED: every row imported.
2090
+ * PARTIAL: allowPartial was set and some rows failed. REJECTED: some rows were
2091
+ * invalid and allowPartial was not set, so nothing was written.
2092
+ */
2093
+ export type MtwImportStatus = 'COMPLETED' | 'DRY_RUN' | 'PARTIAL' | 'REJECTED';
2037
2094
  /** A recorded manual issuer review; workspace privileges do not establish professional qualifications. */
2038
2095
  export type MtwInspectorQualification = {
2039
2096
  __typename?: 'MtwInspectorQualification';
@@ -3744,6 +3801,11 @@ export type Mutation = {
3744
3801
  deleteWarehouse: Scalars['Boolean']['output'];
3745
3802
  exportMtwEntities: MtwExportJob;
3746
3803
  holdMtwContainer: MtwContainerHold;
3804
+ importMtwCargoItems: MtwImportResult;
3805
+ importMtwCustomers: MtwImportResult;
3806
+ importMtwDrivers: MtwImportResult;
3807
+ importMtwVehicles: MtwImportResult;
3808
+ importMtwWarehouses: MtwImportResult;
3747
3809
  openMtwContainerCycle: MtwContainerCycle;
3748
3810
  openMtwFreeTimeClock: MtwFreeTimeClock;
3749
3811
  optimizeRoute: MtwRoute;
@@ -3928,6 +3990,21 @@ export type MutationExportMtwEntitiesArgs = {
3928
3990
  export type MutationHoldMtwContainerArgs = {
3929
3991
  input: HoldMtwContainerInput;
3930
3992
  };
3993
+ export type MutationImportMtwCargoItemsArgs = {
3994
+ input: MtwImportInput;
3995
+ };
3996
+ export type MutationImportMtwCustomersArgs = {
3997
+ input: MtwImportInput;
3998
+ };
3999
+ export type MutationImportMtwDriversArgs = {
4000
+ input: MtwImportInput;
4001
+ };
4002
+ export type MutationImportMtwVehiclesArgs = {
4003
+ input: MtwImportInput;
4004
+ };
4005
+ export type MutationImportMtwWarehousesArgs = {
4006
+ input: MtwImportInput;
4007
+ };
3931
4008
  export type MutationOpenMtwContainerCycleArgs = {
3932
4009
  input: OpenMtwContainerCycleInput;
3933
4010
  };
@@ -4268,6 +4345,13 @@ export type Query = {
4268
4345
  /** Null is not proof of no effect and never authorizes resubmission. Exact original actor/context only. */
4269
4346
  mtwFreightInvoiceComparisonByRequestKey?: Maybe<MtwFreightInvoiceComparison>;
4270
4347
  mtwFreightInvoiceComparisonPage: MtwFreightInvoiceComparisonPage;
4348
+ /**
4349
+ * Columns accepted by each import, for building templates and showing guidance.
4350
+ * This is static reference metadata with no workspace data in it, so it only
4351
+ * needs an authenticated caller; every import mutation enforces its own
4352
+ * entity create permission.
4353
+ */
4354
+ mtwImportSpec: Array<MtwImportEntitySpec>;
4271
4355
  mtwPalletGeometryPreview: MtwPalletGeometryPreview;
4272
4356
  mtwPickPreparation: MtwPickPreparation;
4273
4357
  mtwPickReview: MtwPickReview;
@@ -0,0 +1,68 @@
1
+ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
+ import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
+ import { MTW_IMPORT_SPEC_QUERY as n, importEntity as r, importMutation as i } from "../utils/entityImport.js";
4
+ import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
5
+ //#region src/movethewheels/hooks/useEntityImport.ts
6
+ function l() {
7
+ let { apiGatewayUrl: t, authToken: n, workspaceToken: r, workspaceId: i, tenantId: a, currentUser: o } = e();
8
+ return s(() => ({
9
+ apiGatewayUrl: t,
10
+ authToken: n,
11
+ workspaceToken: r,
12
+ workspaceId: i,
13
+ tenantId: a,
14
+ actorId: o?.id
15
+ }), [
16
+ t,
17
+ n,
18
+ r,
19
+ i,
20
+ a,
21
+ o?.id
22
+ ]);
23
+ }
24
+ function u() {
25
+ let e = l(), [r, i] = c([]), [a, s] = c(!0), [u, d] = c(null);
26
+ return o(() => {
27
+ if (!e.workspaceId) return;
28
+ let r = !1;
29
+ return s(!0), t(e, n).then((e) => {
30
+ r || (i(e.mtwImportSpec), d(null));
31
+ }).catch((e) => {
32
+ r || d(e instanceof Error ? e : /* @__PURE__ */ Error("Could not load import columns"));
33
+ }).finally(() => {
34
+ r || s(!1);
35
+ }), () => {
36
+ r = !0;
37
+ };
38
+ }, [e]), {
39
+ specs: r,
40
+ isLoading: a,
41
+ error: u
42
+ };
43
+ }
44
+ function d() {
45
+ let e = l(), [n, o] = c(!1);
46
+ return {
47
+ run: a(async (n) => {
48
+ if (new Blob([n.content]).size > 2097152) throw Error("The file is larger than 2 MB. Split it into smaller files.");
49
+ let { field: a } = r(n.entityType);
50
+ o(!0);
51
+ try {
52
+ let r = (await t(e, i(n.entityType), { input: {
53
+ format: n.format,
54
+ content: n.content,
55
+ dryRun: n.dryRun,
56
+ allowPartial: n.allowPartial
57
+ } }, n.dryRun ? "RETRY_TRANSIENT" : "SINGLE_ATTEMPT"))[a];
58
+ if (!r) throw Error("The import returned no result");
59
+ return r;
60
+ } finally {
61
+ o(!1);
62
+ }
63
+ }, [e]),
64
+ isRunning: n
65
+ };
66
+ }
67
+ //#endregion
68
+ export { d as useEntityImport, u as useImportSpec };
@@ -0,0 +1,19 @@
1
+ import { MtwImportEntitySpec, MtwImportEntityType, MtwImportFormat, MtwImportResult } from '../utils/entityImport';
2
+ /** Column specification for every importable entity. */
3
+ export declare function useImportSpec(): {
4
+ specs: MtwImportEntitySpec[];
5
+ isLoading: boolean;
6
+ error: Error | null;
7
+ };
8
+ export interface ImportRequest {
9
+ entityType: MtwImportEntityType;
10
+ format: MtwImportFormat;
11
+ content: string;
12
+ dryRun: boolean;
13
+ allowPartial: boolean;
14
+ }
15
+ /** Runs a validation or an import. Writes are sent once: a retry could create rows twice. */
16
+ export declare function useEntityImport(): {
17
+ run: (request: ImportRequest) => Promise<MtwImportResult>;
18
+ isRunning: boolean;
19
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Import / Export Page (BOFF-3990)
3
+ *
4
+ * Bulk data in and out of MoveTheWheels. Import validates a CSV or JSON file
5
+ * row by row on the server (dry run first, then import) for customers,
6
+ * vehicles, drivers, warehouses and products. Export starts the same
7
+ * `exportMtwEntities` job the list pages use and downloads the archive.
8
+ */
9
+ export default function ImportExportPage(): import('react').JSX.Element;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Entity import — client side of wspace-movethewheels-svc's bulk import (BOFF-3990).
3
+ *
4
+ * The service owns parsing and validation; this module only picks the right
5
+ * mutation for an entity, detects the file format, builds CSV templates from
6
+ * the server's column specification and shapes the result for display.
7
+ * Kept free of React so the contract can be unit-tested.
8
+ */
9
+ export declare const MTW_IMPORT_ENTITIES: readonly [{
10
+ readonly entityType: "CUSTOMER";
11
+ readonly label: "Customers";
12
+ readonly noun: "customer";
13
+ readonly field: "importMtwCustomers";
14
+ }, {
15
+ readonly entityType: "VEHICLE";
16
+ readonly label: "Vehicles";
17
+ readonly noun: "vehicle";
18
+ readonly field: "importMtwVehicles";
19
+ }, {
20
+ readonly entityType: "DRIVER";
21
+ readonly label: "Drivers";
22
+ readonly noun: "driver";
23
+ readonly field: "importMtwDrivers";
24
+ }, {
25
+ readonly entityType: "WAREHOUSE";
26
+ readonly label: "Warehouses";
27
+ readonly noun: "warehouse";
28
+ readonly field: "importMtwWarehouses";
29
+ }, {
30
+ readonly entityType: "CARGO_ITEM";
31
+ readonly label: "Products";
32
+ readonly noun: "product";
33
+ readonly field: "importMtwCargoItems";
34
+ }];
35
+ export type MtwImportEntityType = (typeof MTW_IMPORT_ENTITIES)[number]['entityType'];
36
+ export type MtwImportFormat = 'CSV' | 'JSON';
37
+ export type MtwImportStatus = 'DRY_RUN' | 'COMPLETED' | 'PARTIAL' | 'REJECTED';
38
+ /** Mirrors the service limits so an oversized file is refused before upload. */
39
+ export declare const MTW_IMPORT_MAX_BYTES: number;
40
+ export declare const MTW_IMPORT_MAX_ROWS = 1000;
41
+ export declare function isImportEntityType(value: string | null | undefined): value is MtwImportEntityType;
42
+ export declare function importEntity(entityType: MtwImportEntityType): {
43
+ readonly entityType: "CUSTOMER";
44
+ readonly label: "Customers";
45
+ readonly noun: "customer";
46
+ readonly field: "importMtwCustomers";
47
+ } | {
48
+ readonly entityType: "VEHICLE";
49
+ readonly label: "Vehicles";
50
+ readonly noun: "vehicle";
51
+ readonly field: "importMtwVehicles";
52
+ } | {
53
+ readonly entityType: "DRIVER";
54
+ readonly label: "Drivers";
55
+ readonly noun: "driver";
56
+ readonly field: "importMtwDrivers";
57
+ } | {
58
+ readonly entityType: "WAREHOUSE";
59
+ readonly label: "Warehouses";
60
+ readonly noun: "warehouse";
61
+ readonly field: "importMtwWarehouses";
62
+ } | {
63
+ readonly entityType: "CARGO_ITEM";
64
+ readonly label: "Products";
65
+ readonly noun: "product";
66
+ readonly field: "importMtwCargoItems";
67
+ };
68
+ export declare const IMPORT_MUTATIONS: Record<MtwImportEntityType, string>;
69
+ /** The mutation document for one entity's import. */
70
+ export declare function importMutation(entityType: MtwImportEntityType): string;
71
+ export declare const MTW_IMPORT_SPEC_QUERY = "\n query MtwImportSpec {\n mtwImportSpec {\n entityType\n keyColumn\n columns {\n name\n type\n required\n description\n allowedValues\n maxLength\n min\n max\n }\n }\n }\n";
72
+ export interface MtwImportColumn {
73
+ name: string;
74
+ type: string;
75
+ required: boolean;
76
+ description: string;
77
+ allowedValues: string[] | null;
78
+ maxLength: number | null;
79
+ min: number | null;
80
+ max: number | null;
81
+ }
82
+ export interface MtwImportEntitySpec {
83
+ entityType: MtwImportEntityType;
84
+ keyColumn: string | null;
85
+ columns: MtwImportColumn[];
86
+ }
87
+ export interface MtwImportRowError {
88
+ row: number;
89
+ field: string | null;
90
+ message: string;
91
+ }
92
+ export interface MtwImportResult {
93
+ entityType: MtwImportEntityType;
94
+ status: MtwImportStatus;
95
+ dryRun: boolean;
96
+ totalRows: number;
97
+ validRows: number;
98
+ importedRows: number;
99
+ failedRows: number;
100
+ createdIds: string[];
101
+ errorsTruncated: boolean;
102
+ errors: MtwImportRowError[];
103
+ }
104
+ /** Picks the format from the file name, falling back to the MIME type. */
105
+ export declare function detectImportFormat(fileName: string, mimeType?: string): MtwImportFormat | null;
106
+ /** A CSV template: the header row, required columns first, then optional ones. */
107
+ export declare function buildCsvTemplate(spec: MtwImportEntitySpec): string;
108
+ /** One-line summary of an import result for the status banner. */
109
+ export declare function summariseImport(result: MtwImportResult, noun: string): string;
@@ -0,0 +1,22 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/arrow-down-up.js
3
+ var t = e("ArrowDownUp", [
4
+ ["path", {
5
+ d: "m3 16 4 4 4-4",
6
+ key: "1co6wj"
7
+ }],
8
+ ["path", {
9
+ d: "M7 20V4",
10
+ key: "1yoxec"
11
+ }],
12
+ ["path", {
13
+ d: "m21 8-4-4-4 4",
14
+ key: "1c9v7m"
15
+ }],
16
+ ["path", {
17
+ d: "M17 4v16",
18
+ key: "7dpous"
19
+ }]
20
+ ]);
21
+ //#endregion
22
+ export { t as ArrowDownUp };