feat(go): M6.6 — /qr, /sync-bank, /flush-cache, /version pages #32
Reference in New Issue
Block a user
Delete Branch "feat/go-m6-6-action-pages"
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
GET /qr— Czech QR Platba PNG endpoint; ports Python'sqr_code()exactly: account validation (^[A-Z]{2}\d{2,34}$|^\d{1,16}/\d{4}$), amount clamping[0, 10M],*stripping, SPD string format. New dep:github.com/skip2/go-qrcode.GET /sync-bank— runs Fio sync → infer payments for the current year, captures output into thesync.tmplpage with a success/error banner. Wired viaweb.ActionHandlers{BankSync}closure inserverCmd, which also callsFlushCacheafter a successful run.GET /flush-cache+POST /flush-cache— confirmation form (GET) + action (POST) that deletes cache files and shows the deleted count.GET /version— JSON alias of/api/version(Python parity; same{tag, commit, build_date}shape).FlushCache() (int, error)added tomembership.Sourcesinterface; implemented onrealSourcesviacache.FileCache.Flush(); stubbed on all test fakes.TestQRBuildSPD(9 table cases),TestServeQR,TestServeFlushCacheGET,TestServeFlushCachePOST,TestServeSync,TestServeVersion.Test plan
cd go && go test ./...— all greengo run ./cmd/fuj server→ open http://localhost:8080/adults→ click Pay on an unpaid month → modal shows QR image; scan with a Czech banking app/qr?account=2702008874/2010&amount=700&message=Test→ PNG renders/versionin browser → JSON{tag, commit, build_date}/api/versionstill returns identical JSON (parity check)🤖 Generated with Claude Code
- GET /qr: Czech QR Platba PNG; ports Python qr_code() exactly (account validation, amount clamping, * stripping, SPD format) - GET /sync-bank: Fio sync → infer → cache flush with captured log - GET+POST /flush-cache: form + action, shows deleted count - GET /version: JSON alias of /api/version (Python parity) - FlushCache() added to membership.Sources; wired through api.Handler - web.ActionHandlers{BankSync} closure-based dep injection for sync - New dep: github.com/skip2/go-qrcode - TestQRBuildSPD (9 cases), TestServeQR, TestServeFlushCache{GET,POST}, TestServeSync, TestServeVersion added Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>