@burdenoff/microfe-movethewheels 2026.1101.4 → 2026.1102.2

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 (47) hide show
  1. package/dist/components/CustomerDeliveryUpdatesFields.js +57 -0
  2. package/dist/components/CustomerNotificationSettingsCard.js +368 -0
  3. package/dist/components/freight-cost/FreightCommercialFactEditor.js +46 -46
  4. package/dist/components/freight-cost/FreightCommercialHistory.js +7 -7
  5. package/dist/components/freight-cost/FreightDraftForm.js +20 -20
  6. package/dist/components/freight-invoice/InvoiceReviewPanel.js +255 -0
  7. package/dist/components/freight-invoice/InvoiceReviewQueue.js +93 -0
  8. package/dist/generated/freight-invoice-operations.d.ts +461 -0
  9. package/dist/generated/tracking-quality-operations.d.ts +275 -0
  10. package/dist/hooks/useCustomers.js +9 -3
  11. package/dist/hooks/useInvoiceComparisonRecovery.js +26 -26
  12. package/dist/hooks/useInvoiceReviewPermissions.js +14 -0
  13. package/dist/movethewheels/components/CustomerDeliveryUpdatesFields.d.ts +12 -0
  14. package/dist/movethewheels/components/CustomerNotificationSettingsCard.d.ts +3 -0
  15. package/dist/movethewheels/components/freight-invoice/InvoiceReviewPanel.d.ts +11 -0
  16. package/dist/movethewheels/components/freight-invoice/InvoiceReviewQueue.d.ts +22 -0
  17. package/dist/movethewheels/hooks/useInvoiceReviewPermissions.d.ts +5 -0
  18. package/dist/movethewheels/pages/FinancePage.d.ts +3 -1
  19. package/dist/movethewheels/types/index.d.ts +4 -0
  20. package/dist/movethewheels/utils/customerNotifications.d.ts +66 -0
  21. package/dist/movethewheels/utils/invoiceReview.d.ts +26 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/bell-ring.js +22 -0
  23. package/dist/pages/CustomerDetailsPage.js +279 -231
  24. package/dist/pages/FinancePage.js +109 -67
  25. package/dist/pages/FreightEstimatePage.js +89 -89
  26. package/dist/pages/FreightInvoicePage.js +138 -120
  27. package/dist/pages/SettingsPage.js +242 -238
  28. package/dist/src/generated/freight-invoice-operations.js +2100 -1
  29. package/dist/utils/customerNotifications.js +83 -0
  30. package/dist/utils/invoiceReview.js +84 -0
  31. package/package.json +4 -3
  32. package/src/generated/freight-invoice-operations.ts +245 -1
  33. package/src/generated/tracking-quality-operations.ts +304 -0
  34. package/src/movethewheels/components/CustomerDeliveryUpdatesFields.tsx +67 -0
  35. package/src/movethewheels/components/CustomerNotificationSettingsCard.tsx +465 -0
  36. package/src/movethewheels/components/freight-invoice/InvoiceReviewPanel.tsx +319 -0
  37. package/src/movethewheels/components/freight-invoice/InvoiceReviewQueue.tsx +96 -0
  38. package/src/movethewheels/hooks/useCustomers.ts +17 -0
  39. package/src/movethewheels/hooks/useInvoiceReviewPermissions.ts +25 -0
  40. package/src/movethewheels/pages/CustomerDetailsPage.tsx +39 -0
  41. package/src/movethewheels/pages/FinancePage.tsx +34 -2
  42. package/src/movethewheels/pages/FreightInvoicePage.tsx +44 -3
  43. package/src/movethewheels/pages/SettingsPage.tsx +221 -208
  44. package/src/movethewheels/types/index.ts +4 -0
  45. package/src/movethewheels/utils/customerNotifications.ts +209 -0
  46. package/src/movethewheels/utils/invoiceReview.ts +146 -0
  47. package/src/operations/freight-invoice/review.graphql +26 -0
