feat(go): M5.2 — HTTP handlers for /api/adults, /api/juniors, /api/payments, /api/version #17

Merged
kacerr merged 2 commits from feat/go-m5-2-api-handlers into main 2026-05-07 21:08:01 +02:00
Owner

Summary

  • Implements HTTP handlers for all four /api/* routes, composing services/membership.Sources + domain reconciliation into the M5.1 wire types
  • buildAdultsResponse / buildJuniorsResponse / buildPaymentsResponse are byte-for-byte ports of scripts/views.py view-model builders, laying the foundation for M5.4 parity testing
  • Junior-specific features included: "?" fee sentinel for 1-session attendance, :NJ,MA attendance breakdown string, skip-unknown months in totals and settled balance
  • Extended domain types (FeeData, MonthData, Transaction) to carry raw sheet columns needed for the wire representation; no breaking changes to existing logic

Files changed

  • go/internal/web/api/handler.goHandler struct, ServeAdults, ServeJuniors, ServePayments, ServeVersion
  • go/internal/web/api/build_common.go — shared helpers: getMonthLabels, groupRawPaymentsByPerson, settledBalance, converters, ensureSlice
  • go/internal/web/api/build_adults.gobuildAdultsResponse + buildAdultMemberRow
  • go/internal/web/api/build_juniors.gobuildJuniorsResponse + buildJuniorMemberRow
  • go/internal/web/api/build_payments.gobuildPaymentsResponse with Unmatched bucket
  • go/internal/domain/reconcile/reconcile.go — extended FeeData, MonthData, Transaction
  • go/internal/services/membership/sources.go — export merged months, populate new FeeData/Transaction fields
  • go/internal/web/server.go + go/cmd/fuj/main.go — wire sources+cfg, register routes

Test plan

  • go test ./... passes (all packages green)
  • golangci-lint run ./... passes with no issues
  • GET /api/version returns build info JSON
  • GET /api/adults returns AdultsResponse matching Python /adults JSON shape
  • GET /api/juniors returns JuniorsResponse matching Python /juniors JSON shape
  • GET /api/payments returns PaymentsResponse with grouped payments and Unmatched bucket

🤖 Generated with Claude Code

## Summary - Implements HTTP handlers for all four `/api/*` routes, composing `services/membership.Sources` + domain reconciliation into the M5.1 wire types - `buildAdultsResponse` / `buildJuniorsResponse` / `buildPaymentsResponse` are byte-for-byte ports of `scripts/views.py` view-model builders, laying the foundation for M5.4 parity testing - Junior-specific features included: `"?"` fee sentinel for 1-session attendance, `:NJ,MA` attendance breakdown string, skip-unknown months in totals and settled balance - Extended domain types (`FeeData`, `MonthData`, `Transaction`) to carry raw sheet columns needed for the wire representation; no breaking changes to existing logic ## Files changed - `go/internal/web/api/handler.go` — `Handler` struct, `ServeAdults`, `ServeJuniors`, `ServePayments`, `ServeVersion` - `go/internal/web/api/build_common.go` — shared helpers: `getMonthLabels`, `groupRawPaymentsByPerson`, `settledBalance`, converters, `ensureSlice` - `go/internal/web/api/build_adults.go` — `buildAdultsResponse` + `buildAdultMemberRow` - `go/internal/web/api/build_juniors.go` — `buildJuniorsResponse` + `buildJuniorMemberRow` - `go/internal/web/api/build_payments.go` — `buildPaymentsResponse` with Unmatched bucket - `go/internal/domain/reconcile/reconcile.go` — extended `FeeData`, `MonthData`, `Transaction` - `go/internal/services/membership/sources.go` — export merged months, populate new FeeData/Transaction fields - `go/internal/web/server.go` + `go/cmd/fuj/main.go` — wire sources+cfg, register routes ## Test plan - [ ] `go test ./...` passes (all packages green) - [ ] `golangci-lint run ./...` passes with no issues - [ ] `GET /api/version` returns build info JSON - [ ] `GET /api/adults` returns `AdultsResponse` matching Python `/adults` JSON shape - [ ] `GET /api/juniors` returns `JuniorsResponse` matching Python `/juniors` JSON shape - [ ] `GET /api/payments` returns `PaymentsResponse` with grouped payments and Unmatched bucket 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 1 commit 2026-05-07 20:13:55 +02:00
feat(go): M5.2 — HTTP handlers for /api/adults, /api/juniors, /api/payments, /api/version
All checks were successful
Deploy to K8s / deploy (push) Successful in 10s
7d48e8f607
- Add web/api/handler.go: Handler struct wiring Sources+Config into ServeAdults,
  ServeJuniors, ServePayments, ServeVersion
- Add web/api/build_common.go: getMonthLabels, groupRawPaymentsByPerson, settledBalance,
  domain-to-wire converters, ensureSlice generic helper
- Add web/api/build_adults.go: buildAdultsResponse + buildAdultMemberRow mirroring
  scripts/views.py:build_adults_view_model
- Add web/api/build_juniors.go: buildJuniorsResponse + buildJuniorMemberRow mirroring
  scripts/views.py:build_juniors_view_model, including "?" sentinel and :NJ,MA breakdown
- Add web/api/build_payments.go: buildPaymentsResponse with Unmatched/Unknown bucket
- Extend reconcile.FeeData/MonthData with IsUnknown, JuniorAttendance, AdultAttendance
- Extend reconcile.Transaction with ManualFix, VS, BankID, SyncID for raw_payments wire field
- Export membership.AdultMergedMonths and JuniorMergedMonths
- Update sources.go to propagate new FeeData fields and parse extra transaction columns
- Wire sources+cfg into web.Run; register /api/* routes via Go 1.22 method+path patterns
- Fix pre-existing gofumpt formatting in fio_test.go and fio_table.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kacerr added 1 commit 2026-05-07 21:03:06 +02:00
chore: CHANGELOG and progress tracker for M5.2
All checks were successful
Deploy to K8s / deploy (push) Successful in 7s
2b7eff14c4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kacerr merged commit 68810369bd into main 2026-05-07 21:08:01 +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#17