feat(go/M2.3+M2.4): port domain/fees.CalculateFee and CalculateJuniorFee #6

Merged
kacerr merged 2 commits from feat/m2-3-m2-4-domain-fees into main 2026-05-06 09:23:02 +02:00
Owner

Summary

  • Ports calculate_fee (adults) and calculate_junior_fee (juniors) from scripts/attendance.py into a new go/internal/domain/fees package.
  • Introduces Expected{Value int; Unknown bool} for the junior "?" sentinel — strictly typed instead of str|int.
  • Constants (AdultFeeMonthlyRate, JuniorFeeMonthlyRate, fallback defaults) are exported so M5 handlers can read them.
  • 20 table-driven tests, all green with -race; golangci-lint clean.

Ticks M2.3 and M2.4 in docs/plans/2026-05-03-2349-go-backend-rewrite-progress.md.

Test plan

  • make go-test passes (all 20 new subtests green)
  • make go-lint clean
  • make go-build succeeds
## Summary - Ports `calculate_fee` (adults) and `calculate_junior_fee` (juniors) from `scripts/attendance.py` into a new `go/internal/domain/fees` package. - Introduces `Expected{Value int; Unknown bool}` for the junior `"?"` sentinel — strictly typed instead of `str|int`. - Constants (`AdultFeeMonthlyRate`, `JuniorFeeMonthlyRate`, fallback defaults) are exported so M5 handlers can read them. - 20 table-driven tests, all green with `-race`; `golangci-lint` clean. Ticks **M2.3** and **M2.4** in [docs/plans/2026-05-03-2349-go-backend-rewrite-progress.md](docs/plans/2026-05-03-2349-go-backend-rewrite-progress.md). ## Test plan - [ ] `make go-test` passes (all 20 new subtests green) - [ ] `make go-lint` clean - [ ] `make go-build` succeeds
kacerr added 2 commits 2026-05-06 00:39:08 +02:00
ADULT_FEE_DEFAULT is 700 CZK, not 750. The 750 appears in
ADULT_FEE_MONTHLY_RATE for most current months but is not the fallback.
Rephrase the member-tiers bullet to point at the dict rather than a
number that drifts each season; update the fee-calc bullet to match
the junior line's style (default 700 vs default 500).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
feat(go/M2.3+M2.4): port domain/fees.CalculateFee and CalculateJuniorFee
All checks were successful
Deploy to K8s / deploy (push) Successful in 6s
57ec817044
Ports calculate_fee and calculate_junior_fee from scripts/attendance.py
into a new go/internal/domain/fees package. Introduces the Expected type
(Value int, Unknown bool) for the junior "?" sentinel, keeping the Go
API strictly typed instead of mirroring Python's str|int return.

All 20 table-driven tests pass with -race; golangci-lint clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 0fc3b6dd9a into main 2026-05-06 09:23:02 +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#6