feat(go): IO layer behind interfaces (M4) #13
Reference in New Issue
Block a user
Delete Branch "feat/m4-io-layer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fakefor adult/junior tabs (no auth needed for public sheets)modifiedTime-only client +FakeGetValues,AppendValues,BatchUpdateValues,WriteHeader,SortByDateColumn) +Fakewith call-capture for assertionsFileCache; two TTL knobs (file-mtime guard + in-memory debounce); atomic writes viaos.Rename; genericGet[T]; Python-compatible JSON format;Flush()Clientinterface withapiClient(REST JSON) andtransparentClient(HTML scraper viax/net/html);Fake; fixtures intestdata/NewSourceswires all IO intoLoadAdults,LoadJuniors,LoadTransactions,LoadExceptions; Czech month/merged-month parsingSyncToSheets(SHA-256 Sync ID dedup, optional sort) +InferPayments([?]review prefix, dry-run) — all tested with fakessyncandinfersubcommands wired to real clients;feesandreconcilenow use realNewSourcesTest plan
make go-test— all packages green (race detector on)make go-lint— golangci-lint v1.64.8 clean (gofumpt extra-rules, errcheck, staticcheck, unused)fuj fees,fuj reconcile,fuj sync --dry-run,fuj infer --dry-runagainst real credentials (manual, post-merge)🤖 Generated with Claude Code
extractSecondTableRows tracked a boolean inTarget flag and exited on the first </table> token while inside the target. Any nested <table> (e.g. pagination markup in the real Fio page) would cause an early return before reading any data rows, explaining the 0-transaction report. Fixed by tracking targetDepth instead: depth increments on every <table> inside the target and we only return when it reaches 0 again. parseCzechDate also only tried zero-padded layouts ("02.01.2006"). The real Fio transparent page emits non-padded dates ("7.5.2026"); added "2.1.2006" and "2/1/2006" as the preferred layouts. Also adds a dry-run diagnostic line ("fetched N transaction(s) from Fio") so the fetch vs dedup split is visible without reading logs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>