@paro.io/expert-shared-components 1.14.51 → 1.14.53

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 (32) hide show
  1. package/lib/components/DocumentCenter/MultiFileUploadSection.js +220 -121
  2. package/lib/components/TaxAxis/TaxAxisApi.d.ts +1 -0
  3. package/lib/components/TaxAxis/TaxAxisShell.js +55 -12
  4. package/lib/index.d.ts +1 -14
  5. package/lib/index.js +1 -27
  6. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +6 -2
  7. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +5 -3
  8. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +2 -1
  9. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +163 -34
  10. package/lib/tax-axis/components/documents/DocumentCard.d.ts +3 -1
  11. package/lib/tax-axis/components/documents/DocumentCard.js +17 -5
  12. package/lib/tax-axis/components/documents/DocumentReviewModal.d.ts +13 -0
  13. package/lib/tax-axis/components/documents/DocumentReviewModal.js +248 -0
  14. package/lib/tax-axis/components/documents/DocumentTier.d.ts +3 -1
  15. package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
  16. package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +7 -1
  17. package/lib/tax-axis/components/documents/TaxAxisDocuments.js +116 -53
  18. package/lib/tax-axis/components/extractionReview/TaxAxisExtractionReview.js +17 -17
  19. package/lib/tax-axis/components/intake/ClientParametersSection.js +1 -1
  20. package/lib/tax-axis/components/intake/intakeSchema.js +1 -1
  21. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +6 -2
  22. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +5 -3
  23. package/lib/tax-axis/index.d.ts +4 -0
  24. package/lib/tax-axis/index.js +6 -1
  25. package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +144 -0
  26. package/lib/tax-axis/lib/adapters/useEngineOutput.js +155 -0
  27. package/lib/tax-axis/lib/data/documents.d.ts +3 -2
  28. package/lib/tax-axis/lib/data/documents.js +225 -25
  29. package/lib/tax-axis/lib/documentFieldCatalog.d.ts +13 -0
  30. package/lib/tax-axis/lib/documentFieldCatalog.js +808 -0
  31. package/lib/tax-axis/lib/types/index.d.ts +3 -0
  32. package/package.json +1 -1
@@ -1,33 +1,233 @@
1
1
  "use strict";
2
2
  // ═══════════════════════════════════════════════════════════════════
3
- // TaxAxis — Document checklist base + profile-aware resolver
4
- // Verbatim from the mock (App.jsx:575-603).
3
+ // TaxAxis — Document catalog (v2, aligned with parser v2 / LLM parser)
4
+ //
5
+ // documentType values are the canonical lowercase snake-case keys that the
6
+ // backend documentCatalog uses. These are sent verbatim on the
7
+ // uploadTaxAxisDocument mutation.
5
8
  // ═══════════════════════════════════════════════════════════════════
6
9
  Object.defineProperty(exports, "__esModule", { value: true });
7
10
  exports.DOC_SPECS_BASE = void 0;
8
11
  exports.getDocSpecs = getDocSpecs;
