feat: multi-account Fio sync + switch QR default to 2502035405/2010 #37

Merged
kacerr merged 2 commits from feat/multi-account-bank-sync into main 2026-05-24 21:57:52 +02:00
Owner

Summary

  • Adds second Fio account 2502035405/2010 (CZ0820100000002502035405) to the sync pipeline. Both accounts are fetched on every run and combined before dedup — no schema change, no sheet migration.
  • QR codes now default to the new account.
  • Go implementation first, Python port in the same commit (agreed in plan).

Go changes

  • config.go: hardcoded Accounts/LoadedAccount slice replaces scalar BankAccount + FioAPIToken. Config.BankAccount renamed to Config.QRAccount. Per-account tokens via FIO_API_TOKEN_NEW / FIO_API_TOKEN_OLD (empty = transparent-scraper path).
  • banksync.SyncToSheets: signature changed to []fio.Client; loops to combine txns across accounts.
  • cmd/fuj/main.go: buildFioClients helper; both sync and server BankSync call sites updated.
  • html_handler + build_adults/juniors: switched to Config.QRAccount.
  • New TestSyncToSheets_MultiAccount verifies cross-account fetch + dedup.

Python changes

  • config.py: ACCOUNTS list + LOADED_ACCOUNTS (tokens resolved at import).
  • fio_utils.py: fetch_transactions_for (per-account) + fetch_transactions_all (loops all accounts).
  • sync_fio_to_sheets.py: uses fetch_transactions_all.

Test plan

  • cd go && go test ./... — all green
  • python -m unittest discover -s tests — all green (32 tests)
  • ./build/fuj sync --dry-run --print-fio-table --days 7 — shows transactions from both accounts
  • ./build/fuj server/qr?amount=700&message=test — QR SPD contains CZ0820100000002502035405
  • make sync-2026 against real sheet — rows from both accounts appear, no duplicates

🤖 Generated with Claude Code

## Summary - Adds second Fio account `2502035405/2010` (`CZ0820100000002502035405`) to the sync pipeline. Both accounts are fetched on every run and combined before dedup — no schema change, no sheet migration. - QR codes now default to the new account. - Go implementation first, Python port in the same commit (agreed in plan). ### Go changes - `config.go`: hardcoded `Accounts`/`LoadedAccount` slice replaces scalar `BankAccount` + `FioAPIToken`. `Config.BankAccount` renamed to `Config.QRAccount`. Per-account tokens via `FIO_API_TOKEN_NEW` / `FIO_API_TOKEN_OLD` (empty = transparent-scraper path). - `banksync.SyncToSheets`: signature changed to `[]fio.Client`; loops to combine txns across accounts. - `cmd/fuj/main.go`: `buildFioClients` helper; both `sync` and `server BankSync` call sites updated. - `html_handler` + `build_adults/juniors`: switched to `Config.QRAccount`. - New `TestSyncToSheets_MultiAccount` verifies cross-account fetch + dedup. ### Python changes - `config.py`: `ACCOUNTS` list + `LOADED_ACCOUNTS` (tokens resolved at import). - `fio_utils.py`: `fetch_transactions_for` (per-account) + `fetch_transactions_all` (loops all accounts). - `sync_fio_to_sheets.py`: uses `fetch_transactions_all`. ## Test plan - [ ] `cd go && go test ./...` — all green - [ ] `python -m unittest discover -s tests` — all green (32 tests) - [ ] `./build/fuj sync --dry-run --print-fio-table --days 7` — shows transactions from both accounts - [ ] `./build/fuj server` → `/qr?amount=700&message=test` — QR SPD contains `CZ0820100000002502035405` - [ ] `make sync-2026` against real sheet — rows from both accounts appear, no duplicates 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 1 commit 2026-05-24 21:43:14 +02:00
feat: multi-account Fio sync + switch QR default to 2502035405/2010
All checks were successful
Deploy to K8s / deploy (push) Successful in 24s
69af4c1e3b
Add second Fio account (CZ0820100000002502035405 / 2502035405/2010).
Both accounts are fetched on every sync run and combined before dedup,
so the payments sheet accumulates transactions from either account.
QR codes now default to the new account.

Go:
- config.go: hardcoded Accounts/LoadedAccount slice replaces scalar
  BankAccount + FioAPIToken; Config.BankAccount renamed QRAccount;
  per-account tokens via FIO_API_TOKEN_NEW / FIO_API_TOKEN_OLD
- banksync.SyncToSheets: accepts []fio.Client, loops to combine txns
- cmd/fuj/main.go: buildFioClients helper; both sync call sites updated
- html_handler + build_adults/juniors: use Config.QRAccount
- New TestSyncToSheets_MultiAccount covers cross-account dedup

Python:
- config.py: ACCOUNTS list + LOADED_ACCOUNTS (tokens from env)
- fio_utils.py: fetch_transactions_for (per-account) +
  fetch_transactions_all (loops all accounts)
- sync_fio_to_sheets.py: uses fetch_transactions_all

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr added 1 commit 2026-05-24 21:57:36 +02:00
feat(fees): update adult monthly rates for 2026-05 through 2026-08
All checks were successful
Deploy to K8s / deploy (push) Successful in 40s
723591cbce
- 2026-05: 700 → 450 CZK
- 2026-06, 07, 08: 600 CZK (new months)

Changes are mirrored in both Python (scripts/attendance.py) and Go (go/internal/domain/fees/fees.go).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kacerr merged commit 241fecfb2c into main 2026-05-24 21:57:52 +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#37