feat(go): add --print-fio-table debug flag to fuj sync #14

Merged
kacerr merged 4 commits from feat/fuj-sync-print-fio-table into main 2026-05-07 14:13:20 +02:00
Owner

Summary

  • Adds --print-fio-table flag to fuj sync; only fires when --dry-run is also set
  • Prints an aligned tabwriter table of every Fio transaction in the look-back window with a STATUS column (NEW = would be appended, DUP = already in sheet)
  • Refactors Sync ID computation into a single pre-pass shared by both the table printer and the row builder, eliminating duplication

New file

go/internal/services/banksync/fio_table.goprintFioTable + truncRunes helpers

Test plan

  • cd go && go build ./... && go test ./... — all pass
  • fuj sync --dry-run --days 30 — existing output unchanged (no table)
  • fuj sync --dry-run --print-fio-table --days 30 — table prints with DATE/AMOUNT/SENDER/VS/MESSAGE/BANKID/STATUS columns; NEW count matches the "would sync N" summary
  • fuj sync --print-fio-table --days 1 (no --dry-run) — table silently suppressed, real sync proceeds normally

🤖 Generated with Claude Code

## Summary - Adds `--print-fio-table` flag to `fuj sync`; only fires when `--dry-run` is also set - Prints an aligned `tabwriter` table of every Fio transaction in the look-back window with a `STATUS` column (`NEW` = would be appended, `DUP` = already in sheet) - Refactors Sync ID computation into a single pre-pass shared by both the table printer and the row builder, eliminating duplication ## New file `go/internal/services/banksync/fio_table.go` — `printFioTable` + `truncRunes` helpers ## Test plan - [ ] `cd go && go build ./... && go test ./...` — all pass - [ ] `fuj sync --dry-run --days 30` — existing output unchanged (no table) - [ ] `fuj sync --dry-run --print-fio-table --days 30` — table prints with DATE/AMOUNT/SENDER/VS/MESSAGE/BANKID/STATUS columns; NEW count matches the "would sync N" summary - [ ] `fuj sync --print-fio-table --days 1` (no --dry-run) — table silently suppressed, real sync proceeds normally 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 1 commit 2026-05-07 13:49:54 +02:00
feat(go): add --print-fio-table flag to fuj sync --dry-run
All checks were successful
Deploy to K8s / deploy (push) Successful in 7s
a7cf45fc95
Prints an aligned tabwriter table of every Fio transaction in the
look-back window, with a STATUS column showing NEW (would be appended)
or DUP (already in sheet). Only fires when --dry-run is also set, so
it can't affect real syncs. Refactors Sync ID computation into a single
pre-pass shared by both the table printer and the row builder.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr added 1 commit 2026-05-07 13:59:26 +02:00
feat(go/fio): debug logging via slog at LOG_LEVEL=DEBUG
All checks were successful
Deploy to K8s / deploy (push) Successful in 8s
f87adeff9f
Wires slog.SetDefault to honour LOG_LEVEL in all CLI commands and adds
debug logs on the Fio fetch path so a silent "fetched 0 transaction(s)"
can be diagnosed without code changes:

- fio.New: which client variant (api/transparent) was selected
- apiClient: GET URL (token redacted as ****), HTTP status, body bytes,
  parsed transaction count
- transparentClient: GET URL, HTTP status, body bytes, plus parser
  stats (raw rows from second table, kept, dropped_bad_date,
  dropped_nonpositive_amount)

Also suppresses the --print-fio-table block when zero transactions were
fetched, so the bare header no longer prints under that condition.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr added 1 commit 2026-05-07 14:01:47 +02:00
chore: add make go-sync-debug target
All checks were successful
Deploy to K8s / deploy (push) Successful in 6s
80db33945d
Wraps `LOG_LEVEL=DEBUG ./bin/fuj sync -dry-run -print-fio-table -days N`
behind a single make target. Default DAYS=30, override with
`make go-sync-debug DAYS=90`. Builds the Go binary first via go-build.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr added 1 commit 2026-05-07 14:12:37 +02:00
fix(go/fio): accept 2-digit year format in transparent date parser
All checks were successful
Deploy to K8s / deploy (push) Successful in 9s
b41b8ef29c
Fio's transparent account page now serves dates as DD.MM.YY (e.g.
07.05.26) rather than the previously expected 4-digit-year format.
Extends parseCzechDate to try all eight layout variants: padded and
non-padded, dot and slash separators, 4-digit and 2-digit years.

Go maps 2-digit year 00-68 → 2000-2068, so 26 → 2026.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 2164e99866 into main 2026-05-07 14:13:20 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kacerr/fuj-management#14