@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.
- package/dist/components/CustomerDeliveryUpdatesFields.js +57 -0
- package/dist/components/CustomerNotificationSettingsCard.js +368 -0
- package/dist/components/freight-cost/FreightCommercialFactEditor.js +46 -46
- package/dist/components/freight-cost/FreightCommercialHistory.js +7 -7
- package/dist/components/freight-cost/FreightDraftForm.js +20 -20
- package/dist/components/freight-invoice/InvoiceReviewPanel.js +255 -0
- package/dist/components/freight-invoice/InvoiceReviewQueue.js +93 -0
- package/dist/generated/freight-invoice-operations.d.ts +461 -0
- package/dist/generated/tracking-quality-operations.d.ts +275 -0
- package/dist/hooks/useCustomers.js +9 -3
- package/dist/hooks/useInvoiceComparisonRecovery.js +26 -26
- package/dist/hooks/useInvoiceReviewPermissions.js +14 -0
- package/dist/movethewheels/components/CustomerDeliveryUpdatesFields.d.ts +12 -0
- package/dist/movethewheels/components/CustomerNotificationSettingsCard.d.ts +3 -0
- package/dist/movethewheels/components/freight-invoice/InvoiceReviewPanel.d.ts +11 -0
- package/dist/movethewheels/components/freight-invoice/InvoiceReviewQueue.d.ts +22 -0
- package/dist/movethewheels/hooks/useInvoiceReviewPermissions.d.ts +5 -0
- package/dist/movethewheels/pages/FinancePage.d.ts +3 -1
- package/dist/movethewheels/types/index.d.ts +4 -0
- package/dist/movethewheels/utils/customerNotifications.d.ts +66 -0
- package/dist/movethewheels/utils/invoiceReview.d.ts +26 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell-ring.js +22 -0
- package/dist/pages/CustomerDetailsPage.js +279 -231
- package/dist/pages/FinancePage.js +109 -67
- package/dist/pages/FreightEstimatePage.js +89 -89
- package/dist/pages/FreightInvoicePage.js +138 -120
- package/dist/pages/SettingsPage.js +242 -238
- package/dist/src/generated/freight-invoice-operations.js +2100 -1
- package/dist/utils/customerNotifications.js +83 -0
- package/dist/utils/invoiceReview.js +84 -0
- package/package.json +4 -3
- package/src/generated/freight-invoice-operations.ts +245 -1
- package/src/generated/tracking-quality-operations.ts +304 -0
- package/src/movethewheels/components/CustomerDeliveryUpdatesFields.tsx +67 -0
- package/src/movethewheels/components/CustomerNotificationSettingsCard.tsx +465 -0
- package/src/movethewheels/components/freight-invoice/InvoiceReviewPanel.tsx +319 -0
- package/src/movethewheels/components/freight-invoice/InvoiceReviewQueue.tsx +96 -0
- package/src/movethewheels/hooks/useCustomers.ts +17 -0
- package/src/movethewheels/hooks/useInvoiceReviewPermissions.ts +25 -0
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +39 -0
- package/src/movethewheels/pages/FinancePage.tsx +34 -2
- package/src/movethewheels/pages/FreightInvoicePage.tsx +44 -3
- package/src/movethewheels/pages/SettingsPage.tsx +221 -208
- package/src/movethewheels/types/index.ts +4 -0
- package/src/movethewheels/utils/customerNotifications.ts +209 -0
- package/src/movethewheels/utils/invoiceReview.ts +146 -0
- package/src/operations/freight-invoice/review.graphql +26 -0
|
@@ -141,6 +141,10 @@ export interface Customer {
|
|
|
141
141
|
businessLicense?: string;
|
|
142
142
|
taxId?: string;
|
|
143
143
|
rating?: number;
|
|
144
|
+
/** Delivery notifications by email (BOFF-4402). */
|
|
145
|
+
notifyByEmail: boolean;
|
|
146
|
+
/** Delivery notifications by SMS; needs a phone number with its country code. */
|
|
147
|
+
notifyBySms: boolean;
|
|
144
148
|
createdAt: Date;
|
|
145
149
|
updatedAt: Date;
|
|
146
150
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Customer delivery notifications — client side of wspace-movethewheels-svc's
|
|
3
|
+
* customer notification settings, history and previews (BOFF-4402).
|
|
4
|
+
*
|
|
5
|
+
* The service decides what to send and when; this module holds the GraphQL
|
|
6
|
+
* documents, the labels and the pure draft helpers the Settings page uses.
|
|
7
|
+
* Kept free of React so the contract can be unit-tested.
|
|
8
|
+
*/
|
|
9
|
+
export type MtwCustomerNotificationEvent = 'BOOKED' | 'PICKED_UP' | 'OUT_FOR_DELIVERY' | 'DELIVERED' | 'DELAYED' | 'FAILED';
|
|
10
|
+
export type MtwCustomerNotificationChannel = 'EMAIL' | 'SMS';
|
|
11
|
+
export type MtwCustomerNotificationStatus = 'PENDING' | 'SENT' | 'FAILED' | 'SKIPPED';
|
|
12
|
+
export interface MtwCustomerNotificationSettings {
|
|
13
|
+
workspaceId: string;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
enabledAt: string | null;
|
|
16
|
+
emailEnabled: boolean;
|
|
17
|
+
smsEnabled: boolean;
|
|
18
|
+
events: MtwCustomerNotificationEvent[];
|
|
19
|
+
isCustomized: boolean;
|
|
20
|
+
updatedAt: string | null;
|
|
21
|
+
updatedBy: string | null;
|
|
22
|
+
}
|
|
23
|
+
export type MtwCustomerNotificationSettingsInput = Partial<Pick<MtwCustomerNotificationSettings, 'enabled' | 'emailEnabled' | 'smsEnabled' | 'events'>>;
|
|
24
|
+
export interface MtwCustomerNotification {
|
|
25
|
+
id: string;
|
|
26
|
+
shipmentId: string;
|
|
27
|
+
shipmentNumber: string | null;
|
|
28
|
+
customerId: string | null;
|
|
29
|
+
event: MtwCustomerNotificationEvent;
|
|
30
|
+
channel: MtwCustomerNotificationChannel;
|
|
31
|
+
status: MtwCustomerNotificationStatus;
|
|
32
|
+
recipient: string | null;
|
|
33
|
+
subject: string | null;
|
|
34
|
+
attempts: number;
|
|
35
|
+
lastError: string | null;
|
|
36
|
+
sentAt: string | null;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
}
|
|
39
|
+
export interface MtwCustomerNotificationPreview {
|
|
40
|
+
event: MtwCustomerNotificationEvent;
|
|
41
|
+
subject: string;
|
|
42
|
+
emailText: string;
|
|
43
|
+
smsText: string;
|
|
44
|
+
}
|
|
45
|
+
/** Every event, in the order a shipment reaches them. */
|
|
46
|
+
export declare const CUSTOMER_NOTIFICATION_EVENTS: ReadonlyArray<{
|
|
47
|
+
value: MtwCustomerNotificationEvent;
|
|
48
|
+
label: string;
|
|
49
|
+
description: string;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function eventLabel(event: MtwCustomerNotificationEvent): string;
|
|
52
|
+
export declare const STATUS_LABELS: Record<MtwCustomerNotificationStatus, string>;
|
|
53
|
+
/** Off, email only, every event — what a workspace sees until it saves. */
|
|
54
|
+
export declare function defaultNotificationSettings(workspaceId?: string): MtwCustomerNotificationSettings;
|
|
55
|
+
/** Events in canonical order without duplicates. */
|
|
56
|
+
export declare function orderedEvents(events: readonly MtwCustomerNotificationEvent[]): MtwCustomerNotificationEvent[];
|
|
57
|
+
/** Add or remove one event from a selection. */
|
|
58
|
+
export declare function toggleEvent(events: readonly MtwCustomerNotificationEvent[], event: MtwCustomerNotificationEvent, on: boolean): MtwCustomerNotificationEvent[];
|
|
59
|
+
/** Only the fields the draft changed, ready for the update mutation. */
|
|
60
|
+
export declare function changedNotificationSettings(saved: MtwCustomerNotificationSettings, draft: Pick<MtwCustomerNotificationSettings, 'enabled' | 'emailEnabled' | 'smsEnabled' | 'events'>): MtwCustomerNotificationSettingsInput;
|
|
61
|
+
/** Why the draft cannot be saved, or null. Switching on needs a channel and an event. */
|
|
62
|
+
export declare function notificationDraftError(draft: Pick<MtwCustomerNotificationSettings, 'enabled' | 'emailEnabled' | 'smsEnabled' | 'events'>): string | null;
|
|
63
|
+
export declare const MTW_CUSTOMER_NOTIFICATION_SETTINGS_QUERY = "\n query MtwCustomerNotificationSettings {\n mtwCustomerNotificationSettings {\n workspaceId\n enabled\n enabledAt\n emailEnabled\n smsEnabled\n events\n isCustomized\n updatedAt\n updatedBy\n}\n }\n";
|
|
64
|
+
export declare const UPDATE_MTW_CUSTOMER_NOTIFICATION_SETTINGS_MUTATION = "\n mutation UpdateMtwCustomerNotificationSettings($input: UpdateMtwCustomerNotificationSettingsInput!) {\n updateMtwCustomerNotificationSettings(input: $input) {\n workspaceId\n enabled\n enabledAt\n emailEnabled\n smsEnabled\n events\n isCustomized\n updatedAt\n updatedBy\n}\n }\n";
|
|
65
|
+
export declare const MTW_CUSTOMER_NOTIFICATIONS_QUERY = "\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";
|
|
66
|
+
export declare const MTW_CUSTOMER_NOTIFICATION_PREVIEWS_QUERY = "\n query MtwCustomerNotificationPreviews {\n mtwCustomerNotificationPreviews {\n event\n subject\n emailText\n smsText\n }\n }\n";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DecideMtwFreightInvoiceInput, HandOffMtwFreightInvoiceSettlementInput, InvoiceReviewFragment, MtwFreightInvoiceDecision, MtwFreightInvoiceResolution, MtwFreightInvoiceReviewAction, MtwFreightInvoiceReviewStatus, RecordMtwFreightInvoiceSupplierResponseInput, ResolveMtwFreightInvoiceDisputeInput } from '../../generated/freight-invoice-operations';
|
|
2
|
+
export declare const REVIEW_STATUS_LABELS: Record<MtwFreightInvoiceReviewStatus, string>;
|
|
3
|
+
export declare const REVIEW_EVENT_LABELS: Record<InvoiceReviewFragment['events'][number]['kind'], string>;
|
|
4
|
+
/** Statuses a reviewer can filter the queue by; SUPERSEDED never appears in the queue. */
|
|
5
|
+
export declare const REVIEW_QUEUE_STATUSES: MtwFreightInvoiceReviewStatus[];
|
|
6
|
+
export interface ReviewPermissions {
|
|
7
|
+
canRead: boolean;
|
|
8
|
+
canUpdate: boolean;
|
|
9
|
+
canApprove: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Steps the server says are open (author separation included) that this viewer is also permitted to take. */
|
|
12
|
+
export declare function availableReviewActions(review: Pick<InvoiceReviewFragment, 'allowedActions'>, permissions: ReviewPermissions): MtwFreightInvoiceReviewAction[];
|
|
13
|
+
/** Why the author sees no decision: the server withholds it, so say so instead of showing nothing. */
|
|
14
|
+
export declare function authorNotice(review: Pick<InvoiceReviewFragment, 'viewerIsAuthor' | 'status'>): string | null;
|
|
15
|
+
interface Common {
|
|
16
|
+
review: Pick<InvoiceReviewFragment, 'shipmentId' | 'comparisonId' | 'sequence'>;
|
|
17
|
+
idempotencyKey: string;
|
|
18
|
+
}
|
|
19
|
+
export type DraftProblem = 'REASON_REQUIRED' | 'LINES_REQUIRED' | 'RESPONSE_REQUIRED';
|
|
20
|
+
export declare const DRAFT_PROBLEM_LABELS: Record<DraftProblem, string>;
|
|
21
|
+
export declare function decisionInput(base: Common, decision: MtwFreightInvoiceDecision, reason: string, disputedLineIds: readonly string[]): DecideMtwFreightInvoiceInput | DraftProblem;
|
|
22
|
+
export declare function supplierResponseInput(base: Common, response: string): RecordMtwFreightInvoiceSupplierResponseInput | DraftProblem;
|
|
23
|
+
export declare function resolutionInput(base: Common, resolution: MtwFreightInvoiceResolution, reason: string): ResolveMtwFreightInvoiceDisputeInput | DraftProblem;
|
|
24
|
+
export declare function handOffInput(base: Common, note: string): HandOffMtwFreightInvoiceSettlementInput;
|
|
25
|
+
export declare function isDraftProblem(value: unknown): value is DraftProblem;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/bell-ring.js
|
|
3
|
+
var t = e("BellRing", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M10.268 21a2 2 0 0 0 3.464 0",
|
|
6
|
+
key: "vwvbt9"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M22 8c0-2.3-.8-4.3-2-6",
|
|
10
|
+
key: "5bb3ad"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
|
|
14
|
+
key: "11g9vi"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M4 2C2.8 3.7 2 5.7 2 8",
|
|
18
|
+
key: "tap9e0"
|
|
19
|
+
}]
|
|
20
|
+
]);
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as BellRing };
|