@paro.io/expert-shared-components 1.14.57 → 1.14.60
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/lib/README.md +2 -0
- package/lib/components/DocumentCenter/MultiFileUploadSection.js +121 -220
- package/lib/components/TaxAxis/TaxAxisApi.d.ts +2 -0
- package/lib/components/TaxAxis/TaxAxisShell.d.ts +1 -1
- package/lib/components/TaxAxis/TaxAxisShell.js +104 -5
- package/lib/components/TaxAxis/types.d.ts +5 -0
- package/lib/components/shared/UploadClient.d.ts +1 -2
- package/lib/components/shared/UploadClient.js +2 -6
- package/lib/index.d.ts +13 -2
- package/lib/index.js +27 -3
- package/lib/package.json +68 -0
- package/lib/tax-axis/components/clientReport/ExecutiveSummary.d.ts +1 -4
- package/lib/tax-axis/components/clientReport/ExecutiveSummary.js +6 -10
- package/lib/tax-axis/components/clientReport/Methodology.js +2 -2
- package/lib/tax-axis/components/clientReport/RecommendedStrategies.d.ts +1 -6
- package/lib/tax-axis/components/clientReport/RecommendedStrategies.js +24 -26
- package/lib/tax-axis/components/clientReport/StrategyCard.d.ts +1 -1
- package/lib/tax-axis/components/clientReport/StrategyCard.js +23 -39
- package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +2 -8
- package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +7 -9
- package/lib/tax-axis/components/dashboard/DashboardActions.js +4 -5
- package/lib/tax-axis/components/dashboard/DashboardSummary.d.ts +1 -6
- package/lib/tax-axis/components/dashboard/DashboardSummary.js +4 -14
- package/lib/tax-axis/components/dashboard/StrategyDetailPanel.d.ts +1 -1
- package/lib/tax-axis/components/dashboard/StrategyDetailPanel.js +91 -120
- package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +2 -59
- package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +36 -412
- package/lib/tax-axis/components/documents/DocumentCard.d.ts +3 -7
- package/lib/tax-axis/components/documents/DocumentCard.js +12 -65
- package/lib/tax-axis/components/documents/DocumentTier.d.ts +2 -5
- package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
- package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +1 -25
- package/lib/tax-axis/components/documents/TaxAxisDocuments.js +52 -267
- package/lib/tax-axis/components/documents/qbo/QboAvailableReportsModal.d.ts +13 -0
- package/lib/tax-axis/components/documents/qbo/QboAvailableReportsModal.js +180 -0
- package/lib/tax-axis/components/documents/qbo/QboClientSelectorModal.d.ts +10 -0
- package/lib/tax-axis/components/documents/qbo/QboClientSelectorModal.js +155 -0
- package/lib/tax-axis/components/documents/qbo/QboConnectBanner.d.ts +9 -0
- package/lib/tax-axis/components/documents/qbo/QboConnectBanner.js +55 -0
- package/lib/tax-axis/components/documents/qbo/QboDocumentMappingModal.d.ts +10 -0
- package/lib/tax-axis/components/documents/qbo/QboDocumentMappingModal.js +202 -0
- package/lib/tax-axis/components/documents/qbo/QboImportingModal.d.ts +8 -0
- package/lib/tax-axis/components/documents/qbo/QboImportingModal.js +75 -0
- package/lib/tax-axis/components/documents/qbo/QboPermissionsModal.d.ts +8 -0
- package/lib/tax-axis/components/documents/qbo/QboPermissionsModal.js +126 -0
- package/lib/tax-axis/components/documents/qbo/index.d.ts +8 -0
- package/lib/tax-axis/components/documents/qbo/index.js +17 -0
- package/lib/tax-axis/components/documents/qbo/qboConstants.d.ts +24 -0
- package/lib/tax-axis/components/documents/qbo/qboConstants.js +71 -0
- package/lib/tax-axis/components/documents/qbo/types.d.ts +43 -0
- package/lib/tax-axis/components/documents/qbo/types.js +3 -0
- package/lib/tax-axis/components/documents/qbo/useQboFlow.d.ts +19 -0
- package/lib/tax-axis/components/documents/qbo/useQboFlow.js +207 -0
- package/lib/tax-axis/components/extractionReview/TaxAxisExtractionReview.js +17 -17
- package/lib/tax-axis/components/intake/ClientParametersSection.js +29 -13
- package/lib/tax-axis/components/intake/IntakeCtaCards.d.ts +2 -1
- package/lib/tax-axis/components/intake/IntakeCtaCards.js +13 -6
- package/lib/tax-axis/components/intake/TaxAxisIntake.js +44 -5
- package/lib/tax-axis/components/intake/intakeSchema.d.ts +3 -0
- package/lib/tax-axis/components/intake/intakeSchema.js +4 -2
- package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +2 -26
- package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +4 -15
- package/lib/tax-axis/components/processing/TaxAxisProcessing.d.ts +1 -3
- package/lib/tax-axis/components/processing/TaxAxisProcessing.js +31 -102
- package/lib/tax-axis/components/prospectReport/ProspectPrintView.js +2 -0
- package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.d.ts +8 -1
- package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.js +5 -5
- package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.d.ts +27 -1
- package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.js +43 -25
- package/lib/tax-axis/index.d.ts +0 -4
- package/lib/tax-axis/index.js +1 -6
- package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +13 -138
- package/lib/tax-axis/lib/adapters/useEngineOutput.js +7 -156
- package/lib/tax-axis/lib/data/documents.d.ts +2 -3
- package/lib/tax-axis/lib/data/documents.js +25 -225
- package/lib/tax-axis/lib/data/strategies.js +9 -9
- package/lib/tax-axis/lib/documentFieldCatalog.d.ts +12 -7
- package/lib/tax-axis/lib/documentFieldCatalog.js +8 -805
- package/lib/tax-axis/lib/types/index.d.ts +1 -13
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QboImportingModal = QboImportingModal;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const qboConstants_1 = require("./qboConstants");
|
|
9
|
+
function QboImportingModal({ open, currentStepIndex, companyName, }) {
|
|
10
|
+
if (!open)
|
|
11
|
+
return null;
|
|
12
|
+
return (react_1.default.createElement("div", { style: {
|
|
13
|
+
position: "fixed",
|
|
14
|
+
inset: 0,
|
|
15
|
+
zIndex: 9999,
|
|
16
|
+
background: "rgba(0,0,0,0.65)",
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
} },
|
|
21
|
+
react_1.default.createElement("div", { style: {
|
|
22
|
+
width: 420,
|
|
23
|
+
background: "#111827",
|
|
24
|
+
border: "1px solid #1f2937",
|
|
25
|
+
borderRadius: 16,
|
|
26
|
+
boxShadow: "0 25px 60px rgba(0,0,0,0.5)",
|
|
27
|
+
padding: "28px 24px 24px",
|
|
28
|
+
} },
|
|
29
|
+
react_1.default.createElement("div", { style: { textAlign: "center", marginBottom: 24 } },
|
|
30
|
+
react_1.default.createElement("div", { style: { fontSize: 15, fontWeight: 600, color: "#f3f4f6" } }, "Importing from QuickBooks"),
|
|
31
|
+
react_1.default.createElement("div", { style: { fontSize: 12, color: "#9ca3af", marginTop: 4 } }, companyName)),
|
|
32
|
+
react_1.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 6 } }, qboConstants_1.IMPORT_STEPS.map((step, i) => {
|
|
33
|
+
const isComplete = i < currentStepIndex;
|
|
34
|
+
const isActive = i === currentStepIndex;
|
|
35
|
+
const isPending = i > currentStepIndex;
|
|
36
|
+
return (react_1.default.createElement("div", { key: step.key, style: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
gap: 12,
|
|
40
|
+
padding: "10px 12px",
|
|
41
|
+
borderRadius: 8,
|
|
42
|
+
background: isActive ? "rgba(44,160,28,0.06)" : "transparent",
|
|
43
|
+
} },
|
|
44
|
+
react_1.default.createElement("div", { style: Object.assign({ width: 24, height: 24, borderRadius: "50%", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, (isComplete
|
|
45
|
+
? { background: "rgba(44,160,28,0.15)" }
|
|
46
|
+
: isActive
|
|
47
|
+
? { background: "rgba(44,160,28,0.1)", border: "2px solid rgba(44,160,28,0.3)" }
|
|
48
|
+
: { background: "rgba(75,85,99,0.15)" })) }, isComplete ? (react_1.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
49
|
+
react_1.default.createElement("path", { d: "M2.5 6l3 3 4.5-5", stroke: qboConstants_1.QBO_GREEN, strokeWidth: "1.5", strokeLinecap: "round" }))) : isActive ? (react_1.default.createElement("div", { style: {
|
|
50
|
+
width: 12,
|
|
51
|
+
height: 12,
|
|
52
|
+
borderRadius: "50%",
|
|
53
|
+
border: "2px solid transparent",
|
|
54
|
+
borderTopColor: qboConstants_1.QBO_GREEN,
|
|
55
|
+
animation: "qbo-spin 0.8s linear infinite",
|
|
56
|
+
} })) : (react_1.default.createElement("div", { style: {
|
|
57
|
+
width: 6,
|
|
58
|
+
height: 6,
|
|
59
|
+
borderRadius: "50%",
|
|
60
|
+
background: "#4b5563",
|
|
61
|
+
} }))),
|
|
62
|
+
react_1.default.createElement("span", { style: {
|
|
63
|
+
fontSize: 13,
|
|
64
|
+
fontWeight: isActive ? 500 : 400,
|
|
65
|
+
color: isComplete ? qboConstants_1.QBO_GREEN : isActive ? "#e5e7eb" : "#6b7280",
|
|
66
|
+
} },
|
|
67
|
+
step.label,
|
|
68
|
+
isComplete && (react_1.default.createElement("span", { style: { fontSize: 11, color: "#6b7280", marginLeft: 6 } }, "Done")))));
|
|
69
|
+
})),
|
|
70
|
+
react_1.default.createElement("style", null, `
|
|
71
|
+
@keyframes qbo-spin {
|
|
72
|
+
to { transform: rotate(360deg); }
|
|
73
|
+
}
|
|
74
|
+
`))));
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface QboPermissionsModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
onContinue: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function QboPermissionsModal({ open, onCancel, onContinue, }: QboPermissionsModalProps): React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QboPermissionsModal = QboPermissionsModal;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const qboConstants_1 = require("./qboConstants");
|
|
9
|
+
function QboPermissionsModal({ open, onCancel, onContinue, }) {
|
|
10
|
+
if (!open)
|
|
11
|
+
return null;
|
|
12
|
+
return (react_1.default.createElement("div", { onClick: onCancel, style: {
|
|
13
|
+
position: "fixed",
|
|
14
|
+
inset: 0,
|
|
15
|
+
zIndex: 9999,
|
|
16
|
+
background: "rgba(0,0,0,0.65)",
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
} },
|
|
21
|
+
react_1.default.createElement("div", { onClick: (e) => e.stopPropagation(), style: {
|
|
22
|
+
width: 440,
|
|
23
|
+
maxHeight: "85vh",
|
|
24
|
+
background: "#111827",
|
|
25
|
+
border: "1px solid #1f2937",
|
|
26
|
+
borderRadius: 16,
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
boxShadow: "0 25px 60px rgba(0,0,0,0.5)",
|
|
30
|
+
} },
|
|
31
|
+
react_1.default.createElement("div", { style: { padding: "20px 24px 16px", borderBottom: "1px solid #1f2937" } },
|
|
32
|
+
react_1.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 12 } },
|
|
33
|
+
react_1.default.createElement("div", { style: {
|
|
34
|
+
width: 36,
|
|
35
|
+
height: 36,
|
|
36
|
+
borderRadius: 8,
|
|
37
|
+
background: "rgba(44,160,28,0.12)",
|
|
38
|
+
border: "1px solid rgba(44,160,28,0.25)",
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
} },
|
|
43
|
+
react_1.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none" },
|
|
44
|
+
react_1.default.createElement("rect", { width: "24", height: "24", rx: "4", fill: qboConstants_1.QBO_GREEN }),
|
|
45
|
+
react_1.default.createElement("path", { d: "M12 4C7.58 4 4 7.58 4 12s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-1.5 12.5c-2.49 0-4.5-2.01-4.5-4.5s2.01-4.5 4.5-4.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5c0 2.49-2.01 4.5-4.5 4.5zm3 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5-1.5.67-1.5 1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5c0-2.49 2.01-4.5 4.5-4.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5z", fill: "white" }))),
|
|
46
|
+
react_1.default.createElement("div", { style: { flex: 1 } },
|
|
47
|
+
react_1.default.createElement("div", { style: { fontSize: 15, fontWeight: 600, color: "#f3f4f6" } }, "Connect QuickBooks Online"),
|
|
48
|
+
react_1.default.createElement("div", { style: { fontSize: 12, color: "#9ca3af", marginTop: 2 } }, "TaxAxis will request the following permissions")),
|
|
49
|
+
react_1.default.createElement("button", { onClick: onCancel, style: {
|
|
50
|
+
background: "transparent",
|
|
51
|
+
border: "none",
|
|
52
|
+
color: "#6b7280",
|
|
53
|
+
fontSize: 18,
|
|
54
|
+
cursor: "pointer",
|
|
55
|
+
padding: 4,
|
|
56
|
+
lineHeight: 1,
|
|
57
|
+
} }, "\u00D7"))),
|
|
58
|
+
react_1.default.createElement("div", { style: { padding: "16px 24px", flex: 1, overflowY: "auto" } }, qboConstants_1.QBO_PERMISSIONS.map((perm, i) => (react_1.default.createElement("div", { key: i, style: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
gap: 12,
|
|
62
|
+
padding: "12px 0",
|
|
63
|
+
borderBottom: i < qboConstants_1.QBO_PERMISSIONS.length - 1 ? "1px solid #1f2937" : "none",
|
|
64
|
+
} },
|
|
65
|
+
react_1.default.createElement("div", { style: {
|
|
66
|
+
width: 28,
|
|
67
|
+
height: 28,
|
|
68
|
+
borderRadius: 6,
|
|
69
|
+
background: "rgba(44,160,28,0.08)",
|
|
70
|
+
border: "1px solid rgba(44,160,28,0.2)",
|
|
71
|
+
display: "flex",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
flexShrink: 0,
|
|
75
|
+
} },
|
|
76
|
+
react_1.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
77
|
+
react_1.default.createElement("path", { d: "M2 6l3 3 5-5.5", stroke: qboConstants_1.QBO_GREEN, strokeWidth: "1.5", strokeLinecap: "round" }))),
|
|
78
|
+
react_1.default.createElement("div", { style: { flex: 1, minWidth: 0 } },
|
|
79
|
+
react_1.default.createElement("div", { style: { fontSize: 13, fontWeight: 500, color: "#e5e7eb" } }, perm.label),
|
|
80
|
+
react_1.default.createElement("div", { style: { fontSize: 11, color: "#9ca3af", marginTop: 2 } }, perm.description)),
|
|
81
|
+
react_1.default.createElement("span", { style: {
|
|
82
|
+
fontSize: 9,
|
|
83
|
+
fontWeight: 700,
|
|
84
|
+
color: "#9ca3af",
|
|
85
|
+
background: "rgba(156,163,175,0.1)",
|
|
86
|
+
border: "1px solid rgba(156,163,175,0.2)",
|
|
87
|
+
borderRadius: 4,
|
|
88
|
+
padding: "2px 6px",
|
|
89
|
+
letterSpacing: "0.05em",
|
|
90
|
+
flexShrink: 0,
|
|
91
|
+
} }, "READ ONLY"))))),
|
|
92
|
+
react_1.default.createElement("div", { style: {
|
|
93
|
+
padding: "14px 24px",
|
|
94
|
+
borderTop: "1px solid #1f2937",
|
|
95
|
+
display: "flex",
|
|
96
|
+
justifyContent: "flex-end",
|
|
97
|
+
gap: 10,
|
|
98
|
+
} },
|
|
99
|
+
react_1.default.createElement("button", { onClick: onCancel, style: {
|
|
100
|
+
background: "transparent",
|
|
101
|
+
border: "1px solid #374151",
|
|
102
|
+
borderRadius: 8,
|
|
103
|
+
padding: "8px 18px",
|
|
104
|
+
fontSize: 13,
|
|
105
|
+
fontWeight: 500,
|
|
106
|
+
color: "#9ca3af",
|
|
107
|
+
cursor: "pointer",
|
|
108
|
+
} }, "Cancel"),
|
|
109
|
+
react_1.default.createElement("button", { onClick: onContinue, style: {
|
|
110
|
+
background: qboConstants_1.INTUIT_BLUE,
|
|
111
|
+
border: "none",
|
|
112
|
+
borderRadius: 8,
|
|
113
|
+
padding: "8px 20px",
|
|
114
|
+
fontSize: 13,
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
color: "white",
|
|
117
|
+
cursor: "pointer",
|
|
118
|
+
display: "flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
gap: 6,
|
|
121
|
+
boxShadow: "0 2px 8px rgba(0,119,197,0.3)",
|
|
122
|
+
} },
|
|
123
|
+
"Continue to Intuit",
|
|
124
|
+
react_1.default.createElement("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none" },
|
|
125
|
+
react_1.default.createElement("path", { d: "M2 5h6M5.5 2.5L8 5 5.5 7.5", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })))))));
|
|
126
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { QboConnectBanner } from "./QboConnectBanner";
|
|
2
|
+
export { QboPermissionsModal } from "./QboPermissionsModal";
|
|
3
|
+
export { QboClientSelectorModal } from "./QboClientSelectorModal";
|
|
4
|
+
export { QboAvailableReportsModal } from "./QboAvailableReportsModal";
|
|
5
|
+
export { QboImportingModal } from "./QboImportingModal";
|
|
6
|
+
export { QboDocumentMappingModal } from "./QboDocumentMappingModal";
|
|
7
|
+
export { useQboFlow } from "./useQboFlow";
|
|
8
|
+
export type { QboCompany, QboReportOption, QboMappingRow, QboImportStep, QboModalStep, QboFlowState, QboFlowProps, } from "./types";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useQboFlow = exports.QboDocumentMappingModal = exports.QboImportingModal = exports.QboAvailableReportsModal = exports.QboClientSelectorModal = exports.QboPermissionsModal = exports.QboConnectBanner = void 0;
|
|
4
|
+
var QboConnectBanner_1 = require("./QboConnectBanner");
|
|
5
|
+
Object.defineProperty(exports, "QboConnectBanner", { enumerable: true, get: function () { return QboConnectBanner_1.QboConnectBanner; } });
|
|
6
|
+
var QboPermissionsModal_1 = require("./QboPermissionsModal");
|
|
7
|
+
Object.defineProperty(exports, "QboPermissionsModal", { enumerable: true, get: function () { return QboPermissionsModal_1.QboPermissionsModal; } });
|
|
8
|
+
var QboClientSelectorModal_1 = require("./QboClientSelectorModal");
|
|
9
|
+
Object.defineProperty(exports, "QboClientSelectorModal", { enumerable: true, get: function () { return QboClientSelectorModal_1.QboClientSelectorModal; } });
|
|
10
|
+
var QboAvailableReportsModal_1 = require("./QboAvailableReportsModal");
|
|
11
|
+
Object.defineProperty(exports, "QboAvailableReportsModal", { enumerable: true, get: function () { return QboAvailableReportsModal_1.QboAvailableReportsModal; } });
|
|
12
|
+
var QboImportingModal_1 = require("./QboImportingModal");
|
|
13
|
+
Object.defineProperty(exports, "QboImportingModal", { enumerable: true, get: function () { return QboImportingModal_1.QboImportingModal; } });
|
|
14
|
+
var QboDocumentMappingModal_1 = require("./QboDocumentMappingModal");
|
|
15
|
+
Object.defineProperty(exports, "QboDocumentMappingModal", { enumerable: true, get: function () { return QboDocumentMappingModal_1.QboDocumentMappingModal; } });
|
|
16
|
+
var useQboFlow_1 = require("./useQboFlow");
|
|
17
|
+
Object.defineProperty(exports, "useQboFlow", { enumerable: true, get: function () { return useQboFlow_1.useQboFlow; } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QboCompany, QboReportOption, QboMappingRow, QboImportStep } from "./types";
|
|
2
|
+
export declare const QBO_GREEN = "#2CA01C";
|
|
3
|
+
export declare const QBO_GREEN_LIGHT = "#3FBF2E";
|
|
4
|
+
export declare const QBO_GREEN_BG = "rgba(44,160,28,0.08)";
|
|
5
|
+
export declare const QBO_GREEN_BORDER = "rgba(44,160,28,0.25)";
|
|
6
|
+
export declare const INTUIT_BLUE = "#0077C5";
|
|
7
|
+
export declare const MOCK_COMPANIES: QboCompany[];
|
|
8
|
+
export declare const QBO_PERMISSIONS: {
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const QBO_REPORT_OPTIONS: QboReportOption[];
|
|
13
|
+
export declare const IMPORT_STEPS: {
|
|
14
|
+
key: QboImportStep;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const PL_MAPPING_ROWS: QboMappingRow[];
|
|
18
|
+
export declare const BS_MAPPING_ROWS: QboMappingRow[];
|
|
19
|
+
export declare const LS_QBO_CONNECTED = "quickbooks_connected";
|
|
20
|
+
export declare const LS_QBO_ACCESS_TOKEN = "quickbooks_access_token";
|
|
21
|
+
export declare const LS_QBO_REFRESH_TOKEN = "quickbooks_refresh_token";
|
|
22
|
+
export declare const LS_QBO_TOKEN_EXPIRY = "quickbooks_token_expiry";
|
|
23
|
+
export declare const LS_QBO_REALM_ID = "quickbooks_realm_id";
|
|
24
|
+
export declare const LS_QBO_COMPANY_NAME = "taxaxis_qbo_company_name";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// QBO Connect Flow — constants and mock data
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LS_QBO_COMPANY_NAME = exports.LS_QBO_REALM_ID = exports.LS_QBO_TOKEN_EXPIRY = exports.LS_QBO_REFRESH_TOKEN = exports.LS_QBO_ACCESS_TOKEN = exports.LS_QBO_CONNECTED = exports.BS_MAPPING_ROWS = exports.PL_MAPPING_ROWS = exports.IMPORT_STEPS = exports.QBO_REPORT_OPTIONS = exports.QBO_PERMISSIONS = exports.MOCK_COMPANIES = exports.INTUIT_BLUE = exports.QBO_GREEN_BORDER = exports.QBO_GREEN_BG = exports.QBO_GREEN_LIGHT = exports.QBO_GREEN = void 0;
|
|
5
|
+
// ── Brand colors ──
|
|
6
|
+
exports.QBO_GREEN = "#2CA01C";
|
|
7
|
+
exports.QBO_GREEN_LIGHT = "#3FBF2E";
|
|
8
|
+
exports.QBO_GREEN_BG = "rgba(44,160,28,0.08)";
|
|
9
|
+
exports.QBO_GREEN_BORDER = "rgba(44,160,28,0.25)";
|
|
10
|
+
exports.INTUIT_BLUE = "#0077C5";
|
|
11
|
+
// ── Mock companies (v1 — real API call blocked by OAuth code re-exchange issue) ──
|
|
12
|
+
exports.MOCK_COMPANIES = [
|
|
13
|
+
{ id: "realm-001", name: "Acme Consulting LLC", initials: "AC", color: "#6366F1" },
|
|
14
|
+
{ id: "realm-002", name: "Summit Digital Services", initials: "SD", color: "#248384" },
|
|
15
|
+
{ id: "realm-003", name: "Greenleaf Tax & Advisory", initials: "GT", color: "#0F6E56" },
|
|
16
|
+
{ id: "realm-004", name: "Northstar Financial Group", initials: "NF", color: "#FB9A1D" },
|
|
17
|
+
];
|
|
18
|
+
// ── Permissions shown in the modal ──
|
|
19
|
+
exports.QBO_PERMISSIONS = [
|
|
20
|
+
{ label: "Profit & Loss Reports", description: "Read your income and expense summaries" },
|
|
21
|
+
{ label: "Balance Sheet Reports", description: "Read your assets, liabilities, and equity" },
|
|
22
|
+
{ label: "Chart of Accounts", description: "Read your account structure and naming" },
|
|
23
|
+
{ label: "Company Information", description: "Read your business name and fiscal year" },
|
|
24
|
+
];
|
|
25
|
+
// ── Available report options ──
|
|
26
|
+
exports.QBO_REPORT_OPTIONS = [
|
|
27
|
+
{ id: "profit_loss", label: "Profit & Loss (Accrual)", documentType: "profit_loss", available: true },
|
|
28
|
+
{ id: "balance_sheet", label: "Balance Sheet (Accrual)", documentType: "balance_sheet", available: true },
|
|
29
|
+
{ id: "payroll_summary", label: "Payroll Summary", documentType: "payroll_records", available: false },
|
|
30
|
+
{ id: "fixed_asset_detail", label: "Fixed Asset Detail", documentType: "fixed_asset_schedule", available: false },
|
|
31
|
+
];
|
|
32
|
+
// ── Import step definitions ──
|
|
33
|
+
exports.IMPORT_STEPS = [
|
|
34
|
+
{ key: "connecting", label: "Connecting to QuickBooks" },
|
|
35
|
+
{ key: "fetching_reports", label: "Fetching report data" },
|
|
36
|
+
{ key: "importing_pl", label: "Importing Profit & Loss" },
|
|
37
|
+
{ key: "importing_bs", label: "Importing Balance Sheet" },
|
|
38
|
+
];
|
|
39
|
+
// ── Document mapping rows (mock for v1) ──
|
|
40
|
+
exports.PL_MAPPING_ROWS = [
|
|
41
|
+
{ qboField: "Total Income", taxAxisField: "Gross Revenue", status: "mapped" },
|
|
42
|
+
{ qboField: "Cost of Goods Sold", taxAxisField: "Cost of Goods Sold", status: "mapped" },
|
|
43
|
+
{ qboField: "Gross Profit", taxAxisField: "Gross Profit", status: "mapped" },
|
|
44
|
+
{ qboField: "Total Operating Expenses", taxAxisField: "Total Operating Expenses", status: "mapped" },
|
|
45
|
+
{ qboField: "Net Operating Income", taxAxisField: "Net Operating Income", status: "mapped" },
|
|
46
|
+
{ qboField: "Advertising & Marketing", taxAxisField: "Advertising Expense", status: "mapped" },
|
|
47
|
+
{ qboField: "Insurance", taxAxisField: "Insurance Expense", status: "mapped" },
|
|
48
|
+
{ qboField: "Rent or Lease", taxAxisField: "Rent Expense", status: "mapped" },
|
|
49
|
+
{ qboField: "Meals & Entertainment", taxAxisField: "Meals & Entertainment", status: "review" },
|
|
50
|
+
{ qboField: "Depreciation", taxAxisField: "Depreciation Expense", status: "mapped" },
|
|
51
|
+
{ qboField: "Office Supplies", taxAxisField: "Office Supplies", status: "mapped" },
|
|
52
|
+
{ qboField: "Professional Fees", taxAxisField: "Professional Fees", status: "mapped" },
|
|
53
|
+
];
|
|
54
|
+
exports.BS_MAPPING_ROWS = [
|
|
55
|
+
{ qboField: "Total Current Assets", taxAxisField: "Total Current Assets", status: "mapped" },
|
|
56
|
+
{ qboField: "Total Fixed Assets", taxAxisField: "Total Fixed Assets", status: "mapped" },
|
|
57
|
+
{ qboField: "Total Assets", taxAxisField: "Total Assets", status: "mapped" },
|
|
58
|
+
{ qboField: "Total Current Liabilities", taxAxisField: "Current Liabilities", status: "mapped" },
|
|
59
|
+
{ qboField: "Total Long-Term Liabilities", taxAxisField: "Long-Term Liabilities", status: "mapped" },
|
|
60
|
+
{ qboField: "Total Liabilities", taxAxisField: "Total Liabilities", status: "mapped" },
|
|
61
|
+
{ qboField: "Owner's Equity", taxAxisField: "Owner's Equity", status: "mapped" },
|
|
62
|
+
{ qboField: "Retained Earnings", taxAxisField: "Retained Earnings", status: "mapped" },
|
|
63
|
+
{ qboField: "Total Equity", taxAxisField: "Total Equity", status: "mapped" },
|
|
64
|
+
];
|
|
65
|
+
// ── localStorage keys ──
|
|
66
|
+
exports.LS_QBO_CONNECTED = "quickbooks_connected";
|
|
67
|
+
exports.LS_QBO_ACCESS_TOKEN = "quickbooks_access_token";
|
|
68
|
+
exports.LS_QBO_REFRESH_TOKEN = "quickbooks_refresh_token";
|
|
69
|
+
exports.LS_QBO_TOKEN_EXPIRY = "quickbooks_token_expiry";
|
|
70
|
+
exports.LS_QBO_REALM_ID = "quickbooks_realm_id";
|
|
71
|
+
exports.LS_QBO_COMPANY_NAME = "taxaxis_qbo_company_name";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface QboCompany {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
initials: string;
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
7
|
+
export interface QboReportOption {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
documentType: string;
|
|
11
|
+
available: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface QboMappingRow {
|
|
14
|
+
qboField: string;
|
|
15
|
+
taxAxisField: string;
|
|
16
|
+
status: "mapped" | "unmapped" | "review";
|
|
17
|
+
}
|
|
18
|
+
export type QboImportStep = "connecting" | "fetching_reports" | "importing_pl" | "importing_bs";
|
|
19
|
+
export type QboModalStep = "closed" | "permissions" | "oauth_pending" | "client_selector" | "available_reports" | "mapping" | "importing" | "done";
|
|
20
|
+
export interface QboFlowState {
|
|
21
|
+
modalStep: QboModalStep;
|
|
22
|
+
selectedCompany: QboCompany | null;
|
|
23
|
+
selectedReports: string[];
|
|
24
|
+
importStepIndex: number;
|
|
25
|
+
error: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface QboFlowProps {
|
|
28
|
+
qboConnected?: boolean;
|
|
29
|
+
qboCompanyName?: string | null;
|
|
30
|
+
qboAuthorizeUrl?: string;
|
|
31
|
+
qboGetClientsUrl?: string;
|
|
32
|
+
/** Selected tax year from the session profile — pre-fills the year dropdown */
|
|
33
|
+
profileYear?: number;
|
|
34
|
+
onImportQboReport?: (sessionId: string, realmId: string, reportType: string, accountingMethod: string, year?: number) => Promise<any>;
|
|
35
|
+
fetchUploadedDocuments?: () => Promise<any[]>;
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
onQboConnected?: (companyName: string) => void;
|
|
38
|
+
onQboDisconnected?: () => void;
|
|
39
|
+
onQboImportComplete?: (importedReports: {
|
|
40
|
+
slot: string;
|
|
41
|
+
fileName: string;
|
|
42
|
+
}[]) => void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { QboCompany, QboModalStep, QboFlowProps } from "./types";
|
|
2
|
+
export declare function useQboFlow({ qboConnected, qboCompanyName, qboAuthorizeUrl, onImportQboReport, fetchUploadedDocuments, sessionId, profileYear, onQboConnected, onQboDisconnected, onQboImportComplete, }: QboFlowProps): {
|
|
3
|
+
modalStep: QboModalStep;
|
|
4
|
+
selectedCompany: QboCompany | null;
|
|
5
|
+
selectedReports: string[];
|
|
6
|
+
selectedYear: number;
|
|
7
|
+
setSelectedYear: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
8
|
+
importStepIndex: number;
|
|
9
|
+
error: string | null;
|
|
10
|
+
companies: QboCompany[];
|
|
11
|
+
openPermissions: () => void;
|
|
12
|
+
openImport: () => void;
|
|
13
|
+
handlePermissionsContinue: () => void;
|
|
14
|
+
handleCompanySelected: (company: QboCompany) => void;
|
|
15
|
+
handleReportsConfirmed: (reportIds: string[]) => Promise<void>;
|
|
16
|
+
handleMappingConfirm: () => Promise<void>;
|
|
17
|
+
handleDisconnect: () => void;
|
|
18
|
+
closeModal: () => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.useQboFlow = useQboFlow;
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const qboConstants_1 = require("./qboConstants");
|
|
15
|
+
function buildCompany(companyName) {
|
|
16
|
+
const name = companyName || "My QuickBooks Company";
|
|
17
|
+
const initials = name
|
|
18
|
+
.split(/\s+/)
|
|
19
|
+
.slice(0, 2)
|
|
20
|
+
.map((w) => { var _a, _b; return (_b = (_a = w[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : ""; })
|
|
21
|
+
.join("");
|
|
22
|
+
return { id: "connected", name, initials, color: "#2CA01C" };
|
|
23
|
+
}
|
|
24
|
+
function useQboFlow({ qboConnected, qboCompanyName, qboAuthorizeUrl, onImportQboReport, fetchUploadedDocuments, sessionId, profileYear, onQboConnected, onQboDisconnected, onQboImportComplete, }) {
|
|
25
|
+
const [modalStep, setModalStep] = (0, react_1.useState)("closed");
|
|
26
|
+
const [selectedCompany, setSelectedCompany] = (0, react_1.useState)(qboConnected ? buildCompany(qboCompanyName) : null);
|
|
27
|
+
const [selectedReports, setSelectedReports] = (0, react_1.useState)([]);
|
|
28
|
+
const [selectedYear, setSelectedYear] = (0, react_1.useState)(profileYear !== null && profileYear !== void 0 ? profileYear : new Date().getFullYear());
|
|
29
|
+
const [importStepIndex, setImportStepIndex] = (0, react_1.useState)(0);
|
|
30
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
31
|
+
const pollTimerRef = (0, react_1.useRef)(null);
|
|
32
|
+
// Keep selectedYear in sync if profileYear prop changes
|
|
33
|
+
const prevProfileYear = (0, react_1.useRef)(profileYear);
|
|
34
|
+
if (profileYear !== prevProfileYear.current) {
|
|
35
|
+
prevProfileYear.current = profileYear;
|
|
36
|
+
if (profileYear)
|
|
37
|
+
setSelectedYear(profileYear);
|
|
38
|
+
}
|
|
39
|
+
// Sync company when qboCompanyName prop changes
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
if (qboConnected)
|
|
42
|
+
setSelectedCompany(buildCompany(qboCompanyName));
|
|
43
|
+
}, [qboConnected, qboCompanyName]);
|
|
44
|
+
// Cleanup poll timer on unmount
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
return () => {
|
|
47
|
+
if (pollTimerRef.current)
|
|
48
|
+
clearInterval(pollTimerRef.current);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
// ── Already connected: skip straight to report selection ──
|
|
52
|
+
const openImport = (0, react_1.useCallback)(() => {
|
|
53
|
+
setError(null);
|
|
54
|
+
setSelectedCompany(buildCompany(qboCompanyName));
|
|
55
|
+
setModalStep("available_reports");
|
|
56
|
+
}, [qboCompanyName]);
|
|
57
|
+
// ── Not yet connected: start OAuth flow ──
|
|
58
|
+
const openPermissions = (0, react_1.useCallback)(() => {
|
|
59
|
+
setError(null);
|
|
60
|
+
setModalStep("permissions");
|
|
61
|
+
}, []);
|
|
62
|
+
// ── After permissions: start OAuth popup ──
|
|
63
|
+
const handlePermissionsContinue = (0, react_1.useCallback)(() => {
|
|
64
|
+
const isDemoMode = typeof window !== "undefined" &&
|
|
65
|
+
(!qboAuthorizeUrl || window.location.hostname === "localhost");
|
|
66
|
+
if (isDemoMode) {
|
|
67
|
+
setSelectedCompany(buildCompany(qboCompanyName));
|
|
68
|
+
setModalStep("client_selector");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
setModalStep("oauth_pending");
|
|
72
|
+
const authorizeUrl = qboAuthorizeUrl;
|
|
73
|
+
const redirectUri = `${window.location.origin}/integrations-hub/callback`;
|
|
74
|
+
const authUrl = authorizeUrl.includes("?")
|
|
75
|
+
? `${authorizeUrl}&redirectUri=${encodeURIComponent(redirectUri)}`
|
|
76
|
+
: `${authorizeUrl}?redirectUri=${encodeURIComponent(redirectUri)}`;
|
|
77
|
+
const popup = window.open(authUrl, "qbo_oauth", "width=600,height=700,scrollbars=yes");
|
|
78
|
+
// Poll for popup close — parent will re-fetch EPS and update qboConnected prop
|
|
79
|
+
let elapsed = 0;
|
|
80
|
+
pollTimerRef.current = setInterval(() => {
|
|
81
|
+
elapsed += 500;
|
|
82
|
+
if (popup && popup.closed) {
|
|
83
|
+
if (pollTimerRef.current)
|
|
84
|
+
clearInterval(pollTimerRef.current);
|
|
85
|
+
// Parent prop update will trigger the useEffect above to set selectedCompany
|
|
86
|
+
setModalStep("client_selector");
|
|
87
|
+
}
|
|
88
|
+
if (elapsed >= 120000) {
|
|
89
|
+
if (pollTimerRef.current)
|
|
90
|
+
clearInterval(pollTimerRef.current);
|
|
91
|
+
setError("QuickBooks authorization timed out. Please try again.");
|
|
92
|
+
setModalStep("closed");
|
|
93
|
+
}
|
|
94
|
+
}, 500);
|
|
95
|
+
}, [qboAuthorizeUrl, qboCompanyName]);
|
|
96
|
+
// ── Company selected ──
|
|
97
|
+
const handleCompanySelected = (0, react_1.useCallback)((company) => {
|
|
98
|
+
setSelectedCompany(company);
|
|
99
|
+
setModalStep("available_reports");
|
|
100
|
+
}, []);
|
|
101
|
+
// ── Reports confirmed → import ──
|
|
102
|
+
const handleReportsConfirmed = (0, react_1.useCallback)((reportIds) => __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
var _a;
|
|
104
|
+
setSelectedReports(reportIds);
|
|
105
|
+
if (!onImportQboReport || !sessionId || !selectedCompany) {
|
|
106
|
+
setError("Import configuration is incomplete.");
|
|
107
|
+
setModalStep("closed");
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
setModalStep("importing");
|
|
111
|
+
setImportStepIndex(0);
|
|
112
|
+
try {
|
|
113
|
+
yield new Promise((r) => setTimeout(r, 600));
|
|
114
|
+
setImportStepIndex(1);
|
|
115
|
+
yield new Promise((r) => setTimeout(r, 400));
|
|
116
|
+
setImportStepIndex(2);
|
|
117
|
+
const realmId = selectedCompany.id;
|
|
118
|
+
const importPromises = reportIds.map((reportId) => {
|
|
119
|
+
const reportType = reportId === "profit_loss" ? "profit_loss" : "balance_sheet";
|
|
120
|
+
return onImportQboReport(sessionId, realmId, reportType, "Accrual", selectedYear);
|
|
121
|
+
});
|
|
122
|
+
const results = yield Promise.allSettled(importPromises);
|
|
123
|
+
setImportStepIndex(3);
|
|
124
|
+
const failures = results.filter((r) => r.status === "rejected");
|
|
125
|
+
if (failures.length === results.length) {
|
|
126
|
+
const msg = ((_a = failures[0].reason) === null || _a === void 0 ? void 0 : _a.message) || "Import failed";
|
|
127
|
+
setError(msg);
|
|
128
|
+
setModalStep("closed");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
yield new Promise((r) => setTimeout(r, 500));
|
|
132
|
+
setImportStepIndex(4);
|
|
133
|
+
if (failures.length > 0) {
|
|
134
|
+
const msg = failures
|
|
135
|
+
.map((f) => { var _a; return ((_a = f.reason) === null || _a === void 0 ? void 0 : _a.message) || "Import failed"; })
|
|
136
|
+
.join("; ");
|
|
137
|
+
setError(msg);
|
|
138
|
+
}
|
|
139
|
+
if (fetchUploadedDocuments) {
|
|
140
|
+
try {
|
|
141
|
+
yield fetchUploadedDocuments();
|
|
142
|
+
}
|
|
143
|
+
catch ( /* non-fatal */_b) { /* non-fatal */ }
|
|
144
|
+
}
|
|
145
|
+
if (onQboConnected)
|
|
146
|
+
onQboConnected(selectedCompany.name);
|
|
147
|
+
if (onQboImportComplete) {
|
|
148
|
+
const mappedDocs = reportIds
|
|
149
|
+
.map((reportId) => {
|
|
150
|
+
const option = qboConstants_1.QBO_REPORT_OPTIONS.find((o) => o.id === reportId);
|
|
151
|
+
return option ? { slot: option.documentType, fileName: option.label } : null;
|
|
152
|
+
})
|
|
153
|
+
.filter((m) => m !== null);
|
|
154
|
+
onQboImportComplete(mappedDocs);
|
|
155
|
+
}
|
|
156
|
+
setModalStep("done");
|
|
157
|
+
setTimeout(() => { setModalStep("closed"); }, 1500);
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
const msg = err instanceof Error ? err.message : "Import failed. Please try again.";
|
|
161
|
+
setError(msg);
|
|
162
|
+
setModalStep("closed");
|
|
163
|
+
}
|
|
164
|
+
}), [
|
|
165
|
+
onImportQboReport,
|
|
166
|
+
sessionId,
|
|
167
|
+
selectedCompany,
|
|
168
|
+
selectedYear,
|
|
169
|
+
fetchUploadedDocuments,
|
|
170
|
+
onQboConnected,
|
|
171
|
+
onQboImportComplete,
|
|
172
|
+
]);
|
|
173
|
+
const handleMappingConfirm = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
yield handleReportsConfirmed(selectedReports);
|
|
175
|
+
}), [handleReportsConfirmed, selectedReports]);
|
|
176
|
+
const handleDisconnect = (0, react_1.useCallback)(() => {
|
|
177
|
+
setSelectedCompany(null);
|
|
178
|
+
setSelectedReports([]);
|
|
179
|
+
setImportStepIndex(0);
|
|
180
|
+
setModalStep("closed");
|
|
181
|
+
if (onQboDisconnected)
|
|
182
|
+
onQboDisconnected();
|
|
183
|
+
}, [onQboDisconnected]);
|
|
184
|
+
const closeModal = (0, react_1.useCallback)(() => {
|
|
185
|
+
setModalStep("closed");
|
|
186
|
+
setError(null);
|
|
187
|
+
}, []);
|
|
188
|
+
const companies = selectedCompany ? [selectedCompany] : [];
|
|
189
|
+
return {
|
|
190
|
+
modalStep,
|
|
191
|
+
selectedCompany,
|
|
192
|
+
selectedReports,
|
|
193
|
+
selectedYear,
|
|
194
|
+
setSelectedYear,
|
|
195
|
+
importStepIndex,
|
|
196
|
+
error,
|
|
197
|
+
companies,
|
|
198
|
+
openPermissions,
|
|
199
|
+
openImport,
|
|
200
|
+
handlePermissionsContinue,
|
|
201
|
+
handleCompanySelected,
|
|
202
|
+
handleReportsConfirmed,
|
|
203
|
+
handleMappingConfirm,
|
|
204
|
+
handleDisconnect,
|
|
205
|
+
closeModal,
|
|
206
|
+
};
|
|
207
|
+
}
|