9
- const states_1 = require("./states");
10
- exports.DOC_SPECS_BASE = [
11
- { id: "1120s", name: "Federal Tax Return (1120S/1065/1040)", accept: [".pdf", ".docx", ".doc"], strategies: ["QBI \u00A7199A", "S-Corp Structure", "\u00A7179 Expensing", "Bonus Depreciation", "Business Interest \u00A7163(j)"], required: "optional", help: "Optional \u2014 startups or new entities may not have prior returns. Improves accuracy if available." },
12
- { id: "state-return", name: "State Return(s)", accept: [".pdf", ".docx", ".doc"], strategies: ["SALT / PTE Optimization", "State Nexus Analysis"], required: "conditional", help: "Required if client operates in income-tax states. Not needed for WY, NV, TX, FL, etc." },
13
- { id: "payroll", name: "Payroll Records (W-3 / 941)", accept: [".pdf", ".xlsx", ".csv", ".docx", ".doc"], strategies: ["S-Corp Salary", "HSA Maximization", "WOTC", "Overtime Deduction"], required: "optional", help: "Optional for V1 \u2014 intake questions substitute for most payroll data." },
14
- { id: "pnl", name: "Profit & Loss Statement (Current Year)", accept: [".pdf", ".xlsx", ".csv", ".docx", ".doc"], strategies: ["QBI \u00A7199A", "R&D Credit", "Business Meals", "Professional Fees", "Home Office"], required: true, help: "Required \u2014 current year P&L is the minimum input for savings calculations." },
15
- { id: "balance", name: "Balance Sheet (Current Year)", accept: [".pdf", ".xlsx", ".docx", ".doc"], strategies: ["Business Interest \u00A7163(j)", "\u00A7179 Expensing", "Opportunity Zone"], required: true, help: "Required \u2014 needed for asset-based strategies and financial health assessment." },
16
- { id: "cashflow", name: "Cash Flow Statement", accept: [".pdf", ".xlsx", ".docx", ".doc"], strategies: ["Income Deferral", "Tax Method Elections", "Estimated Tax Timing"], required: "optional", help: "Recommended \u2014 helps with income deferral and timing strategies." },
17
- { id: "fixed-assets", name: "Fixed Asset Schedule", accept: [".pdf", ".xlsx", ".docx", ".doc"], strategies: ["\u00A7179", "Bonus Depreciation \u00A7168(k)", "Cost Segregation"], required: "conditional", help: "Required for real estate clients (cost segregation). Optional otherwise." },
18
- { id: "prior-returns", name: "Prior Year Returns (2022\u20132024)", accept: [".pdf", ".docx", ".doc"], strategies: ["R&E Catch-Up \u00A7174A", "Charitable Bunching", "Confidence Intervals"], required: false, help: "More years = tighter estimates. 1 year: \u00B130% range. 2\u20133 years: \u00B115%. 4\u20135 years: \u00B15%." },
12
+ const DOC_META = {
13
+ federal_tax_return: {
14
+ name: "Federal Tax Return (1120S / 1065 / 1040 / 1120)",
15
+ strategies: ["QBI §199A", "S-Corp Structure", "§179 Expensing", "Bonus Depreciation", "Business Interest §163(j)"],
16
+ tier: "recommended",
17
+ help: "Improves accuracy of every strategy. Startups may not have prior returns.",
18
+ },
19
+ profit_loss: {
20
+ name: "Profit & Loss Statement (Current Year)",
21
+ strategies: ["QBI §199A", "R&D Credit", "Business Meals", "Professional Fees", "Home Office"],
22
+ tier: "required",
23
+ help: "Required — current year P&L is the minimum input for savings calculations.",
24
+ },
25
+ balance_sheet: {
26
+ name: "Balance Sheet (Current Year)",
27
+ strategies: ["Business Interest §163(j)", "§179 Expensing", "Opportunity Zone"],
28
+ tier: "required",
29
+ help: "Required — needed for asset-based strategies and financial health assessment.",
30
+ },
31
+ payroll_records: {
32
+ name: "Payroll Records (W-3 / 941)",
33
+ strategies: ["S-Corp Salary", "HSA Maximization", "WOTC", "Overtime Deduction"],
34
+ tier: "recommended",
35
+ help: "Critical for Entity Structure and QBI calculations.",
36
+ },
37
+ fixed_asset_schedule: {
38
+ name: "Fixed Asset Schedule",
39
+ strategies: ["§179", "Bonus Depreciation §168(k)", "Cost Segregation"],
40
+ tier: "conditional",
41
+ help: "Required for real estate clients (cost segregation). Optional otherwise.",
42
+ },
43
+ state_tax_return: {
44
+ name: "State Return(s)",
45
+ strategies: ["SALT / PTE Optimization", "State Nexus Analysis"],
46
+ tier: "conditional",
47
+ help: "Required if client operates in income-tax states.",
48
+ },
49
+ schedule_k1_s_corp: {
50
+ name: "Schedule K-1 (S-Corp, 1120S)",
51
+ strategies: ["QBI §199A", "S-Corp Basis", "Distributions"],
52
+ tier: "recommended",
53
+ help: "One per shareholder — needed for QBI and basis calculations.",
54
+ },
55
+ schedule_k1_partnership: {
56
+ name: "Schedule K-1 (Partnership, 1065)",
57
+ strategies: ["QBI §199A", "SE Tax", "At-Risk Basis"],
58
+ tier: "recommended",
59
+ help: "One per partner — needed for SE tax and QBI calculations.",
60
+ },
61
+ schedule_se: {
62
+ name: "Schedule SE (Self-Employment Tax)",
63
+ strategies: ["SE Tax Deduction", "S-Corp Conversion"],
64
+ tier: "conditional",
65
+ help: "Required for sole props and GP partners with SE income.",
66
+ },
67
+ form_8829: {
68
+ name: "Form 8829 (Home Office)",
69
+ strategies: ["Home Office Deduction"],
70
+ tier: "conditional",
71
+ help: "Only for sole proprietors who use part of their home for business.",
72
+ },
73
+ form_2553: {
74
+ name: "Form 2553 (S-Corp Election)",
75
+ strategies: ["S-Corp Structure", "Entity Restructuring"],
76
+ tier: "conditional",
77
+ help: "Confirms S-Corp election date and effective year — needed for entity analysis.",
78
+ },
79
+ w3: {
80
+ name: "W-3 (Transmittal of W-2s)",
81
+ strategies: ["S-Corp Salary", "HSA Maximization", "WOTC"],
82
+ tier: "recommended",
83
+ help: "Total wages across all employees — cross-checks payroll records.",
84
+ },
85
+ form_1099_nec_summary: {
86
+ name: "1099-NEC Summary",
87
+ strategies: ["Contractor vs Employee", "R&D Credit"],
88
+ tier: "conditional",
89
+ help: "Required if client paid $600+ to contractors.",
90
+ },
91
+ form_4562: {
92
+ name: "Form 4562 (Depreciation & Amortization)",
93
+ strategies: ["§179", "Bonus Depreciation", "Cost Segregation"],
94
+ tier: "conditional",
95
+ help: "Detailed depreciation schedule — unlocks Section 179 and bonus dep strategies.",
96
+ },
97
+ form_8889: {
98
+ name: "Form 8889 (HSA)",
99
+ strategies: ["HSA Maximization"],
100
+ tier: "conditional",
101
+ help: "Only if client has or is considering an HSA-eligible HDHP.",
102
+ },
103
+ rent_roll: {
104
+ name: "Rent Roll",
105
+ strategies: ["Real Estate — Cost Segregation", "QBI §199A (Rental)"],
106
+ tier: "conditional",
107
+ help: "Required for real estate clients to assess rental income and vacancy.",
108
+ },
109
+ mortgage_loan_documents: {
110
+ name: "Mortgage / Loan Documents",
111
+ strategies: ["Business Interest §163(j)", "Real Estate Strategies"],
112
+ tier: "conditional",
113
+ help: "1098s and loan statements — needed for interest limitation analysis.",
114
+ },
115
+ operating_agreement: {
116
+ name: "Operating Agreement / Partnership Agreement",
117
+ strategies: ["Entity Restructuring", "Special Allocations §704(b)"],
118
+ tier: "conditional",
119
+ help: "LLCs and partnerships — confirms ownership %, distributions, elections.",
120
+ },
121
+ rd_activity_documentation: {
122
+ name: "R&D Activity Documentation",
123
+ strategies: ["R&D Credit §41"],
124
+ tier: "conditional",
125
+ help: "Only if client conducts qualifying research activities.",
126
+ },
127
+ vehicle_mileage_log: {
128
+ name: "Vehicle Mileage Log",
129
+ strategies: ["Vehicle Deduction", "Standard vs Actual Method"],
130
+ tier: "conditional",
131
+ help: "Required for sole props claiming vehicle deductions.",
132
+ },
133
+ };
134
+ // ---------------------------------------------------------------------------
135
+ // Accepted file types — aligned with BE ALLOWED_EXTENSIONS (no .doc)
136
+ // ---------------------------------------------------------------------------
137
+ const ACCEPT_PDF_DOCX = [".pdf", ".docx"];
138
+ const ACCEPT_PDF_DOCX_XLSX = [".pdf", ".docx", ".xlsx", ".xls", ".csv"];
139
+ const ACCEPT_PDF_DOCX_XLSX_IMG = [".pdf", ".docx", ".xlsx", ".xls", ".csv", ".png", ".jpg", ".jpeg"];
140
+ const ACCEPT_BY_TYPE = {
141
+ federal_tax_return: ACCEPT_PDF_DOCX,
142
+ profit_loss: ACCEPT_PDF_DOCX_XLSX,
143
+ balance_sheet: ACCEPT_PDF_DOCX_XLSX,
144
+ payroll_records: ACCEPT_PDF_DOCX_XLSX,
145
+ fixed_asset_schedule: ACCEPT_PDF_DOCX_XLSX,
146
+ state_tax_return: ACCEPT_PDF_DOCX,
147
+ schedule_k1_s_corp: ACCEPT_PDF_DOCX,
148
+ schedule_k1_partnership: ACCEPT_PDF_DOCX,
149
+ schedule_se: ACCEPT_PDF_DOCX,
150
+ form_8829: ACCEPT_PDF_DOCX,
151
+ form_2553: ACCEPT_PDF_DOCX,
152
+ w3: ACCEPT_PDF_DOCX_XLSX_IMG,
153
+ form_1099_nec_summary: ACCEPT_PDF_DOCX_XLSX,
154
+ form_4562: ACCEPT_PDF_DOCX,
155
+ form_8889: ACCEPT_PDF_DOCX,
156
+ rent_roll: ACCEPT_PDF_DOCX_XLSX,
157
+ mortgage_loan_documents: ACCEPT_PDF_DOCX,
158
+ operating_agreement: ACCEPT_PDF_DOCX,
159
+ rd_activity_documentation: ACCEPT_PDF_DOCX_XLSX,
160
+ vehicle_mileage_log: ACCEPT_PDF_DOCX_XLSX,
161
+ };
162
+ // ---------------------------------------------------------------------------
163
+ // Entity → document types map (mirrors BE ENTITY_DOCUMENT_MAP exactly)
164
+ // ---------------------------------------------------------------------------
165
+ const S_CORP_TYPES = [
166
+ "profit_loss", "balance_sheet",
167
+ "federal_tax_return", "payroll_records", "w3", "schedule_k1_s_corp",
168
+ "form_2553", "form_1099_nec_summary", "state_tax_return", "form_4562",
169
+ "form_8889", "fixed_asset_schedule", "rent_roll", "mortgage_loan_documents",
170
+ "operating_agreement", "rd_activity_documentation",
19
171
  ];
20
- function getDocSpecs(profile) {
21
- const states = (profile === null || profile === void 0 ? void 0 : profile.states) || [];
22
- const industry = (profile === null || profile === void 0 ? void 0 : profile.industry) || "";
23
- const allNoTax = states.length > 0 && states.every(s => states_1.NO_INCOME_TAX.has(s));
24
- const isRealEstate = industry === "Real Estate" || industry === "Construction";
25
- return exports.DOC_SPECS_BASE.map(d => {
26
- let req = d.required;
27
- if (d.id === "state-return")
28
- req = allNoTax ? false : "optional";
29
- if (d.id === "fixed-assets")
30
- req = isRealEstate ? true : false;
31
- return Object.assign(Object.assign({}, d), { required: req });
32
- });
172
+ const C_CORP_TYPES = [
173
+ "profit_loss", "balance_sheet",
174
+ "federal_tax_return", "payroll_records", "w3",
175
+ "form_1099_nec_summary", "state_tax_return", "form_4562", "form_8889",
176
+ "fixed_asset_schedule", "rent_roll", "mortgage_loan_documents",
177
+ "operating_agreement", "rd_activity_documentation",
178
+ ];
179
+ const PARTNERSHIP_TYPES = [
180
+ "profit_loss", "balance_sheet",
181
+ "federal_tax_return", "payroll_records", "w3", "schedule_k1_partnership",
182
+ "schedule_se", "form_1099_nec_summary", "state_tax_return", "form_4562",
183
+ "form_8889", "fixed_asset_schedule", "rent_roll", "mortgage_loan_documents",
184
+ "operating_agreement", "rd_activity_documentation",
185
+ ];
186
+ const SOLE_PROP_TYPES = [
187
+ "profit_loss", "balance_sheet",
188
+ "federal_tax_return", "schedule_se", "form_8829", "form_1099_nec_summary",
189
+ "state_tax_return", "form_4562", "form_8889", "fixed_asset_schedule",
190
+ "vehicle_mileage_log", "rent_roll", "mortgage_loan_documents",
191
+ "rd_activity_documentation",
192
+ ];
193
+ const LLC_TYPES = Array.from(new Set([
194
+ ...S_CORP_TYPES, ...C_CORP_TYPES, ...PARTNERSHIP_TYPES, ...SOLE_PROP_TYPES,
195
+ ]));
196
+ const ENTITY_DOCUMENT_TYPES = {
197
+ S_CORP: S_CORP_TYPES,
198
+ C_CORP: C_CORP_TYPES,
199
+ PARTNERSHIP: PARTNERSHIP_TYPES,
200
+ SOLE_PROP: SOLE_PROP_TYPES,
201
+ LLC: LLC_TYPES,
202
+ };
203
+ // ---------------------------------------------------------------------------
204
+ // Build DocSpec list for a given entity type key
205
+ // ---------------------------------------------------------------------------
206
+ function buildDocSpec(documentType) {
207
+ const meta = DOC_META[documentType];
208
+ if (!meta)
209
+ return null;
210
+ return {
211
+ id: documentType,
212
+ documentType,
213
+ name: meta.name,
214
+ accept: ACCEPT_BY_TYPE[documentType] || ACCEPT_PDF_DOCX,
215
+ strategies: meta.strategies,
216
+ required: meta.tier === "required" ? true : meta.tier === "recommended" ? "optional" : "conditional",
217
+ tier: meta.tier,
218
+ help: meta.help,
219
+ };
220
+ }
221
+ // All doc specs across all entity types — used for reverse-mapping strategy → document needs.
222
+ exports.DOC_SPECS_BASE = LLC_TYPES
223
+ .map(buildDocSpec)
224
+ .filter((s) => s !== null);
225
+ function getDocSpecs(entityType) {
226
+ var _a;
227
+ const types = entityType
228
+ ? ((_a = ENTITY_DOCUMENT_TYPES[entityType]) !== null && _a !== void 0 ? _a : LLC_TYPES)
229
+ : LLC_TYPES;
230
+ return types
231
+ .map(buildDocSpec)
232
+ .filter((s) => s !== null);
33
233
  }
@@ -0,0 +1,13 @@
1
+ export interface FieldDef {
2
+ label: string;
3
+ sourceRef?: string;
4
+ }
5
+ export interface SectionDef {
6
+ head: string;
7
+ fields: string[];
8
+ }
9
+ export interface DocFieldCatalog {
10
+ sections: SectionDef[];
11
+ fields: Record<string, FieldDef>;
12
+ }
13
+ export declare const DOCUMENT_FIELD_CATALOG: Record<string, DocFieldCatalog>;