@paro.io/expert-shared-components 1.14.59 → 1.14.61

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 (60) hide show
  1. package/lib/README.md +2 -0
  2. package/lib/components/DocumentCenter/MultiFileUploadSection.js +121 -220
  3. package/lib/components/TaxAxis/TaxAxisApi.d.ts +1 -0
  4. package/lib/components/TaxAxis/TaxAxisShell.js +52 -3
  5. package/lib/components/shared/UploadClient.d.ts +1 -2
  6. package/lib/components/shared/UploadClient.js +2 -6
  7. package/lib/index.d.ts +13 -1
  8. package/lib/index.js +27 -1
  9. package/lib/package.json +68 -0
  10. package/lib/tax-axis/components/clientReport/ExecutiveSummary.d.ts +1 -4
  11. package/lib/tax-axis/components/clientReport/ExecutiveSummary.js +6 -10
  12. package/lib/tax-axis/components/clientReport/Methodology.js +2 -2
  13. package/lib/tax-axis/components/clientReport/RecommendedStrategies.d.ts +1 -6
  14. package/lib/tax-axis/components/clientReport/RecommendedStrategies.js +24 -26
  15. package/lib/tax-axis/components/clientReport/StrategyCard.d.ts +1 -1
  16. package/lib/tax-axis/components/clientReport/StrategyCard.js +23 -39
  17. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +2 -5
  18. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +7 -9
  19. package/lib/tax-axis/components/dashboard/DashboardActions.js +5 -6
  20. package/lib/tax-axis/components/dashboard/DashboardSummary.d.ts +1 -6
  21. package/lib/tax-axis/components/dashboard/DashboardSummary.js +10 -19
  22. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.d.ts +1 -1
  23. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.js +95 -122
  24. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +4 -59
  25. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +49 -433
  26. package/lib/tax-axis/components/documents/DocumentCard.d.ts +3 -8
  27. package/lib/tax-axis/components/documents/DocumentCard.js +14 -83
  28. package/lib/tax-axis/components/documents/DocumentTier.d.ts +2 -5
  29. package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
  30. package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +8 -28
  31. package/lib/tax-axis/components/documents/TaxAxisDocuments.js +86 -363
  32. package/lib/tax-axis/components/extractionReview/TaxAxisExtractionReview.js +17 -17
  33. package/lib/tax-axis/components/intake/ClientParametersSection.js +30 -14
  34. package/lib/tax-axis/components/intake/CpaIntakeQuestionsSection.js +3 -3
  35. package/lib/tax-axis/components/intake/IntakeCtaCards.d.ts +2 -1
  36. package/lib/tax-axis/components/intake/IntakeCtaCards.js +13 -6
  37. package/lib/tax-axis/components/intake/RefineAnalysisSection.js +7 -7
  38. package/lib/tax-axis/components/intake/TaxAxisIntake.js +45 -6
  39. package/lib/tax-axis/components/intake/intakeSchema.d.ts +3 -0
  40. package/lib/tax-axis/components/intake/intakeSchema.js +4 -2
  41. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +4 -23
  42. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +4 -15
  43. package/lib/tax-axis/components/processing/TaxAxisProcessing.d.ts +1 -2
  44. package/lib/tax-axis/components/processing/TaxAxisProcessing.js +31 -102
  45. package/lib/tax-axis/components/prospectReport/ProspectPrintView.js +2 -0
  46. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.d.ts +8 -1
  47. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.js +5 -5
  48. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.d.ts +27 -1
  49. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.js +43 -25
  50. package/lib/tax-axis/index.d.ts +0 -4
  51. package/lib/tax-axis/index.js +1 -6
  52. package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +13 -138
  53. package/lib/tax-axis/lib/adapters/useEngineOutput.js +7 -156
  54. package/lib/tax-axis/lib/data/documents.d.ts +2 -3
  55. package/lib/tax-axis/lib/data/documents.js +25 -225
  56. package/lib/tax-axis/lib/data/strategies.js +9 -9
  57. package/lib/tax-axis/lib/documentFieldCatalog.d.ts +12 -7
  58. package/lib/tax-axis/lib/documentFieldCatalog.js +8 -805
  59. package/lib/tax-axis/lib/types/index.d.ts +1 -13
  60. package/package.json +1 -1
@@ -1,161 +1,12 @@
1
1
  "use strict";
2
- // ═══════════════════════════════════════════════════════════════════
3
- // useEngineOutput adapts live EngineOutput from paro-graphql-api
4
- // into the Strategy[] + ComputedMap shapes the FE components consume.
5
- //
6
- // Strategy: use the static STRATEGIES catalog as a structural template
7
- // (rank, cat, entities, authority, etc.) and override savings/priority/score
8
- // from the live engine data. Falls back to static data when a strategy_id
9
- // has no match in the catalog (future-proofing for new strategies).
10
- // ═══════════════════════════════════════════════════════════════════
2
+ // useEngineOutput — minimal stub to unblock builds.
3
+ // TODO: centralise narrative-field mapping (why_it_applies, source_documents, specialistNote) here.
11
4
  Object.defineProperty(exports, "__esModule", { value: true });
12
5
  exports.useEngineOutput = useEngineOutput;
13
6
  const react_1 = require("react");
14
- const data_1 = require("../data");
15
- // ── Strategy ID rank mapping (S1..S26 rank 1..25 catalog) ───────
16
- // Maps engine strategy_ids like "S2", "S5" etc. to catalog ranks.
17
- // Built once from the static STRATEGIES array by matching code/name heuristics.
18
- const ENGINE_ID_TO_RANK = {
19
- S1: 1, // Business Entity Structure (S-Corp election)
20
- S2: 2, // Section 179
21
- S3: 3, // Bonus Depreciation §168(k)
22
- S4: 4, // QBI §199A
23
- S5: 5, // R&D Credit §41
24
- S6: 6, // WOTC §51
25
- S7: 7, // Retirement Plan
26
- S8: 8, // Cost Segregation
27
- S9: 9, // HSA
28
- S10: 10, // Business Meals
29
- S11: 11, // Professional Services / Legal
30
- S12: 12, // Home Office
31
- S13: 13, // Health Care Credit §45R
32
- S14: 14, // Charitable / DAF
33
- S15: 15, // SALT PTE
34
- S16: 16, // §163(j) Interest
35
- S17: 17, // Income Deferral
36
- S18: 18, // Opportunity Zone §1400Z
37
- S19: 19, // §179D Energy
38
- S20: 20, // Accounting Method
39
- S21: 21, // OBBBA Overtime
40
- S22: 22, // OBBBA Tips / Overtime
41
- S23: 23, // §174A R&E catch-up
42
- S24: 24, // Childcare §45F
43
- S25: 25, // OBBBA Trump Accounts
44
- };
45
- const CATALOG_BY_RANK = new Map(data_1.STRATEGIES.map((s) => [s.rank, s]));
46
- // ── Priority tier mapping ─────────────────────────────────────────────
47
- function mapPriority(tier, quickWin) {
48
- if (quickWin)
49
- return "QUICK WIN";
50
- if (tier === "HIGH")
51
- return "HIGH";
52
- if (tier === "MEDIUM")
53
- return "MEDIUM";
54
- if (tier === "LOW")
55
- return "LOW";
56
- return "NOT RECOMMENDED";
57
- }
58
- // ── Timeline bucket from implementation_roadmap ───────────────────────
59
- function resolveTimelineBucket(strategyId, roadmap) {
60
- if (roadmap.quick_wins.some((r) => r.strategy_id === strategyId))
61
- return "now";
62
- if (roadmap.immediate.some((r) => r.strategy_id === strategyId))
63
- return "now";
64
- if (roadmap.thirty_day.some((r) => r.strategy_id === strategyId))
65
- return "30d";
66
- if (roadmap.ninety_day.some((r) => r.strategy_id === strategyId))
67
- return "90d";
68
- if (roadmap.annual.some((r) => r.strategy_id === strategyId))
69
- return "filing";
70
- return "filing";
71
- }
72
- // ── CalculationTrace → StrategyTraceStep[] ───────────────────────────
73
- function traceFromEngine(trace) {
74
- var _a, _b;
75
- const steps = [];
76
- // Emit formula as step 1
77
- if (trace.formula) {
78
- steps.push({
79
- n: 1,
80
- step: "Formula",
81
- formula: trace.formula,
82
- result: trace.result_gross != null ? `$${trace.result_gross.toLocaleString()}` : "See CI",
83
- src: trace.irs_cite || "",
84
- });
85
- }
86
- // Emit confidence interval as step 2 when present
87
- if (((_a = trace.confidence_interval) === null || _a === void 0 ? void 0 : _a.low) != null && ((_b = trace.confidence_interval) === null || _b === void 0 ? void 0 : _b.high) != null) {
88
- steps.push({
89
- n: 2,
90
- step: "Confidence range",
91
- formula: `Low × ${trace.confidence_interval.basis}`,
92
- result: `$${trace.confidence_interval.low.toLocaleString()} – $${trace.confidence_interval.high.toLocaleString()}`,
93
- src: trace.irs_cite || "",
94
- });
95
- }
96
- return steps;
97
- }
98
- function adaptEngineOutput(engineOutput) {
99
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
100
- const strategies = [];
101
- const computedMap = new Map();
102
- for (const analysis of engineOutput.strategy_analysis) {
103
- if (analysis.priority_tier === "NOT_RECOMMENDED")
104
- continue;
105
- const rank = ENGINE_ID_TO_RANK[analysis.strategy_id];
106
- const template = rank != null ? CATALOG_BY_RANK.get(rank) : undefined;
107
- const trace = analysis.calculation_trace;
108
- const ci = trace === null || trace === void 0 ? void 0 : trace.confidence_interval;
109
- const lo = (_b = (_a = ci === null || ci === void 0 ? void 0 : ci.low) !== null && _a !== void 0 ? _a : template === null || template === void 0 ? void 0 : template.lo) !== null && _b !== void 0 ? _b : 0;
110
- const hi = (_d = (_c = ci === null || ci === void 0 ? void 0 : ci.high) !== null && _c !== void 0 ? _c : template === null || template === void 0 ? void 0 : template.hi) !== null && _d !== void 0 ? _d : 0;
111
- const timelineBucket = resolveTimelineBucket(analysis.strategy_id, engineOutput.implementation_roadmap);
112
- const clientSummaryEntry = engineOutput.client_summary.strategies.find((cs) => cs.strategy_name === analysis.strategy_name);
113
- const strategy = {
114
- rank: rank !== null && rank !== void 0 ? rank : 99,
115
- code: (_e = template === null || template === void 0 ? void 0 : template.code) !== null && _e !== void 0 ? _e : analysis.strategy_id,
116
- name: analysis.strategy_name,
117
- cat: (_f = template === null || template === void 0 ? void 0 : template.cat) !== null && _f !== void 0 ? _f : "deductions",
118
- priority: mapPriority(analysis.priority_tier, analysis.quick_win),
119
- score: Math.round(analysis.weighted_score),
120
- entities: (_g = template === null || template === void 0 ? void 0 : template.entities) !== null && _g !== void 0 ? _g : ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
121
- lo,
122
- hi,
123
- timeline: (_h = template === null || template === void 0 ? void 0 : template.timeline) !== null && _h !== void 0 ? _h : timelineBucket,
124
- timelineBucket,
125
- authority: (_j = trace === null || trace === void 0 ? void 0 : trace.irs_cite) !== null && _j !== void 0 ? _j : template === null || template === void 0 ? void 0 : template.authority,
126
- forms: (_l = (_k = trace === null || trace === void 0 ? void 0 : trace.forms_required) === null || _k === void 0 ? void 0 : _k.join(", ")) !== null && _l !== void 0 ? _l : template === null || template === void 0 ? void 0 : template.forms,
127
- warning: (_o = (_m = analysis.risk_disclosure) !== null && _m !== void 0 ? _m : template === null || template === void 0 ? void 0 : template.warning) !== null && _o !== void 0 ? _o : null,
128
- abstract: analysis.engagement_recommendation,
129
- trace: traceFromEngine(trace),
130
- needsPTE: template === null || template === void 0 ? void 0 : template.needsPTE,
131
- onlyIndustry: template === null || template === void 0 ? void 0 : template.onlyIndustry,
132
- excludeIndustry: template === null || template === void 0 ? void 0 : template.excludeIndustry,
133
- preferIndustry: template === null || template === void 0 ? void 0 : template.preferIndustry,
134
- minEmployees: template === null || template === void 0 ? void 0 : template.minEmployees,
135
- needsOwnerComp: template === null || template === void 0 ? void 0 : template.needsOwnerComp,
136
- clientBrief: (_p = clientSummaryEntry === null || clientSummaryEntry === void 0 ? void 0 : clientSummaryEntry.why_it_applies) !== null && _p !== void 0 ? _p : template === null || template === void 0 ? void 0 : template.clientBrief,
137
- action: (_q = clientSummaryEntry === null || clientSummaryEntry === void 0 ? void 0 : clientSummaryEntry.next_step) !== null && _q !== void 0 ? _q : template === null || template === void 0 ? void 0 : template.action,
138
- sourceDocuments: (_r = trace === null || trace === void 0 ? void 0 : trace.source_documents) !== null && _r !== void 0 ? _r : [],
139
- quickWin: analysis.quick_win,
140
- positionStrength: (_s = trace === null || trace === void 0 ? void 0 : trace.position_strength) !== null && _s !== void 0 ? _s : undefined,
141
- specialistNote: (_t = trace === null || trace === void 0 ? void 0 : trace.specialist_note) !== null && _t !== void 0 ? _t : undefined,
142
- };
143
- strategies.push(strategy);
144
- computedMap.set(strategy.rank, {
145
- lo,
146
- hi,
147
- trace: strategy.trace,
148
- });
149
- }
150
- // Sort by weighted_score descending (same ordering the FE uses)
151
- strategies.sort((a, b) => b.score - a.score);
152
- return { strategies, computedMap, engineOutput };
153
- }
154
- // ── React hook ────────────────────────────────────────────────────────
155
- function useEngineOutput(engineOutput) {
156
- return (0, react_1.useMemo)(() => {
157
- if (!engineOutput)
158
- return null;
159
- return adaptEngineOutput(engineOutput);
160
- }, [engineOutput]);
7
+ // ---------------------------------------------------------------------------
8
+ // Hook pass-through stub (returns null, no mapping yet)
9
+ // ---------------------------------------------------------------------------
10
+ function useEngineOutput(_engineOutput) {
11
+ return (0, react_1.useMemo)(() => null, [_engineOutput]);
161
12
  }
@@ -1,4 +1,3 @@
1
- import { DocSpec } from "../types";
2
- export type TaxAxisEntityTypeKey = "S_CORP" | "C_CORP" | "PARTNERSHIP" | "LLC" | "SOLE_PROP";
1
+ import type { ClientProfile, DocSpec } from "../types";
3
2
  export declare const DOC_SPECS_BASE: DocSpec[];
4
- export declare function getDocSpecs(entityType?: TaxAxisEntityTypeKey | string | null): DocSpec[];
3
+ export declare function getDocSpecs(profile?: ClientProfile): DocSpec[];
@@ -1,233 +1,33 @@
1
1
  "use strict";
2
2
  // ═══════════════════════════════════════════════════════════════════
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.
3
+ // TaxAxis — Document checklist base + profile-aware resolver
4
+ // Verbatim from the mock (App.jsx:575-603).
8
5
  // ═══════════════════════════════════════════════════════════════════
9
6
  Object.defineProperty(exports, "__esModule", { value: true });
10
7
  exports.DOC_SPECS_BASE = void 0;
11
8
  exports.getDocSpecs = getDocSpecs;
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",
9
+ const states_1 = require("./states");
10
+ exports.DOC_SPECS_BASE = [
11
+ { id: "1120s", name: "Federal Tax Return (1120S/1065/1040)", accept: [".pdf"], 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"], 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"], 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"], 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"], 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"], 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"], 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"], 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%." },
171
19
  ];
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);
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
+ });
233
33
  }
