Skip to content

feat(taxes): read fidelity tax info ytd summary into the dataset and the sheet - #440

Merged
daggerok merged 1 commit into
mainfrom
feat/tax-summary-read
Dec 3, 2026
Merged

daggerok merged 1 commit into
mainfrom
feat/tax-summary-read

Conversation

@daggerok

@daggerok daggerok commented Dec 3, 2026

Copy link
Copy Markdown
Owner

What

  • src/shared/tax-summary.ts: the Tax Info YTD summary read (POST /ftgw/digital/api-ytd-tax-info/api/tax-info-summary/v1, body { returnGainLoss, acctDetails, taxYear }), its parser (box rows of recordType A with a number, zeros kept, texts like Various and N/A and the total rows left out, short and long term gains, throws when the accounts list is gone), the years to read (the year before too from January 1 to April 15), the merge per year, the due rule (every hour and after a Positions read, never within 5 minutes) and the sheet rows
  • The read is the fifth allowed page POST (history-sync.ts ALLOWED, no extra headers)
  • main.ts syncTaxSummary: the taxable accounts on the page (Roth and other retirement accounts get no 1099), one request a year for all of them, stored in the dataset (taxSummary, taxSummaryAt), its own read time per account (here.ts kind taxSummary), a notice the first time and when the sheet got new numbers (taxSummaryRead, EN and RU)
  • Sheets: data set taxes, tab fidelity_tax_summary (account_number, tax_year, form_type, box_number, amount, as_of; gains as form gain-loss, box short-term or long-term); the viewer reads it back into the dataset like fidelity_performance
  • Fixture with the answer's real structure and made-up accounts and amounts; README; userscript 0.1.89

Why

Owner 2026-12-03 asked for a Fidelity Tax Summary and allowed the read ("no read as you reading, its not so hard": along with the other reads). This PR brings the data; the viewer page comes next

Checks

  • bun test (561 pass, 0 fail)
  • bun run userscript (0.1.89)
  • parcel build --no-cache --no-source-maps --dist-dir ./.check/out + DIST=.check/out bun src/build/postbuild.ts, then rm -rf .check
  • .claude/tools/etfs/tc/check.sh on every changed or new .ts file: prints nothing
  • git diff --check

…the sheet

The userscript reads the Tax Info YTD summary (the read Fidelity's own page makes) of the taxable accounts on the page, every hour and after a Positions read, never within 5 minutes; the year before too until April 15. New data set taxes and tab fidelity_tax_summary; the dataset carries taxSummary and taxSummaryAt. Userscript 0.1.89.
@daggerok
daggerok merged commit 39a9c1a into main Dec 3, 2026
1 check passed
@daggerok
daggerok deleted the feat/tax-summary-read branch December 3, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant