@burdenoff/microfe-movethewheels 2026.722.1 → 2026.726.1
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/hooks/useEntityDocuments.js +4 -4
- package/dist/hooks/useOrders.js +119 -100
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +17 -1
- package/dist/movethewheels/types/index.d.ts +1 -3
- package/dist/pages/CreateOrderPage.js +53 -79
- package/dist/pages/OrderDetailsPage.js +19 -20
- package/dist/pages/OrdersListPage.js +82 -113
- package/package.json +4 -3
- package/src/movethewheels/hooks/useEntityDocuments.ts +30 -12
- package/src/movethewheels/hooks/useOrders.ts +83 -208
- package/src/movethewheels/pages/CreateOrderPage.tsx +1 -19
- package/src/movethewheels/pages/OrderDetailsPage.tsx +1 -7
- package/src/movethewheels/pages/OrdersListPage.tsx +3 -31
- package/src/movethewheels/types/index.ts +1 -3
|
@@ -2,7 +2,7 @@ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
|
2
2
|
import { executeGraphQL as t } from "../utils/graphqlClient.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
4
|
//#region src/movethewheels/hooks/useEntityDocuments.ts
|
|
5
|
-
var o = "\n query ListEntityDocuments($filter: FileFilterInput, $pagination: PaginationInput) {\n
|
|
5
|
+
var o = "\n query ListEntityDocuments($filter: FileFilterInput, $pagination: PaginationInput) {\n getFiles(filter: $filter, pagination: $pagination) {\n files {\n id\n name\n size\n mimeType\n createdAt\n downloadUrl\n }\n }\n }\n";
|
|
6
6
|
function s(e) {
|
|
7
7
|
return {
|
|
8
8
|
id: e.id,
|
|
@@ -38,16 +38,16 @@ function c(c, l) {
|
|
|
38
38
|
_(((await t(S, o, {
|
|
39
39
|
filter: { tags: [{
|
|
40
40
|
key: "mtwEntityType",
|
|
41
|
-
|
|
41
|
+
label: c
|
|
42
42
|
}, {
|
|
43
43
|
key: "mtwEntityId",
|
|
44
|
-
|
|
44
|
+
label: l
|
|
45
45
|
}] },
|
|
46
46
|
pagination: {
|
|
47
47
|
limit: 50,
|
|
48
48
|
offset: 0
|
|
49
49
|
}
|
|
50
|
-
})).files ?? []).map(s));
|
|
50
|
+
})).getFiles?.files ?? []).map(s));
|
|
51
51
|
} catch (e) {
|
|
52
52
|
x(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load documents")), _([]);
|
|
53
53
|
} finally {
|
package/dist/hooks/useOrders.js
CHANGED
|
@@ -2,8 +2,38 @@ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
|
2
2
|
import { executeGraphQL as t } from "../utils/graphqlClient.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
4
|
//#region src/movethewheels/hooks/useOrders.ts
|
|
5
|
-
var o = "\n
|
|
6
|
-
|
|
5
|
+
var o = "\n id\n deliveryJobNumber\n customerId\n status\n priority\n pickupAddress\n deliveryAddress\n cargoItems\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n", s = `
|
|
6
|
+
query ListDeliveryJobs($filter: DeliveryJobFilterInput, $pagination: PaginationInput) {
|
|
7
|
+
deliveryJobs(filter: $filter, pagination: $pagination) {
|
|
8
|
+
${o}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`, c = `
|
|
12
|
+
query GetDeliveryJob($id: ID!) {
|
|
13
|
+
deliveryJob(id: $id) {
|
|
14
|
+
${o}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`, l = "\n query GetDeliveryJobStatsBundle {\n deliveryJobStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", u = `
|
|
18
|
+
mutation CreateDeliveryJob($input: CreateDeliveryJobInput!) {
|
|
19
|
+
createDeliveryJob(input: $input) {
|
|
20
|
+
${o}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`, d = `
|
|
24
|
+
mutation UpdateDeliveryJob($id: ID!, $input: UpdateDeliveryJobInput!) {
|
|
25
|
+
updateDeliveryJob(id: $id, input: $input) {
|
|
26
|
+
${o}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`, f = `
|
|
30
|
+
mutation UpdateDeliveryJobStatus($id: ID!, $input: UpdateDeliveryJobStatusInput!) {
|
|
31
|
+
updateDeliveryJobStatus(id: $id, input: $input) {
|
|
32
|
+
${o}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`, p = "\n mutation DeleteDeliveryJob($id: ID!) {\n deleteDeliveryJob(id: $id)\n }\n";
|
|
36
|
+
function m(e) {
|
|
7
37
|
switch (e) {
|
|
8
38
|
case "PENDING": return "pending";
|
|
9
39
|
case "CONFIRMED": return "confirmed";
|
|
@@ -16,9 +46,6 @@ function p(e) {
|
|
|
16
46
|
default: return "failed";
|
|
17
47
|
}
|
|
18
48
|
}
|
|
19
|
-
function m(e) {
|
|
20
|
-
return e === "B2B" ? "b2b" : "b2c";
|
|
21
|
-
}
|
|
22
49
|
function h(e) {
|
|
23
50
|
switch (e) {
|
|
24
51
|
case "LOW": return "low";
|
|
@@ -42,9 +69,6 @@ function g(e) {
|
|
|
42
69
|
}
|
|
43
70
|
}
|
|
44
71
|
function _(e) {
|
|
45
|
-
return e === "b2b" ? "B2B" : "B2C";
|
|
46
|
-
}
|
|
47
|
-
function v(e) {
|
|
48
72
|
switch (e) {
|
|
49
73
|
case "low": return "LOW";
|
|
50
74
|
case "high": return "HIGH";
|
|
@@ -52,7 +76,7 @@ function v(e) {
|
|
|
52
76
|
default: return "MEDIUM";
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
|
-
function
|
|
79
|
+
function v(e) {
|
|
56
80
|
return {
|
|
57
81
|
street: "",
|
|
58
82
|
city: "",
|
|
@@ -62,10 +86,10 @@ function y(e) {
|
|
|
62
86
|
...e ?? {}
|
|
63
87
|
};
|
|
64
88
|
}
|
|
65
|
-
function
|
|
89
|
+
function y(e) {
|
|
66
90
|
return {
|
|
67
91
|
id: e.id,
|
|
68
|
-
orderNumber: e.
|
|
92
|
+
orderNumber: e.deliveryJobNumber,
|
|
69
93
|
customerId: e.customerId,
|
|
70
94
|
customerInfo: {
|
|
71
95
|
name: e.customer?.name ?? "Unknown Customer",
|
|
@@ -73,12 +97,11 @@ function b(e) {
|
|
|
73
97
|
phone: e.customer?.phone ?? "",
|
|
74
98
|
company: e.customer?.company ?? void 0
|
|
75
99
|
},
|
|
76
|
-
items: Array.isArray(e.
|
|
77
|
-
status:
|
|
78
|
-
orderType: m(e.orderType),
|
|
100
|
+
items: Array.isArray(e.cargoItems) ? e.cargoItems : [],
|
|
101
|
+
status: m(e.status),
|
|
79
102
|
priority: h(e.priority),
|
|
80
|
-
pickupAddress:
|
|
81
|
-
deliveryAddress:
|
|
103
|
+
pickupAddress: v(e.pickupAddress),
|
|
104
|
+
deliveryAddress: v(e.deliveryAddress),
|
|
82
105
|
trackingNumber: e.trackingNumber ?? "",
|
|
83
106
|
specialInstructions: e.specialInstructions ?? void 0,
|
|
84
107
|
pricing: {
|
|
@@ -96,7 +119,7 @@ function b(e) {
|
|
|
96
119
|
},
|
|
97
120
|
timeline: e.statusHistory?.map((e) => ({
|
|
98
121
|
timestamp: new Date(e.createdAt),
|
|
99
|
-
status:
|
|
122
|
+
status: m(e.status),
|
|
100
123
|
location: e.location,
|
|
101
124
|
notes: e.notes ?? void 0,
|
|
102
125
|
performedBy: e.createdBy ?? "system"
|
|
@@ -108,92 +131,88 @@ function b(e) {
|
|
|
108
131
|
updatedAt: new Date(e.updatedAt)
|
|
109
132
|
};
|
|
110
133
|
}
|
|
111
|
-
function
|
|
112
|
-
let { filters: c, limit:
|
|
134
|
+
function b(o = {}) {
|
|
135
|
+
let { filters: c, limit: l = 20, offset: m = 0 } = o, h = i(() => c, [
|
|
113
136
|
c?.status,
|
|
114
137
|
c?.priority,
|
|
115
|
-
c?.orderType,
|
|
116
138
|
c?.customerId,
|
|
117
139
|
c?.driverId,
|
|
118
140
|
c?.unassigned
|
|
119
|
-
]), { apiGatewayUrl:
|
|
120
|
-
apiGatewayUrl:
|
|
121
|
-
authToken:
|
|
122
|
-
workspaceToken:
|
|
123
|
-
workspaceId:
|
|
124
|
-
tenantId:
|
|
125
|
-
actorId:
|
|
141
|
+
]), { apiGatewayUrl: v, authToken: b, workspaceToken: x, workspaceId: S, tenantId: C, currentUser: w } = e(), [T, E] = a([]), [D, O] = a(!1), [k, A] = a(!1), [j, M] = a(null), N = i(() => ({
|
|
142
|
+
apiGatewayUrl: v,
|
|
143
|
+
authToken: b,
|
|
144
|
+
workspaceToken: x,
|
|
145
|
+
workspaceId: S,
|
|
146
|
+
tenantId: C,
|
|
147
|
+
actorId: w?.id
|
|
126
148
|
}), [
|
|
127
|
-
|
|
149
|
+
v,
|
|
150
|
+
b,
|
|
128
151
|
x,
|
|
129
152
|
S,
|
|
130
153
|
C,
|
|
131
|
-
w
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
j(!0), N(null);
|
|
154
|
+
w?.id
|
|
155
|
+
]), P = n(async () => {
|
|
156
|
+
A(!0), M(null);
|
|
135
157
|
try {
|
|
136
|
-
let e = (await t(
|
|
158
|
+
let e = (await t(N, s, {
|
|
137
159
|
filter: {
|
|
138
160
|
status: h?.status ? g(h.status) : void 0,
|
|
139
|
-
priority: h?.priority ?
|
|
140
|
-
orderType: h?.orderType ? _(h.orderType) : void 0,
|
|
161
|
+
priority: h?.priority ? _(h.priority) : void 0,
|
|
141
162
|
customerId: h?.customerId,
|
|
142
163
|
driverId: h?.driverId
|
|
143
164
|
},
|
|
144
165
|
pagination: {
|
|
145
|
-
limit:
|
|
166
|
+
limit: l,
|
|
146
167
|
offset: m
|
|
147
168
|
}
|
|
148
|
-
})).
|
|
149
|
-
|
|
150
|
-
let n = e.map(
|
|
151
|
-
h?.unassigned && (n = n.filter((e) => !e.driverId)),
|
|
169
|
+
})).deliveryJobs;
|
|
170
|
+
O(e.length === l);
|
|
171
|
+
let n = e.map(y);
|
|
172
|
+
h?.unassigned && (n = n.filter((e) => !e.driverId)), E(n);
|
|
152
173
|
} catch (e) {
|
|
153
|
-
|
|
174
|
+
M(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load orders"));
|
|
154
175
|
} finally {
|
|
155
|
-
|
|
176
|
+
A(!1);
|
|
156
177
|
}
|
|
157
178
|
}, [
|
|
158
179
|
h,
|
|
159
|
-
|
|
160
|
-
|
|
180
|
+
N,
|
|
181
|
+
l,
|
|
161
182
|
m
|
|
162
183
|
]);
|
|
163
184
|
r(() => {
|
|
164
|
-
|
|
165
|
-
}, [
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
}, [
|
|
169
|
-
let n =
|
|
170
|
-
|
|
171
|
-
orderType: _(e.orderType),
|
|
185
|
+
P();
|
|
186
|
+
}, [P]);
|
|
187
|
+
let F = n(() => {
|
|
188
|
+
P();
|
|
189
|
+
}, [P]), I = n(async (e) => {
|
|
190
|
+
let n = y((await t(N, u, { input: {
|
|
191
|
+
deliveryJobNumber: e.orderNumber ?? `ORD-${(/* @__PURE__ */ new Date()).getFullYear()}-${Date.now().toString().slice(-6)}`,
|
|
172
192
|
status: g(e.status ?? "pending"),
|
|
173
|
-
priority:
|
|
193
|
+
priority: _(e.priority),
|
|
174
194
|
customerId: e.customerId,
|
|
175
195
|
pickupAddress: e.pickupAddress ?? {},
|
|
176
196
|
deliveryAddress: e.deliveryAddress ?? {},
|
|
177
|
-
|
|
197
|
+
cargoItems: e.items ?? [],
|
|
178
198
|
pricing: e.pricing ?? null,
|
|
179
199
|
specialInstructions: e.specialInstructions,
|
|
180
200
|
trackingNumber: e.trackingNumber,
|
|
181
201
|
scheduledDelivery: e.scheduledDelivery?.toISOString(),
|
|
182
202
|
vehicleId: e.vehicleId,
|
|
183
203
|
driverId: e.driverId
|
|
184
|
-
} })).
|
|
185
|
-
return
|
|
186
|
-
}, [
|
|
187
|
-
let r =
|
|
204
|
+
} })).createDeliveryJob);
|
|
205
|
+
return E((e) => [n, ...e]), n;
|
|
206
|
+
}, [N]), L = n(async (e, n) => {
|
|
207
|
+
let r = y((await t(N, d, {
|
|
188
208
|
id: e,
|
|
189
209
|
input: {
|
|
190
|
-
orderType: n.orderType ? _(n.orderType) : void 0,
|
|
191
210
|
status: n.status ? g(n.status) : void 0,
|
|
192
|
-
priority: n.priority ?
|
|
211
|
+
priority: n.priority ? _(n.priority) : void 0,
|
|
193
212
|
customerId: n.customerId,
|
|
194
213
|
pickupAddress: n.pickupAddress,
|
|
195
214
|
deliveryAddress: n.deliveryAddress,
|
|
196
|
-
|
|
215
|
+
cargoItems: n.items,
|
|
197
216
|
pricing: n.pricing,
|
|
198
217
|
specialInstructions: n.specialInstructions,
|
|
199
218
|
trackingNumber: n.trackingNumber,
|
|
@@ -201,40 +220,40 @@ function x(s = {}) {
|
|
|
201
220
|
vehicleId: n.vehicleId,
|
|
202
221
|
driverId: n.driverId
|
|
203
222
|
}
|
|
204
|
-
})).
|
|
205
|
-
return
|
|
206
|
-
}, [
|
|
207
|
-
await t(
|
|
208
|
-
}, [
|
|
209
|
-
let r =
|
|
223
|
+
})).updateDeliveryJob);
|
|
224
|
+
return E((t) => t.map((t) => t.id === e ? r : t)), r;
|
|
225
|
+
}, [N]), R = n(async (e) => {
|
|
226
|
+
await t(N, p, { id: e }), E((t) => t.filter((t) => t.id !== e));
|
|
227
|
+
}, [N]), z = n(async (e, n) => {
|
|
228
|
+
let r = y((await t(N, f, {
|
|
210
229
|
id: e,
|
|
211
230
|
input: { status: g(n) }
|
|
212
|
-
})).
|
|
213
|
-
return
|
|
214
|
-
}, [
|
|
231
|
+
})).updateDeliveryJobStatus);
|
|
232
|
+
return E((t) => t.map((t) => t.id === e ? r : t)), r;
|
|
233
|
+
}, [N]);
|
|
215
234
|
return {
|
|
216
|
-
orders:
|
|
217
|
-
totalOrders:
|
|
218
|
-
hasMore:
|
|
219
|
-
isLoading:
|
|
220
|
-
error:
|
|
221
|
-
refetch:
|
|
222
|
-
createOrder:
|
|
223
|
-
updateOrder:
|
|
224
|
-
deleteOrder:
|
|
225
|
-
updateOrderStatus:
|
|
235
|
+
orders: T,
|
|
236
|
+
totalOrders: T.length,
|
|
237
|
+
hasMore: D,
|
|
238
|
+
isLoading: k,
|
|
239
|
+
error: j,
|
|
240
|
+
refetch: F,
|
|
241
|
+
createOrder: I,
|
|
242
|
+
updateOrder: L,
|
|
243
|
+
deleteOrder: R,
|
|
244
|
+
updateOrderStatus: z
|
|
226
245
|
};
|
|
227
246
|
}
|
|
228
|
-
function
|
|
229
|
-
let { apiGatewayUrl:
|
|
230
|
-
apiGatewayUrl:
|
|
247
|
+
function x(o) {
|
|
248
|
+
let { apiGatewayUrl: s, authToken: l, workspaceToken: u, workspaceId: d, tenantId: f, currentUser: p } = e(), [m, h] = a(null), [g, _] = a(!1), [v, b] = a(null), x = i(() => ({
|
|
249
|
+
apiGatewayUrl: s,
|
|
231
250
|
authToken: l,
|
|
232
251
|
workspaceToken: u,
|
|
233
252
|
workspaceId: d,
|
|
234
253
|
tenantId: f,
|
|
235
254
|
actorId: p?.id
|
|
236
255
|
}), [
|
|
237
|
-
|
|
256
|
+
s,
|
|
238
257
|
l,
|
|
239
258
|
u,
|
|
240
259
|
d,
|
|
@@ -245,12 +264,12 @@ function S(o) {
|
|
|
245
264
|
h(null);
|
|
246
265
|
return;
|
|
247
266
|
}
|
|
248
|
-
_(!0),
|
|
267
|
+
_(!0), b(null);
|
|
249
268
|
try {
|
|
250
|
-
let e = await t(x,
|
|
251
|
-
h(e.
|
|
269
|
+
let e = await t(x, c, { id: o });
|
|
270
|
+
h(e.deliveryJob ? y(e.deliveryJob) : null);
|
|
252
271
|
} catch (e) {
|
|
253
|
-
|
|
272
|
+
b(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order"));
|
|
254
273
|
} finally {
|
|
255
274
|
_(!1);
|
|
256
275
|
}
|
|
@@ -266,8 +285,8 @@ function S(o) {
|
|
|
266
285
|
}, [S])
|
|
267
286
|
};
|
|
268
287
|
}
|
|
269
|
-
function
|
|
270
|
-
let { apiGatewayUrl: o, authToken: s, workspaceToken:
|
|
288
|
+
function S() {
|
|
289
|
+
let { apiGatewayUrl: o, authToken: s, workspaceToken: c, workspaceId: u, tenantId: d, currentUser: f } = e(), [p, m] = a(!1), [h, g] = a(null), [_, v] = a({
|
|
271
290
|
total: 0,
|
|
272
291
|
byStatus: {
|
|
273
292
|
pending: 0,
|
|
@@ -286,33 +305,33 @@ function C() {
|
|
|
286
305
|
}), y = i(() => ({
|
|
287
306
|
apiGatewayUrl: o,
|
|
288
307
|
authToken: s,
|
|
289
|
-
workspaceToken:
|
|
308
|
+
workspaceToken: c,
|
|
290
309
|
workspaceId: u,
|
|
291
310
|
tenantId: d,
|
|
292
311
|
actorId: f?.id
|
|
293
312
|
}), [
|
|
294
313
|
o,
|
|
295
314
|
s,
|
|
296
|
-
|
|
315
|
+
c,
|
|
297
316
|
u,
|
|
298
317
|
d,
|
|
299
318
|
f?.id
|
|
300
319
|
]), b = n(async () => {
|
|
301
320
|
m(!0), g(null);
|
|
302
321
|
try {
|
|
303
|
-
let e = await t(y,
|
|
322
|
+
let e = await t(y, l);
|
|
304
323
|
v({
|
|
305
|
-
total: e.
|
|
324
|
+
total: e.deliveryJobStats.total,
|
|
306
325
|
byStatus: {
|
|
307
|
-
pending: e.
|
|
326
|
+
pending: e.deliveryJobStats.pending,
|
|
308
327
|
confirmed: 0,
|
|
309
328
|
assigned: 0,
|
|
310
329
|
picked_up: 0,
|
|
311
|
-
in_transit: e.
|
|
330
|
+
in_transit: e.deliveryJobStats.inTransit,
|
|
312
331
|
out_for_delivery: 0,
|
|
313
|
-
delivered: e.
|
|
314
|
-
cancelled: e.
|
|
315
|
-
failed: e.
|
|
332
|
+
delivered: e.deliveryJobStats.delivered,
|
|
333
|
+
cancelled: e.deliveryJobStats.cancelled,
|
|
334
|
+
failed: e.deliveryJobStats.failed
|
|
316
335
|
},
|
|
317
336
|
totalRevenue: e.financeMetrics.revenue.totalRevenue,
|
|
318
337
|
todayOrders: 0,
|
|
@@ -333,4 +352,4 @@ function C() {
|
|
|
333
352
|
};
|
|
334
353
|
}
|
|
335
354
|
//#endregion
|
|
336
|
-
export {
|
|
355
|
+
export { x as useOrder, S as useOrderStats, b as useOrders };
|
|
@@ -5,10 +5,26 @@
|
|
|
5
5
|
* driver or order live in the platform Files module (wspace-files-svc), which
|
|
6
6
|
* federates into the same workspace gateway. We tag each uploaded file with two
|
|
7
7
|
* marqueue entity tags — `mtwEntityType` and `mtwEntityId` — and list them back
|
|
8
|
-
* here through
|
|
8
|
+
* here through `getFiles(filter:{ tags:[...] })`.
|
|
9
9
|
*
|
|
10
10
|
* There is no upload UI here (out of scope): uploading/managing happens in the
|
|
11
11
|
* Files module, deep-linked from DocumentsCard. This hook is read-only.
|
|
12
|
+
*
|
|
13
|
+
* BOFF-3922 fix (2026-07-26): this previously called a non-existent root field
|
|
14
|
+
* `files(...)` — the wspace gateway only exposes `Workspace.files` (nested) and
|
|
15
|
+
* root fields `getFiles`/`searchFiles`/`ownedFiles`/`uploadedFiles`, none named
|
|
16
|
+
* bare `files`. Fixed to `getFiles(...): FileList!` (unwrapping `.files`), the
|
|
17
|
+
* root field whose `folderId` arg is optional so it supports a workspace-wide
|
|
18
|
+
* filter-only lookup. Caught by the new graphql-schema-drift CI guard, which
|
|
19
|
+
* had zero prior coverage on this repo — this bug would otherwise have shipped
|
|
20
|
+
* to prod undetected, same as BOFF-3915/BOFF-4703/BOFF-3529.
|
|
21
|
+
*
|
|
22
|
+
* NOT verified by this fix: whether `TagFilterInput.label` (renamed here from
|
|
23
|
+
* the nonexistent `.value`) actually produces the intended
|
|
24
|
+
* mtwEntityType+mtwEntityId AND-filter semantics against wspace-files-svc's
|
|
25
|
+
* tag-matching resolver — that's a wspace-files-svc/wspace-tags-svc business-
|
|
26
|
+
* logic question outside a schema-shape validator's reach (it operates on
|
|
27
|
+
* runtime variable values, not the query document). Flagged as follow-up.
|
|
12
28
|
*/
|
|
13
29
|
export type EntityDocumentType = 'vehicle' | 'driver' | 'order';
|
|
14
30
|
export interface EntityDocument {
|
|
@@ -214,7 +214,6 @@ export interface Order {
|
|
|
214
214
|
};
|
|
215
215
|
items: OrderItem[];
|
|
216
216
|
status: OrderStatus;
|
|
217
|
-
orderType: 'b2b' | 'b2c';
|
|
218
217
|
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
219
218
|
pickupAddress: Address;
|
|
220
219
|
deliveryAddress: Address;
|
|
@@ -640,10 +639,9 @@ export interface OrderFilter {
|
|
|
640
639
|
dateFrom?: Date;
|
|
641
640
|
dateTo?: Date;
|
|
642
641
|
priority?: string;
|
|
643
|
-
orderType?: 'b2b' | 'b2c';
|
|
644
642
|
/**
|
|
645
643
|
* Client-side quick filter for orders that still need a driver assigned
|
|
646
|
-
* (driverId is null). The backend
|
|
644
|
+
* (driverId is null). The backend DeliveryJobFilterInput has no null-driver
|
|
647
645
|
* predicate, so this is applied to the fetched page after mapping.
|
|
648
646
|
*/
|
|
649
647
|
unassigned?: boolean;
|
|
@@ -20,7 +20,6 @@ import { EmphasisPanel as M, NextSteps as ne, PagePurpose as re } from "@burdeno
|
|
|
20
20
|
function N() {
|
|
21
21
|
let { orderId: N } = k(), { basePath: P, navigate: F } = c(), { order: I } = ee(N), { createOrder: L, updateOrder: R } = te(), { customers: z } = l({ limit: 100 }), B = !!N && !!I, [V, H] = O({
|
|
22
22
|
customerId: I?.customerId || "",
|
|
23
|
-
orderType: I?.orderType || "b2c",
|
|
24
23
|
priority: I?.priority || "normal",
|
|
25
24
|
pickupAddress: {
|
|
26
25
|
street: I?.pickupAddress.street || "",
|
|
@@ -42,7 +41,6 @@ function N() {
|
|
|
42
41
|
D(() => {
|
|
43
42
|
I && H({
|
|
44
43
|
customerId: I.customerId || "",
|
|
45
|
-
orderType: I.orderType || "b2c",
|
|
46
44
|
priority: I.priority || "normal",
|
|
47
45
|
pickupAddress: {
|
|
48
46
|
street: I.pickupAddress.street || "",
|
|
@@ -89,7 +87,6 @@ function N() {
|
|
|
89
87
|
phone: n.phone,
|
|
90
88
|
company: n.company
|
|
91
89
|
},
|
|
92
|
-
orderType: V.orderType,
|
|
93
90
|
priority: V.priority,
|
|
94
91
|
pickupAddress: V.pickupAddress,
|
|
95
92
|
deliveryAddress: V.deliveryAddress,
|
|
@@ -209,82 +206,59 @@ function N() {
|
|
|
209
206
|
}), /* @__PURE__ */ A("div", {
|
|
210
207
|
className: "space-y-4",
|
|
211
208
|
children: /* @__PURE__ */ j("div", {
|
|
212
|
-
className: "grid grid-cols-1 md:grid-cols-
|
|
213
|
-
children: [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
|
|
238
|
-
children:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
children:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
value: "
|
|
252
|
-
children: "
|
|
253
|
-
})
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
id: "priority",
|
|
266
|
-
children: /* @__PURE__ */ A(x, {})
|
|
267
|
-
}), /* @__PURE__ */ j(v, { children: [
|
|
268
|
-
/* @__PURE__ */ A(y, {
|
|
269
|
-
value: "low",
|
|
270
|
-
children: "Low"
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */ A(y, {
|
|
273
|
-
value: "normal",
|
|
274
|
-
children: "Normal"
|
|
275
|
-
}),
|
|
276
|
-
/* @__PURE__ */ A(y, {
|
|
277
|
-
value: "high",
|
|
278
|
-
children: "High"
|
|
279
|
-
}),
|
|
280
|
-
/* @__PURE__ */ A(y, {
|
|
281
|
-
value: "urgent",
|
|
282
|
-
children: "Urgent"
|
|
283
|
-
})
|
|
284
|
-
] })]
|
|
285
|
-
})]
|
|
286
|
-
})
|
|
287
|
-
]
|
|
209
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
210
|
+
children: [/* @__PURE__ */ j("div", {
|
|
211
|
+
className: "space-y-2",
|
|
212
|
+
children: [/* @__PURE__ */ A(g, {
|
|
213
|
+
htmlFor: "customer",
|
|
214
|
+
children: "Customer"
|
|
215
|
+
}), /* @__PURE__ */ j(_, {
|
|
216
|
+
value: V.customerId,
|
|
217
|
+
onValueChange: (e) => X("customerId", e),
|
|
218
|
+
children: [/* @__PURE__ */ A(b, {
|
|
219
|
+
id: "customer",
|
|
220
|
+
children: /* @__PURE__ */ A(x, { placeholder: "Select customer" })
|
|
221
|
+
}), /* @__PURE__ */ A(v, { children: z.map((e) => /* @__PURE__ */ j(y, {
|
|
222
|
+
value: e.id,
|
|
223
|
+
children: [
|
|
224
|
+
e.name,
|
|
225
|
+
" (",
|
|
226
|
+
e.email,
|
|
227
|
+
")"
|
|
228
|
+
]
|
|
229
|
+
}, e.id)) })]
|
|
230
|
+
})]
|
|
231
|
+
}), /* @__PURE__ */ j("div", {
|
|
232
|
+
className: "space-y-2",
|
|
233
|
+
children: [/* @__PURE__ */ A(g, {
|
|
234
|
+
htmlFor: "priority",
|
|
235
|
+
children: "Priority"
|
|
236
|
+
}), /* @__PURE__ */ j(_, {
|
|
237
|
+
value: V.priority,
|
|
238
|
+
onValueChange: (e) => X("priority", e),
|
|
239
|
+
children: [/* @__PURE__ */ A(b, {
|
|
240
|
+
id: "priority",
|
|
241
|
+
children: /* @__PURE__ */ A(x, {})
|
|
242
|
+
}), /* @__PURE__ */ j(v, { children: [
|
|
243
|
+
/* @__PURE__ */ A(y, {
|
|
244
|
+
value: "low",
|
|
245
|
+
children: "Low"
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ A(y, {
|
|
248
|
+
value: "normal",
|
|
249
|
+
children: "Normal"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ A(y, {
|
|
252
|
+
value: "high",
|
|
253
|
+
children: "High"
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ A(y, {
|
|
256
|
+
value: "urgent",
|
|
257
|
+
children: "Urgent"
|
|
258
|
+
})
|
|
259
|
+
] })]
|
|
260
|
+
})]
|
|
261
|
+
})]
|
|
288
262
|
})
|
|
289
263
|
})] }),
|
|
290
264
|
/* @__PURE__ */ j("div", {
|