diff --git a/app/tax/page.tsx b/app/tax/page.tsx index b471a5c..976aad1 100644 --- a/app/tax/page.tsx +++ b/app/tax/page.tsx @@ -72,7 +72,6 @@ export default function TaxPage() { const [returns, setReturns] = useState([]); const [status, setStatus] = useState(""); const [loading, setLoading] = useState(true); - const [useSample, setUseSample] = useState(true); const [selectedReturnId, setSelectedReturnId] = useState(""); const [intake, setIntake] = useState(emptyIntake); const [readiness, setReadiness] = useState(null); @@ -81,38 +80,14 @@ export default function TaxPage() { const [filingType, setFilingType] = useState<"individual" | "business">("individual"); const [jurisdictions, setJurisdictions] = useState(["CA", "NY"]); - const sampleProfile = { - taxpayer: { - name: "John Doe", - ssn: "111-22-3333", - dob: "1989-04-12", - filingStatus: "Single", - address: "123 Market St, San Francisco, CA" - }, - income: { - w2: [{ employer: "Northwind Labs", wages: 92000, federalWithheld: 12000 }], - interest: [{ payer: "City Bank", amount: 320 }], - dividends: [{ payer: "Index Fund", amount: 480 }], - selfEmployment: [{ business: "Doe Consulting", income: 28000, expenses: 6400 }] - }, - deductions: { - standard: true, - charitable: 600, - studentLoanInterest: 900 - }, - credits: { - education: 0, - childTax: 0 - }, - documents: [ - { docType: "w2_or_1099", label: "W-2 / 1099 income forms" }, - { docType: "interest_and_dividend_forms", label: "1099-INT / 1099-DIV forms" }, - { docType: "deduction_support", label: "Deduction support" }, - { docType: "identity_information", label: "Identity information" }, - { docType: "state_withholding_statement", label: "State withholding statement" }, - { docType: "health_insurance_statement", label: "Health insurance 1095-A" } - ] - }; + const requiredDocuments = [ + { docType: "w2_or_1099", label: "W-2 / 1099 income forms" }, + { docType: "interest_and_dividend_forms", label: "1099-INT / 1099-DIV forms" }, + { docType: "deduction_support", label: "Deduction support" }, + { docType: "identity_information", label: "Identity information" }, + { docType: "state_withholding_statement", label: "State withholding statement" }, + { docType: "health_insurance_statement", label: "Health insurance 1095-A" } + ]; const states = [ { code: "AL", name: "Alabama" }, @@ -205,45 +180,11 @@ export default function TaxPage() { setStatus(response.error?.message ?? "Unable to create return."); return; } - if (useSample) { - await Promise.all( - sampleProfile.documents.map((document) => - apiFetch(`/api/tax/returns/${response.data.id}/documents`, { - method: "POST", - body: JSON.stringify({ - docType: document.docType, - metadata: { source: "sample", label: document.label, taxpayer: sampleProfile.taxpayer.name }, - }), - }), - ), - ); - } setStatus("Return created."); await loadReturns(); setSelectedReturnId(response.data.id); - if (useSample) { - const sampleIntake = intakeFromSample(); - setIntake(sampleIntake); - await saveIntake(response.data.id, sampleIntake, true); - } - }; - - const intakeFromSample = (): TaxIntake => { - const wages = sampleProfile.income.w2.reduce((sum, item) => sum + item.wages, 0); - const business = sampleProfile.income.selfEmployment.reduce((sum, item) => sum + item.income - item.expenses, 0); - const interest = sampleProfile.income.interest.reduce((sum, item) => sum + item.amount, 0); - const dividends = sampleProfile.income.dividends.reduce((sum, item) => sum + item.amount, 0); - return { - taxpayer: { - name: sampleProfile.taxpayer.name, - filingStatus: sampleProfile.taxpayer.filingStatus, - address: sampleProfile.taxpayer.address, - }, - income: { wages, business, interest, dividends, total: wages + business + interest + dividends }, - deductions: sampleProfile.deductions, - credits: sampleProfile.credits, - notes: "Sample intake generated from John Doe dataset.", - }; + setIntake(emptyIntake); + setReadiness(null); }; const selectReturn = async (ret: TaxReturn) => { @@ -345,28 +286,6 @@ export default function TaxPage() {

Create a return

-
-
-
-

Sample dataset

-

Use John Doe sample intake data.

-
- -
- {useSample ? ( -
-

W-2 wages: $92,000 - 1099-NEC: $28,000

-

Standard deduction - CA + NY filings

-
- ) : null} -

Required documents

- {sampleProfile.documents.map((doc) => ( + {requiredDocuments.map((doc) => (
{doc.label} Pending