@@ -7,31 +7,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ADDITIONAL = exports.STRATEGIES = void 0;
8
8
  /* ═══ 25 FEDERAL STRATEGIES (L2-1, OBBBA-Updated) ═══ */
9
9
  exports.STRATEGIES = [
10
- { rank: 1, name: "Business Entity Structure", code: "§3121", cat: "entity", needsOwnerComp: true, lo: 8400, hi: 12100, score: 72, priority: "HIGH", timeline: "30 days", timelineBucket: "30d",
10
+ { rank: 1, name: "Business Entity Structure", code: "§3121", cat: "entity", needsOwnerComp: true, lo: 6000, hi: 14000, score: 72, priority: "HIGH", timeline: "30 days", timelineBucket: "30d",
11
11
  authority: "IRC §3121 · Rev. Rul. 74-44", forms: "BLS comp memo", warning: "Salary below 50%-of-profit threshold. BLS memo required.", entities: ["S-Corporation"],
12
12
  abstract: "S-Corporation distributions above a 'reasonable salary' bypass 15.3% self-employment tax. Salary benchmarked against BLS industry reference ranges — NOT a 40% heuristic.",
13
13
  sources: [{ doc: "Form W-3", line: "Box 1", value: "$65,000", field: "Officer W-2 Salary" }, { doc: "Form 1120S", line: "Line 1", value: "$142,000", field: "Net Profit" }, { doc: "BLS OES 2025", line: "NAICS 54", value: "$58.2K–$112.6K", field: "Industry Range" }],
14
14
  trace: [{ n: 1, step: "Current salary", formula: "Form W-3", result: "$65,000", src: "W-3" }, { n: 2, step: "BLS benchmark", formula: "25th pctl", result: "$58,200", src: "BLS" }, { n: 3, step: "50% threshold", formula: "50% × $142K", result: "$71,000", src: "Rev. Rul. 74-44" }, { n: 4, step: "SE tax avoided", formula: "$77K × 14.13%", result: "$10,881/yr", src: "IRC §3111" }],
15
15
  clientBrief: "Your S-Corp structure saves significant employment taxes. We document why your salary is reasonable.", action: "Prepare BLS documentation memo before next payroll cycle", cost: "$300–$500" },
16
- { rank: 2, name: "Section 179 Expensing", code: "§179", cat: "depreciation", lo: 4200, hi: 18500, score: 88, priority: "HIGH", timeline: "File now", timelineBucket: "now",
16
+ { rank: 2, name: "Section 179 Expensing", code: "§179", cat: "depreciation", lo: 8000, hi: 22000, score: 88, priority: "HIGH", timeline: "File now", timelineBucket: "now",
17
17
  authority: "IRC §179 · Rev. Proc. 2025-32", forms: "Form 4562", warning: null, entities: ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
18
18
  abstract: "Immediately expense qualifying equipment and software up to $1,250,000 for 2026. Phase-out begins at $3,130,000.",
19
19
  sources: [{ doc: "Fixed Asset Schedule", line: "2026 additions", value: "$87,000", field: "Equipment Purchases" }, { doc: "Rev. Proc. 2025-32", line: "Table 4", value: "$1,250,000", field: "2026 §179 Limit" }],
20
20
  trace: [{ n: 1, step: "Qualifying purchases", formula: "Fixed asset schedule", result: "$87,000", src: "Asset Sched." }, { n: 2, step: "Phase-out check", formula: "$87K << $3.13M", result: "Full deduction", src: "Rev. Proc." }, { n: 3, step: "Immediate deduction", formula: "$87,000 × 100%", result: "$87,000", src: "IRC §179" }],
21
21
  clientBrief: "All qualifying equipment purchases can be fully expensed this year instead of depreciated over time.", action: "Claim on return — confirm asset list with preparer", cost: "$0" },
22
- { rank: 3, name: "Bonus Depreciation §168(k)", code: "§168(k)", cat: "depreciation", lo: 6800, hi: 32000, score: 90, priority: "HIGH", timeline: "File now", timelineBucket: "now",
22
+ { rank: 3, name: "Bonus Depreciation §168(k)", code: "§168(k)", cat: "depreciation", lo: 8000, hi: 22000, score: 90, priority: "HIGH", timeline: "File now", timelineBucket: "now",
23
23
  authority: "IRC §168(k) · OBBBA §70301", forms: "Form 4562", warning: null, entities: ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
24
24
  abstract: "OBBBA made 100% bonus depreciation PERMANENT for property placed in service after Jan 19, 2025. No more phase-down.",
25
25
  sources: [{ doc: "Fixed Asset Schedule", line: "2026 additions", value: "$87,000", field: "Qualifying Property" }, { doc: "OBBBA §70301", line: "Sec. 1", value: "100%", field: "Permanent Rate" }],
26
26
  trace: [{ n: 1, step: "Qualifying property", formula: "Recovery period ≤ 20 yrs", result: "$87,000", src: "Asset Sched." }, { n: 2, step: "Bonus rate", formula: "OBBBA permanent 100%", result: "100%", src: "OBBBA §70301" }],
27
27
  clientBrief: "100% bonus depreciation is now permanent under OBBBA. All qualifying assets get full first-year write-off.", action: "Review fixed asset schedule for qualifying additions", cost: "$0" },
28
- { rank: 4, name: "QBI Deduction §199A", code: "§199A", cat: "income", lo: 18200, hi: 24700, score: 87, priority: "HIGH", timeline: "File now", timelineBucket: "now",
28
+ { rank: 4, name: "QBI Deduction §199A", code: "§199A", cat: "income", lo: 8000, hi: 22000, score: 87, priority: "HIGH", timeline: "File now", timelineBucket: "now",
29
29
  authority: "IRC §199A · OBBBA §70105 · Rev. Proc. 2025-32", forms: "Form 8995", warning: null, entities: ["S-Corporation", "Partnership/LLC", "Sole Proprietorship"],
30
30
  abstract: "OBBBA-updated §199A: 23% rate, three-branch formula based on entity type, SSTB status, and W-2 wages or property basis.",
31
31
  sources: [{ doc: "Form 1120S", line: "Line 1", value: "$142,000", field: "QBI Base" }, { doc: "Form W-3", line: "Box 1", value: "$48,000", field: "W-2 Wages" }, { doc: "Rev. Proc. 2025-32", line: "Table 3", value: "$191,950", field: "Phase-Out" }],
32
32
  trace: [{ n: 1, step: "QBI", formula: "Net income from 1120S", result: "$142,000", src: "1120S" }, { n: 2, step: "Branch selection", formula: "$184K < $191,950 → Branch 1", result: "Branch 1", src: "Rev. Proc." }, { n: 3, step: "Tentative deduction", formula: "$142,000 × 23%", result: "$32,660", src: "OBBBA §70105" }, { n: 4, step: "W-2 wage cap", formula: "50% × $48,000", result: "$24,000 ← binding", src: "W-3" }, { n: 5, step: "Net savings", formula: "$24,000 × rate", result: "$21,276", src: "Eff. rate" }],
33
33
  clientBrief: "The QBI deduction shelters up to 23% of your business income. Nothing changes about how you run your business.", action: "Claim on return — no client action required", cost: "$0" },
34
- { rank: 5, name: "R&D Credit §41", code: "§41", cat: "credits", excludeIndustry: ["Restaurant / Hospitality", "Education", "Agriculture", "Retail / E-Commerce"], lo: 8500, hi: 45000, score: 82, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
34
+ { rank: 5, name: "R&D Credit §41", code: "§41", cat: "credits", excludeIndustry: ["Restaurant / Hospitality", "Education", "Agriculture", "Retail / E-Commerce"], lo: 4000, hi: 18000, score: 82, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
35
35
  authority: "IRC §41 · OBBBA §174A", forms: "Form 6765", warning: "R&D documentation required.", entities: ["S-Corporation", "C-Corporation", "Partnership/LLC"],
36
36
  abstract: "OBBBA restored immediate expensing for domestic R&E. The R&D credit provides dollar-for-dollar reduction. Small businesses can offset payroll taxes.",
37
37
  sources: [{ doc: "Client intake", line: "R&D activities", value: "Yes", field: "R&D Eligible" }, { doc: "Expense Report", line: "R&D categories", value: "$120,000", field: "Qualified Research Expenses" }],
@@ -43,19 +43,19 @@ exports.STRATEGIES = [
43
43
  sources: [{ doc: "Payroll", line: "New hires", value: "3", field: "2026 Hires" }, { doc: "DOL", line: "Target groups", value: "2 qualifying", field: "Eligible" }],
44
44
  trace: [{ n: 1, step: "Qualifying hires", formula: "Screening", result: "2 employees", src: "Payroll" }, { n: 2, step: "Credit", formula: "40% × qualifying wages", result: "$4,800", src: "§51(a)" }],
45
45
  clientBrief: "Two recent hires may qualify for the Work Opportunity Tax Credit worth up to $9,600.", action: "Submit Form 8850 within 28 days of hire", cost: "$200–$500" },
46
- { rank: 7, name: "Retirement Plan Upgrade", code: "§401(k)", cat: "retirement", lo: 12500, hi: 16800, score: 91, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
46
+ { rank: 7, name: "Retirement Plan Upgrade", code: "§401(k)", cat: "retirement", lo: 8000, hi: 28000, score: 91, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
47
47
  authority: "IRC §401(k) · SECURE 2.0 · Rev. Proc. 2025-32", forms: "Solo 401(k) · Form 5500-EZ", warning: null, entities: ["S-Corporation", "Partnership/LLC", "Sole Proprietorship"],
48
48
  abstract: "Solo 401(k) unlocks $23,500 employee deferral + 25% employer match. SECURE 2.0 adds startup credit up to $5,000/yr for 3 years.",
49
49
  sources: [{ doc: "K-1", line: "Line 13", value: "$14,500", field: "Current SEP-IRA" }, { doc: "W-3", line: "Box 1", value: "$65,000", field: "W-2 Comp" }, { doc: "Rev. Proc.", line: "Table 1", value: "$23,500", field: "2026 Deferral" }],
50
50
  trace: [{ n: 1, step: "Current SEP", formula: "K-1 Line 13", result: "$14,500", src: "K-1" }, { n: 2, step: "Solo 401(k) EE", formula: "2026 deferral", result: "$23,500", src: "Rev. Proc." }, { n: 3, step: "Solo 401(k) ER", formula: "25% × $65K", result: "$16,250", src: "§415(c)" }, { n: 4, step: "Incremental", formula: "$39,750 − $14,500", result: "$25,250", src: "Calc." }],
51
51
  clientBrief: "Switching retirement account type shelters an extra $25,000.", action: "Open Solo 401(k) by Dec 31, 2026", cost: "$200–$400" },
52
- { rank: 8, name: "Cost Segregation", code: "§168", cat: "depreciation", preferIndustry: ["Real Estate", "Construction"], lo: 15000, hi: 85000, score: 89, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
52
+ { rank: 8, name: "Cost Segregation", code: "§168", cat: "depreciation", preferIndustry: ["Real Estate", "Construction"], lo: 0, hi: 8000, score: 89, priority: "HIGH", timeline: "90 days", timelineBucket: "90d",
53
53
  authority: "IRC §168 · OBBBA §70301", forms: "Form 4562 · Engineering Study", warning: "Property ≥ $500K. Combined with 100% bonus depreciation.", entities: ["S-Corporation", "C-Corporation", "Partnership/LLC"],
54
54
  abstract: "Reclassifies building components from 39-year to 5/7/15-year recovery. Massive first-year deductions with permanent 100% bonus depreciation.",
55
55
  sources: [{ doc: "Intake", line: "Property value", value: "$1,200,000", field: "Commercial RE" }, { doc: "Intake", line: "Year acquired", value: "2024", field: "Acquisition Year" }],
56
56
  trace: [{ n: 1, step: "Eligible property", formula: "Value ≥ $500K", result: "$1.2M", src: "Intake" }, { n: 2, step: "Reclassifiable", formula: "20–40% typical", result: "$300,000", src: "Industry avg" }, { n: 3, step: "Bonus depreciation", formula: "100% permanent", result: "$300K yr 1", src: "OBBBA" }],
57
57
  clientBrief: "A cost segregation study on your commercial property could accelerate $300K+ in deductions to this year.", action: "Engage cost segregation engineer. 4–8 weeks.", cost: "$5,000–$15,000" },
58
- { rank: 9, name: "HSA Maximization", code: "§223", cat: "benefits", lo: 1800, hi: 2400, score: 94, priority: "QUICK WIN", timeline: "This week", timelineBucket: "now",
58
+ { rank: 9, name: "HSA Maximization", code: "§223", cat: "benefits", lo: 2800, hi: 5250, score: 94, priority: "QUICK WIN", timeline: "This week", timelineBucket: "now",
59
59
  authority: "IRC §223 · Rev. Proc. 2025-32", forms: "Form 8889", warning: null, entities: ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
60
60
  abstract: "HSA contributions are triple-tax-advantaged. $4,350 remaining below the 2026 family limit of $8,550.",
61
61
  sources: [{ doc: "Payroll", line: "HSA election", value: "$4,200", field: "Current YTD" }, { doc: "Benefits", line: "Plan type", value: "HDHP", field: "Family" }, { doc: "Rev. Proc.", line: "Table 2", value: "$8,550", field: "2026 Limit" }],
@@ -109,7 +109,7 @@ exports.STRATEGIES = [
109
109
  sources: [{ doc: "1120S", line: "Revenue", value: "$500,000", field: "Revenue" }, { doc: "QBO", line: "AR aging", value: "$42,000", field: "Receivables" }],
110
110
  trace: [{ n: 1, step: "Cash method", formula: "Revenue ≤ $27M", result: "Eligible", src: "§448" }, { n: 2, step: "Deferral", formula: "Q4 timing", result: "$20K–$40K", src: "QBO" }],
111
111
  clientBrief: "Strategic timing of invoicing can defer $20K–$40K of income to next year.", action: "Review Q4 billing schedule", cost: "$0" },
112
- { rank: 18, name: "Opportunity Zone §1400Z", code: "§1400Z", cat: "investment", lo: 5000, hi: 25000, score: 55, priority: "LOW", timeline: "Year-end", timelineBucket: "90d",
112
+ { rank: 18, name: "Opportunity Zone §1400Z", code: "§1400Z", cat: "investment", lo: 0, hi: 0, score: 55, priority: "LOW", timeline: "Year-end", timelineBucket: "90d",
113
113
  authority: "IRC §1400Z · OBBBA transition rules", forms: "Form 8996 · Form 8997", warning: "Confirm deferred gain recognition under OBBBA transition rules.", entities: ["S-Corporation", "C-Corporation", "Partnership/LLC", "Sole Proprietorship"],
114
114
  abstract: "Rural QOZ improvement threshold reduced to 50%. QOF investments defer and potentially eliminate capital gains.",
115
115
  sources: [{ doc: "Brokerage", line: "Gains", value: "$85,000", field: "Cap Gains" }],
@@ -1,13 +1,18 @@
1
- export interface FieldDef {
2
- label: string;
1
+ export interface CatalogFieldDef {
2
+ label?: string;
3
3
  sourceRef?: string;
4
4
  }
5
- export interface SectionDef {
5
+ export interface CatalogSection {
6
6
  head: string;
7
7
  fields: string[];
8
8
  }
9
- export interface DocFieldCatalog {
10
- sections: SectionDef[];
11
- fields: Record<string, FieldDef>;
9
+ export interface CatalogEntry {
10
+ sections: CatalogSection[];
11
+ fields: Record<string, CatalogFieldDef>;
12
12
  }
13
- export declare const DOCUMENT_FIELD_CATALOG: Record<string, DocFieldCatalog>;
13
+ /**
14
+ * Keyed by documentType string (e.g. "1040", "W2", "1099").
15
+ * Empty for now — DocumentReviewModal falls back to flat field rendering
16
+ * when the documentType has no catalog entry (line 84-96).
17
+ */
18
+ export declare const DOCUMENT_FIELD_CATALOG: Record<string, CatalogEntry>;