@@ -0,0 +1,83 @@
1
+ //#region src/movethewheels/utils/customerNotifications.ts
2
+ var e = [
3
+ {
4
+ value: "BOOKED",
5
+ label: "Booked",
6
+ description: "A shipment is created for the customer"
7
+ },
8
+ {
9
+ value: "PICKED_UP",
10
+ label: "Picked up",
11
+ description: "The shipment is collected"
12
+ },
13
+ {
14
+ value: "OUT_FOR_DELIVERY",
15
+ label: "Out for delivery",
16
+ description: "Tracking says the shipment is on its last leg"
17
+ },
18
+ {
19
+ value: "DELIVERED",
20
+ label: "Delivered",
21
+ description: "The shipment is delivered"
22
+ },
23
+ {
24
+ value: "DELAYED",
25
+ label: "Running late",
26
+ description: "The risk monitor expects it to miss the promised delivery (once per promise)"
27
+ },
28
+ {
29
+ value: "FAILED",
30
+ label: "Delivery failed",
31
+ description: "Delivery could not be completed"
32
+ }
33
+ ];
34
+ function t(t) {
35
+ return e.find((e) => e.value === t)?.label ?? t;
36
+ }
37
+ var n = {
38
+ PENDING: "Sending",
39
+ SENT: "Sent",
40
+ FAILED: "Failed",
41
+ SKIPPED: "Not sent"
42
+ };
43
+ function r(t = "") {
44
+ return {
45
+ workspaceId: t,
46
+ enabled: !1,
47
+ enabledAt: null,
48
+ emailEnabled: !0,
49
+ smsEnabled: !1,
50
+ events: e.map((e) => e.value),
51
+ isCustomized: !1,
52
+ updatedAt: null,
53
+ updatedBy: null
54
+ };
55
+ }
56
+ function i(t) {
57
+ let n = new Set(t);
58
+ return e.map((e) => e.value).filter((e) => n.has(e));
59
+ }
60
+ function a(e, t, n) {
61
+ let r = new Set(e);
62
+ return n ? r.add(t) : r.delete(t), i([...r]);
63
+ }
64
+ function o(e, t) {
65
+ let n = {};
66
+ t.enabled !== e.enabled && (n.enabled = t.enabled), t.emailEnabled !== e.emailEnabled && (n.emailEnabled = t.emailEnabled), t.smsEnabled !== e.smsEnabled && (n.smsEnabled = t.smsEnabled);
67
+ let r = i(t.events), a = i(e.events);
68
+ return r.join(",") !== a.join(",") && (n.events = r), n;
69
+ }
70
+ function s(e) {
71
+ return e.enabled ? !e.emailEnabled && !e.smsEnabled ? "Choose email, SMS or both." : e.events.length === 0 ? "Choose at least one event to notify customers about." : null : null;
72
+ }
73
+ var c = "\n workspaceId\n enabled\n enabledAt\n emailEnabled\n smsEnabled\n events\n isCustomized\n updatedAt\n updatedBy\n", l = `
74
+ query MtwCustomerNotificationSettings {
75
+ mtwCustomerNotificationSettings {${c}}
76
+ }
77
+ `, u = `
78
+ mutation UpdateMtwCustomerNotificationSettings($input: UpdateMtwCustomerNotificationSettingsInput!) {
79
+ updateMtwCustomerNotificationSettings(input: $input) {${c}}
80
+ }
81
+ `, d = "\n query MtwCustomerNotifications(\n $filter: MtwCustomerNotificationFilterInput\n $pagination: PaginationInput\n ) {\n mtwCustomerNotifications(filter: $filter, pagination: $pagination) {\n total\n hasMore\n items {\n id\n shipmentId\n shipmentNumber\n customerId\n event\n channel\n status\n recipient\n subject\n attempts\n lastError\n sentAt\n createdAt\n }\n }\n }\n", f = "\n query MtwCustomerNotificationPreviews {\n mtwCustomerNotificationPreviews {\n event\n subject\n emailText\n smsText\n }\n }\n";
82
+ //#endregion
83
+ export { e as CUSTOMER_NOTIFICATION_EVENTS, d as MTW_CUSTOMER_NOTIFICATIONS_QUERY, f as MTW_CUSTOMER_NOTIFICATION_PREVIEWS_QUERY, l as MTW_CUSTOMER_NOTIFICATION_SETTINGS_QUERY, n as STATUS_LABELS, u as UPDATE_MTW_CUSTOMER_NOTIFICATION_SETTINGS_MUTATION, o as changedNotificationSettings, r as defaultNotificationSettings, t as eventLabel, s as notificationDraftError, a as toggleEvent };
@@ -0,0 +1,84 @@
1
+ //#region src/movethewheels/utils/invoiceReview.ts
2
+ var e = {
3
+ AWAITING_REVIEW: "Awaiting review",
4
+ ACCEPTED: "Accepted",
5
+ ACCEPTED_WITH_VARIANCE: "Accepted with variance",
6
+ DISPUTED: "Disputed",
7
+ SUPPLIER_RESPONDED: "Supplier responded",
8
+ SETTLEMENT_HANDED_OFF: "Handed to Billing",
9
+ SUPERSEDED: "Superseded by a correction"
10
+ }, t = {
11
+ DECISION: "Review decision",
12
+ SUPPLIER_RESPONSE: "Supplier response",
13
+ DISPUTE_RESOLUTION: "Dispute resolved",
14
+ SETTLEMENT_HANDOFF: "Handed to Billing for settlement"
15
+ }, n = [
16
+ "AWAITING_REVIEW",
17
+ "DISPUTED",
18
+ "SUPPLIER_RESPONDED",
19
+ "ACCEPTED",
20
+ "ACCEPTED_WITH_VARIANCE",
21
+ "SETTLEMENT_HANDED_OFF"
22
+ ], r = {
23
+ DECIDE: "canApprove",
24
+ RECORD_SUPPLIER_RESPONSE: "canUpdate",
25
+ RESOLVE_DISPUTE: "canApprove",
26
+ HAND_OFF_SETTLEMENT: "canApprove"
27
+ };
28
+ function i(e, t) {
29
+ return e.allowedActions.filter((e) => t[r[e]]);
30
+ }
31
+ function a(e) {
32
+ return e.viewerIsAuthor && (e.status === "AWAITING_REVIEW" || e.status === "DISPUTED" || e.status === "SUPPLIER_RESPONDED") ? "You recorded this comparison, so another reviewer must accept, dispute or resolve it." : null;
33
+ }
34
+ function o(e) {
35
+ return e.trim() || null;
36
+ }
37
+ function s({ review: e, idempotencyKey: t }) {
38
+ return {
39
+ shipmentId: e.shipmentId,
40
+ comparisonId: e.comparisonId,
41
+ expectedSequence: e.sequence,
42
+ idempotencyKey: t
43
+ };
44
+ }
45
+ var c = {
46
+ REASON_REQUIRED: "Give a reason for a dispute, a variance or a resolution.",
47
+ LINES_REQUIRED: "Choose at least one invoice line you dispute.",
48
+ RESPONSE_REQUIRED: "Record the supplier's response."
49
+ };
50
+ function l(e, t, n, r) {
51
+ let i = o(n);
52
+ return t !== "ACCEPTED" && !i ? "REASON_REQUIRED" : t === "DISPUTED" && r.length === 0 ? "LINES_REQUIRED" : {
53
+ ...s(e),
54
+ decision: t,
55
+ reason: i,
56
+ disputedLineIds: t === "DISPUTED" ? [...new Set(r)] : []
57
+ };
58
+ }
59
+ function u(e, t) {
60
+ let n = o(t);
61
+ return n ? {
62
+ ...s(e),
63
+ response: n
64
+ } : "RESPONSE_REQUIRED";
65
+ }
66
+ function d(e, t, n) {
67
+ let r = o(n);
68
+ return r ? {
69
+ ...s(e),
70
+ resolution: t,
71
+ reason: r
72
+ } : "REASON_REQUIRED";
73
+ }
74
+ function f(e, t) {
75
+ return {
76
+ ...s(e),
77
+ note: o(t)
78
+ };
79
+ }
80
+ function p(e) {
81
+ return typeof e == "string" && e in c;
82
+ }
83
+ //#endregion
84
+ export { c as DRAFT_PROBLEM_LABELS, t as REVIEW_EVENT_LABELS, n as REVIEW_QUEUE_STATUSES, e as REVIEW_STATUS_LABELS, a as authorNotice, i as availableReviewActions, l as decisionInput, f as handOffInput, p as isDraftProblem, d as resolutionInput, u as supplierResponseInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.1101.4",
3
+ "version": "2026.1102.2",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
38
38
  "type:check": "bash scripts/build-limits.sh tsc --noEmit",
39
39
  "validate:schema-drift": "graphql-schema-drift",
40
- "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:driver-license-expiry && bun run verify:tracking-alerts && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:freight-commercial && bun run verify:freight-invoice && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:core-codegen && bun run verify:order-vehicle-hold && bun run verify:pallet-preview && bun run verify:entity-export && bun run verify:entity-import && bun run verify:module-settings && bun run verify:carrier-integrations && bun run verify:driver-day && bun run verify:consumed-fuel-preview && bun run build && bun run build-storybook'",
40
+ "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:driver-license-expiry && bun run verify:tracking-alerts && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:freight-commercial && bun run verify:freight-invoice && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:core-codegen && bun run verify:order-vehicle-hold && bun run verify:pallet-preview && bun run verify:entity-export && bun run verify:entity-import && bun run verify:module-settings && bun run verify:carrier-integrations && bun run verify:driver-day && bun run verify:customer-notifications && bun run verify:consumed-fuel-preview && bun run build && bun run build-storybook'",
41
41
  "storybook": "storybook dev -p 6006",
42
42
  "build-storybook": "storybook build",
43
43
  "test:storybook": "vitest run --project=storybook",
@@ -68,7 +68,7 @@
68
68
  "verify:shipment-status-authority": "bun scripts/verify-shipment-status-command.mjs",
69
69
  "verify:free-time-permissions": "bun scripts/verify-free-time-permission-gates.mjs",
70
70
  "verify:freight-commercial": "bun scripts/verify-freight-commercial.mjs && bun scripts/verify-freight-commercial-recovery.mjs && bun scripts/verify-freight-commercial-mounted.mjs",
71
- "verify:freight-invoice": "bun test scripts/verify-invoice-comparison.test.ts && bun scripts/verify-invoice-recovery-hook.mjs",
71
+ "verify:freight-invoice": "bun test scripts/verify-invoice-comparison.test.ts scripts/verify-invoice-review.test.ts && bun scripts/verify-invoice-recovery-hook.mjs",
72
72
  "verify:driver-license-expiry": "bun test scripts/check-driver-license-expiry.test.ts",
73
73
  "verify:tracking-alerts": "bun test scripts/check-tracking-alerts.test.ts",
74
74
  "verify:core-codegen": "bun test scripts/codegen.test.ts && node --test scripts/check-package-types.test.mjs",
@@ -77,6 +77,7 @@
77
77
  "verify:module-settings": "bun test scripts/check-module-settings.test.ts",
78
78
  "verify:driver-day": "bun test scripts/verify-driver-day.test.ts && bun scripts/verify-acknowledged-pending-delivery.mjs",
79
79
  "verify:carrier-integrations": "bun test scripts/check-carrier-integrations.test.ts",
80
+ "verify:customer-notifications": "bun test scripts/check-customer-notifications.test.ts",
80
81
  "verify:pallet-preview": "bun test scripts/check-pallet-preview.test.ts && bun scripts/verify-pallet-preview-hook.mjs",
81
82
  "verify:consumed-fuel-preview": "bun test scripts/check-consumed-fuel-preview.test.ts && bun scripts/verify-consumed-fuel-preview-hook.mjs && bun scripts/verify-consumed-fuel-preview-component.mjs"
82
83
  },