@burdenoff/microfe-movethewheels 2026.1102.1 → 2026.1107.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/MoveTheWheelsRoot.js +148 -140
- package/dist/MoveTheWheelsRoutes.js +29 -25
- 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 +467 -1
- package/dist/generated/wspace-types.d.ts +9779 -330
- package/dist/hooks/useInvoiceComparisonRecovery.js +26 -26
- package/dist/hooks/useInvoiceReviewPermissions.js +14 -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/pages/ReportsPage.d.ts +1 -0
- package/dist/movethewheels/utils/invoiceReview.d.ts +26 -0
- package/dist/movethewheels/utils/reports.d.ts +132 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-chart-column-increasing.js +26 -0
- package/dist/pages/FinancePage.js +109 -67
- package/dist/pages/FreightEstimatePage.js +89 -89
- package/dist/pages/FreightInvoicePage.js +138 -120
- package/dist/pages/ReportsPage.js +718 -0
- package/dist/src/generated/freight-invoice-operations.js +2100 -1
- package/dist/utils/invoiceReview.js +84 -0
- package/dist/utils/reports.js +202 -0
- package/package.json +4 -3
- package/src/generated/freight-invoice-operations.ts +245 -1
- package/src/generated/tracking-quality-operations.ts +569 -1
- package/src/generated/wspace-types.ts +11263 -380
- package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -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/useInvoiceReviewPermissions.ts +25 -0
- package/src/movethewheels/pages/FinancePage.tsx +34 -2
- package/src/movethewheels/pages/FreightInvoicePage.tsx +44 -3
- package/src/movethewheels/pages/ReportsPage.tsx +989 -0
- package/src/movethewheels/utils/invoiceReview.ts +146 -0
- package/src/movethewheels/utils/reports.ts +419 -0
- package/src/operations/freight-invoice/review.graphql +26 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
2
2
|
import { resolveGraphqlUrl as t } from "../utils/graphqlClient.js";
|
|
3
3
|
import { useConditionApi as n } from "./useContainerCondition.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { InvoiceComparisonExactDocument as r, RecordInvoiceComparisonDocument as i, RecoverInvoiceComparisonDocument as a } from "../src/generated/freight-invoice-operations.js";
|
|
5
|
+
import { INVOICE_RECOVERY_STORAGE as o, decodeInvoiceIntent as s, encodeInvoiceIntent as c, invoiceCanonical as l, invoiceRecordInput as u, matchesInvoiceReceipt as d, sameInvoiceScope as f } from "../utils/invoiceComparison.js";
|
|
6
6
|
import { useLayoutEffect as p, useRef as m, useState as h } from "react";
|
|
7
7
|
import { useActiveContext as g } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
8
|
//#region src/movethewheels/hooks/useInvoiceComparisonRecovery.ts
|
|
9
9
|
function _() {
|
|
10
10
|
try {
|
|
11
|
-
let e = sessionStorage.getItem(
|
|
11
|
+
let e = sessionStorage.getItem(o), t = s(e);
|
|
12
12
|
return {
|
|
13
13
|
intent: t,
|
|
14
14
|
blocked: e !== null && t === null
|
|
@@ -32,7 +32,7 @@ function v(n) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
function y(e, t) {
|
|
35
|
-
let g = n("SINGLE_ATTEMPT"), [v] = h(_), [y, b] = h(v.intent), x = m(y), [S, C] = h(v.blocked), w = m(!1), [T, E] = h(!1), [D, O] = h(0), k =
|
|
35
|
+
let g = n("SINGLE_ATTEMPT"), [v] = h(_), [y, b] = h(v.intent), x = m(y), [S, C] = h(v.blocked), w = m(!1), [T, E] = h(!1), [D, O] = h(0), k = l(e), A = m(e), [j, M] = h(null);
|
|
36
36
|
p(() => (A.current = e, () => {
|
|
37
37
|
A.current = null;
|
|
38
38
|
}), [k]);
|
|
@@ -41,37 +41,37 @@ function y(e, t) {
|
|
|
41
41
|
message: e,
|
|
42
42
|
error: t
|
|
43
43
|
}), P = (e, t) => {
|
|
44
|
-
if (!e || !
|
|
45
|
-
let n =
|
|
46
|
-
if (!n ||
|
|
47
|
-
return sessionStorage.removeItem(
|
|
44
|
+
if (!e || !d(e, t) || !f(t.scope, A.current)) throw Error("UNCONFIRMED");
|
|
45
|
+
let n = s(sessionStorage.getItem(o));
|
|
46
|
+
if (!n || l(n) !== l(t)) throw Error("RETAINED_INTENT_CHANGED");
|
|
47
|
+
return sessionStorage.removeItem(o), x.current = null, b(null), C(!1), O((e) => e + 1), N("The exact immutable comparison receipt is confirmed.", !1), e;
|
|
48
48
|
};
|
|
49
49
|
return {
|
|
50
|
-
run: async (n,
|
|
50
|
+
run: async (n, r) => {
|
|
51
51
|
if (w.current || x.current || S) return N("Resolve the original request before starting another."), null;
|
|
52
|
-
if (!e || !
|
|
53
|
-
let
|
|
52
|
+
if (!e || !f(e, A.current) || !t()) return N("Current shipment update permission and workspace context are required. Nothing was sent."), null;
|
|
53
|
+
let a;
|
|
54
54
|
try {
|
|
55
55
|
if (sessionStorage.getItem("movethewheels.freight-invoice.unresolved.v1") !== null) throw Error("EXISTING");
|
|
56
|
-
|
|
56
|
+
a = {
|
|
57
57
|
version: 1,
|
|
58
58
|
scope: structuredClone(e),
|
|
59
|
-
input:
|
|
59
|
+
input: u({
|
|
60
60
|
...n,
|
|
61
61
|
idempotencyKey: crypto.randomUUID()
|
|
62
62
|
}),
|
|
63
|
-
estimate: structuredClone(
|
|
64
|
-
}, sessionStorage.setItem(
|
|
63
|
+
estimate: structuredClone(r)
|
|
64
|
+
}, sessionStorage.setItem(o, c(a)), x.current = a, b(a);
|
|
65
65
|
} catch {
|
|
66
66
|
return N("The original request could not be retained safely. Nothing was sent; reload and inspect any retained request."), null;
|
|
67
67
|
}
|
|
68
68
|
w.current = !0, E(!0), M(null);
|
|
69
69
|
try {
|
|
70
|
-
if (!
|
|
71
|
-
let e =
|
|
72
|
-
return e &&
|
|
70
|
+
if (!f(a.scope, A.current) || !t()) {
|
|
71
|
+
let e = s(sessionStorage.getItem(o));
|
|
72
|
+
return e && l(e) === l(a) && (sessionStorage.removeItem(o), x.current = null, b(null)), N("Context or permission changed before dispatch. Nothing was sent."), null;
|
|
73
73
|
}
|
|
74
|
-
return P((await g(
|
|
74
|
+
return P((await g(i, { input: a.input })).compareMtwFreightInvoice, a);
|
|
75
75
|
} catch {
|
|
76
76
|
return N("Save outcome is UNKNOWN. Keep the original intent and use read-only recovery; do not resend it."), null;
|
|
77
77
|
} finally {
|
|
@@ -81,21 +81,21 @@ function y(e, t) {
|
|
|
81
81
|
reconcile: async () => {
|
|
82
82
|
let e = x.current;
|
|
83
83
|
if (w.current || !e) return null;
|
|
84
|
-
if (!
|
|
84
|
+
if (!f(e.scope, A.current)) return N("Return to the original account, organization, workspace and project to inspect its request."), null;
|
|
85
85
|
w.current = !0, E(!0), M(null);
|
|
86
86
|
try {
|
|
87
|
-
let t = (await g(
|
|
87
|
+
let t = (await g(a, {
|
|
88
88
|
shipmentId: e.input.shipmentId,
|
|
89
89
|
requestKey: e.input.idempotencyKey
|
|
90
90
|
})).mtwFreightInvoiceComparisonByRequestKey;
|
|
91
91
|
if (!t) return N("No original-context receipt was returned. This does not prove no effect; the request stays UNKNOWN and cannot be resent."), null;
|
|
92
|
-
if (!
|
|
93
|
-
if (!
|
|
94
|
-
let n = await g(
|
|
92
|
+
if (!d(t, e)) throw Error("MISMATCH");
|
|
93
|
+
if (!f(e.scope, A.current)) throw Error("CONTEXT_CHANGED");
|
|
94
|
+
let n = await g(r, {
|
|
95
95
|
shipmentId: e.input.shipmentId,
|
|
96
96
|
id: t.id
|
|
97
97
|
});
|
|
98
|
-
if (!
|
|
98
|
+
if (!d(n.mtwFreightInvoiceComparison, e) || n.mtwFreightInvoiceComparison.requestFingerprint !== t.requestFingerprint || l(n.mtwFreightInvoiceComparison) !== l(t)) throw Error("MISMATCH");
|
|
99
99
|
return P(n.mtwFreightInvoiceComparison, e);
|
|
100
100
|
} catch {
|
|
101
101
|
return N("Read-only recovery could not confirm the exact original receipt. Keep the intent; no save was sent."), null;
|
|
@@ -109,7 +109,7 @@ function y(e, t) {
|
|
|
109
109
|
uncertain: y !== null || S,
|
|
110
110
|
revision: D,
|
|
111
111
|
scopeKey: k,
|
|
112
|
-
canReconcile: !!y &&
|
|
112
|
+
canReconcile: !!y && f(y.scope, e),
|
|
113
113
|
feedback: j?.scopeKey === k ? j : null,
|
|
114
114
|
refresh: () => O((e) => e + 1)
|
|
115
115
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
2
|
+
import { usePermissions as t } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
3
|
+
//#region src/movethewheels/hooks/useInvoiceReviewPermissions.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let n = t(), { workspaceId: r, currentUser: i } = e(), a = !!(r && i?.id && n.scopeId === r && (n.isSuperAdmin || n.permissions?.scopeId === r && n.permissions.actorId === i.id)) && !n.isLoading && !n.error && n.hasPermission("mtw-freight-invoice:read");
|
|
6
|
+
return {
|
|
7
|
+
canRead: a,
|
|
8
|
+
canUpdate: a && n.hasPermission("mtw-freight-invoice:update"),
|
|
9
|
+
canApprove: a && n.hasPermission("mtw-freight-invoice:approve"),
|
|
10
|
+
loading: n.isLoading
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as useInvoiceReviewPermissions };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InvoiceReceiptFragment } from '../../../generated/freight-invoice-operations';
|
|
2
|
+
import { ReviewPermissions } from '../../utils/invoiceReview';
|
|
3
|
+
/**
|
|
4
|
+
* Review, dispute and Billing hand-off for one exact comparison revision
|
|
5
|
+
* (BOFF-10588). Every step appends to the revision's history; nothing is edited.
|
|
6
|
+
*/
|
|
7
|
+
export declare function InvoiceReviewPanel({ record, permissions, onChanged, }: {
|
|
8
|
+
record: Pick<InvoiceReceiptFragment, 'id' | 'shipmentId' | 'facts'>;
|
|
9
|
+
permissions: ReviewPermissions;
|
|
10
|
+
onChanged?: () => void;
|
|
11
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InvoiceReviewFragment } from '../../../generated/freight-invoice-operations';
|
|
2
|
+
/** The latest revision of every recorded carrier invoice, filtered by review status (BOFF-10588). */
|
|
3
|
+
export declare function InvoiceReviewQueue({ revision, onOpen, locked, }: {
|
|
4
|
+
revision: number;
|
|
5
|
+
onOpen: (review: InvoiceReviewFragment) => void;
|
|
6
|
+
/** True while an invoice or correction draft is open: opening a review would discard it. */
|
|
7
|
+
locked?: boolean;
|
|
8
|
+
}): import('react').JSX.Element;
|
|
9
|
+
/** Review counts over the latest revision of every recorded carrier invoice. */
|
|
10
|
+
export declare function useInvoiceReviewSummary(enabled: boolean): {
|
|
11
|
+
summary: {
|
|
12
|
+
total: number;
|
|
13
|
+
awaitingReview: number;
|
|
14
|
+
accepted: number;
|
|
15
|
+
acceptedWithVariance: number;
|
|
16
|
+
disputed: number;
|
|
17
|
+
supplierResponded: number;
|
|
18
|
+
settlementHandedOff: number;
|
|
19
|
+
} | null;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
error: string | null;
|
|
22
|
+
};
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* settlement are handled by the platform Billing module, which this page
|
|
8
8
|
* deep-links to rather than re-implementing an Invoice ledger here. Carrier
|
|
9
9
|
* invoices are checked against the agreed freight estimate on the freight
|
|
10
|
-
* invoice comparison page, which this page links to (BOFF-4395).
|
|
10
|
+
* invoice comparison page, which this page links to (BOFF-4395). The review
|
|
11
|
+
* counts (awaiting review, disputed, accepted, handed to Billing) come from
|
|
12
|
+
* Query.mtwFreightInvoiceReviewSummary over real recorded invoices (BOFF-10588).
|
|
11
13
|
*/
|
|
12
14
|
export default function FinancePage(): import('react').JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ReportsPage(): import('react').JSX.Element;
|
|
@@ -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,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports — client side of wspace-movethewheels-svc's saved reports
|
|
3
|
+
* (BOFF-3989).
|
|
4
|
+
*
|
|
5
|
+
* The service owns validation, scheduling and generation; this module holds
|
|
6
|
+
* the GraphQL documents, the form model and the display helpers for report
|
|
7
|
+
* runs. Kept free of React so the contract can be unit-tested against the
|
|
8
|
+
* subgraph schema.
|
|
9
|
+
*/
|
|
10
|
+
export type MtwReportType = 'OPERATIONS' | 'FINANCE' | 'FLEET' | 'CUSTOMERS' | 'INVENTORY';
|
|
11
|
+
export type MtwReportFrequency = 'NONE' | 'DAILY' | 'WEEKLY' | 'MONTHLY';
|
|
12
|
+
export type MtwReportFormat = 'CSV' | 'JSON';
|
|
13
|
+
export type MtwReportCell = string | number | boolean | null;
|
|
14
|
+
export interface MtwReportColumn {
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
kind: 'TEXT' | 'NUMBER' | 'CURRENCY' | 'DATE' | 'BOOLEAN' | string;
|
|
18
|
+
}
|
|
19
|
+
export interface MtwReportMetric {
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
value: number | null;
|
|
23
|
+
kind: 'NUMBER' | 'CURRENCY' | 'PERCENT' | 'DISTANCE' | 'WEIGHT' | string;
|
|
24
|
+
currency: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface MtwReportRunSummary {
|
|
27
|
+
id: string;
|
|
28
|
+
reportId: string;
|
|
29
|
+
reportType: MtwReportType;
|
|
30
|
+
trigger: 'MANUAL' | 'SCHEDULED' | string;
|
|
31
|
+
status: 'RUNNING' | 'COMPLETED' | 'FAILED' | string;
|
|
32
|
+
periodStart: string;
|
|
33
|
+
periodEnd: string;
|
|
34
|
+
rowCount: number;
|
|
35
|
+
truncated: boolean;
|
|
36
|
+
error: string | null;
|
|
37
|
+
durationMs: number | null;
|
|
38
|
+
startedAt: string;
|
|
39
|
+
finishedAt: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface MtwReportRunDetail extends MtwReportRunSummary {
|
|
42
|
+
metrics: MtwReportMetric[];
|
|
43
|
+
columns: MtwReportColumn[];
|
|
44
|
+
rows: Record<string, MtwReportCell>[];
|
|
45
|
+
}
|
|
46
|
+
export interface MtwReport {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
description: string | null;
|
|
50
|
+
type: MtwReportType;
|
|
51
|
+
periodDays: number;
|
|
52
|
+
frequency: MtwReportFrequency;
|
|
53
|
+
runHour: number;
|
|
54
|
+
runWeekday: number;
|
|
55
|
+
runMonthDay: number;
|
|
56
|
+
timezone: string;
|
|
57
|
+
isActive: boolean;
|
|
58
|
+
nextRunAt: string | null;
|
|
59
|
+
lastGeneratedAt: string | null;
|
|
60
|
+
lastRunStatus: string | null;
|
|
61
|
+
lastError: string | null;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
latestRun: MtwReportRunSummary | null;
|
|
64
|
+
}
|
|
65
|
+
export interface MtwReportExport {
|
|
66
|
+
filename: string;
|
|
67
|
+
contentType: string;
|
|
68
|
+
content: string;
|
|
69
|
+
rowCount: number;
|
|
70
|
+
truncated: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** What the create/edit form sends; the service fills in the rest. */
|
|
73
|
+
export interface MtwReportInput {
|
|
74
|
+
name: string;
|
|
75
|
+
type: MtwReportType;
|
|
76
|
+
description: string;
|
|
77
|
+
periodDays: number;
|
|
78
|
+
frequency: MtwReportFrequency;
|
|
79
|
+
runHour: number;
|
|
80
|
+
runWeekday: number;
|
|
81
|
+
runMonthDay: number;
|
|
82
|
+
timezone: string;
|
|
83
|
+
isActive: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Mirrors the service limits. */
|
|
86
|
+
export declare const NAME_MAX = 120;
|
|
87
|
+
export declare const DESCRIPTION_MAX = 1000;
|
|
88
|
+
export declare const PERIOD_DAYS_MIN = 1;
|
|
89
|
+
export declare const PERIOD_DAYS_MAX = 366;
|
|
90
|
+
/** Rows shown in the in-page preview; the download holds every stored row. */
|
|
91
|
+
export declare const PREVIEW_ROWS = 50;
|
|
92
|
+
export declare const REPORT_TYPE_OPTIONS: ReadonlyArray<{
|
|
93
|
+
value: MtwReportType;
|
|
94
|
+
label: string;
|
|
95
|
+
description: string;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const FREQUENCY_OPTIONS: ReadonlyArray<{
|
|
98
|
+
value: MtwReportFrequency;
|
|
99
|
+
label: string;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const WEEKDAY_LABELS: readonly ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
|
|
102
|
+
export declare const MTW_REPORTS_QUERY = "\n query MtwReports($pagination: PaginationInput) {\n mtwReports(pagination: $pagination) {\n \n id\n name\n description\n type\n periodDays\n frequency\n runHour\n runWeekday\n runMonthDay\n timezone\n isActive\n nextRunAt\n lastGeneratedAt\n lastRunStatus\n lastError\n updatedAt\n latestRun {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n }\n\n }\n }\n";
|
|
103
|
+
export declare const MTW_REPORT_RUNS_QUERY = "\n query MtwReportRuns($reportId: ID!, $pagination: PaginationInput) {\n mtwReportRuns(reportId: $reportId, pagination: $pagination) {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n }\n }\n";
|
|
104
|
+
export declare const MTW_REPORT_RUN_QUERY = "\n query MtwReportRun($id: ID!, $rows: PaginationInput) {\n mtwReportRun(id: $id) {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n metrics {\n key\n label\n value\n kind\n currency\n }\n columns {\n key\n label\n kind\n }\n rows(pagination: $rows)\n }\n }\n";
|
|
105
|
+
export declare const MTW_REPORT_RUN_EXPORT_QUERY = "\n query MtwReportRunExport($runId: ID!, $format: MtwReportFormat!) {\n mtwReportRunExport(runId: $runId, format: $format) {\n filename\n contentType\n content\n rowCount\n truncated\n }\n }\n";
|
|
106
|
+
export declare const CREATE_MTW_REPORT_MUTATION = "\n mutation CreateMtwReport($input: MtwCreateReportInput!) {\n createMtwReport(input: $input) {\n \n id\n name\n description\n type\n periodDays\n frequency\n runHour\n runWeekday\n runMonthDay\n timezone\n isActive\n nextRunAt\n lastGeneratedAt\n lastRunStatus\n lastError\n updatedAt\n latestRun {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n }\n\n }\n }\n";
|
|
107
|
+
export declare const UPDATE_MTW_REPORT_MUTATION = "\n mutation UpdateMtwReport($id: ID!, $input: MtwUpdateReportInput!) {\n updateMtwReport(id: $id, input: $input) {\n \n id\n name\n description\n type\n periodDays\n frequency\n runHour\n runWeekday\n runMonthDay\n timezone\n isActive\n nextRunAt\n lastGeneratedAt\n lastRunStatus\n lastError\n updatedAt\n latestRun {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n }\n\n }\n }\n";
|
|
108
|
+
export declare const DELETE_MTW_REPORT_MUTATION = "\n mutation DeleteMtwReport($id: ID!) {\n deleteMtwReport(id: $id)\n }\n";
|
|
109
|
+
export declare const GENERATE_MTW_REPORT_MUTATION = "\n mutation GenerateMtwReport($id: ID!) {\n generateMtwReport(id: $id) {\n \n id\n reportId\n reportType\n trigger\n status\n periodStart\n periodEnd\n rowCount\n truncated\n error\n durationMs\n startedAt\n finishedAt\n\n }\n }\n";
|
|
110
|
+
/** The form's starting point for a new report. */
|
|
111
|
+
export declare function newReportInput(timezone: string): MtwReportInput;
|
|
112
|
+
export declare function reportToInput(report: MtwReport): MtwReportInput;
|
|
113
|
+
/** The look-back window that matches a frequency: the gap between two runs. */
|
|
114
|
+
export declare function suggestedPeriodDays(frequency: MtwReportFrequency): number;
|
|
115
|
+
/** The first problem with the form, or null when the service would accept it. */
|
|
116
|
+
export declare function reportInputError(input: MtwReportInput): string | null;
|
|
117
|
+
/** The input sent to createMtwReport / updateMtwReport. */
|
|
118
|
+
export declare function toServiceInput(input: MtwReportInput): Record<string, unknown>;
|
|
119
|
+
export declare function reportTypeLabel(type: string): string;
|
|
120
|
+
/** "Every Monday at 06:00 (Asia/Kolkata)", "Paused", or "On demand". */
|
|
121
|
+
export declare function scheduleSummary(report: Pick<MtwReport, 'frequency' | 'runHour' | 'runWeekday' | 'runMonthDay' | 'timezone' | 'isActive'>): string;
|
|
122
|
+
export interface MetricFormatters {
|
|
123
|
+
currency: (amount: number, currency?: string) => string;
|
|
124
|
+
distance: (km: number) => string;
|
|
125
|
+
weight: (kg: number) => string;
|
|
126
|
+
}
|
|
127
|
+
/** Display value for one headline metric, in the workspace's units. */
|
|
128
|
+
export declare function formatMetric(metric: MtwReportMetric, format: MetricFormatters): string;
|
|
129
|
+
/** A metric's label with its currency, so per-currency figures stay apart. */
|
|
130
|
+
export declare function metricLabel(metric: MtwReportMetric): string;
|
|
131
|
+
/** Display value for one detail cell. */
|
|
132
|
+
export declare function formatCell(value: MtwReportCell | undefined, column: MtwReportColumn, formatDate: (value: string) => string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/file-chart-column-increasing.js
|
|
3
|
+
var t = e("FileChartColumnIncreasing", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
|
|
6
|
+
key: "1rqfz7"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4",
|
|
10
|
+
key: "tnqrlb"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M8 18v-2",
|
|
14
|
+
key: "qcmpov"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M12 18v-4",
|
|
18
|
+
key: "q1q25u"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M16 18v-6",
|
|
22
|
+
key: "15y0np"
|
|
23
|
+
}]
|
|
24
|
+
]);
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as FileChartColumnIncreasing };
|