feat(go/M2.5): port domain/money.ParseCZK #7

Merged
kacerr merged 2 commits from feat/m2-5-money-parse-czk into main 2026-05-06 09:39:42 +02:00
Owner

Summary

  • New go/internal/domain/money package with ParseCZK(string) (float64, error) ported from scripts/infer_payments.py parse_czk_amount.
  • Preserves the Czech-locale heuristic: comma → decimal sep; 2+ dots → thousand seps; single dot → decimal ("1.500"1.5).
  • Returns (0, ErrInvalidAmount) on parse failure; callers wanting Python's silent-zero contract use v, _ := ParseCZK(s).
  • 15 table-driven tests + silent-zero contract test; all expected values verified against live Python on 2026-05-06.

Test plan

  • cd go && go test ./internal/domain/money/... green
  • make go-lint clean
  • make go-build succeeds

🤖 Generated with Claude Code

## Summary - New `go/internal/domain/money` package with `ParseCZK(string) (float64, error)` ported from `scripts/infer_payments.py` `parse_czk_amount`. - Preserves the Czech-locale heuristic: comma → decimal sep; 2+ dots → thousand seps; single dot → decimal (`"1.500"` → `1.5`). - Returns `(0, ErrInvalidAmount)` on parse failure; callers wanting Python's silent-zero contract use `v, _ := ParseCZK(s)`. - 15 table-driven tests + silent-zero contract test; all expected values verified against live Python on 2026-05-06. ## Test plan - [ ] `cd go && go test ./internal/domain/money/...` green - [ ] `make go-lint` clean - [ ] `make go-build` succeeds 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 2 commits 2026-05-06 09:39:13 +02:00
Port scripts/infer_payments.py parse_czk_amount to Go as
internal/domain/money.ParseCZK. Preserves the Czech-locale heuristic
(comma = decimal sep; 2+ dots = thousand seps; single dot = decimal)
and returns (float64, error) so callers can opt into Python's
silent-zero contract via v, _ := money.ParseCZK(s).
All expected values verified against live Python on 2026-05-06.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
chore: tick M2.5 in progress tracker + CHANGELOG entry
All checks were successful
Deploy to K8s / deploy (push) Successful in 11s
1a63bfd313
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 84a5d177e9 into main 2026-05-06 09:39:42 +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#7