feat(fees): junior rate for 2026-08 is 0
- 2026-08 added to the junior rate table at 0 CZK, same as adults - A single practice in a 0-rate month is 0 instead of "?", since a free month needs no manual review - Mirrored in Go and legacy Python; new calculate_junior_fee parity fixtures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ const JuniorFeeDefault = 500 // CZK fallback for 2+ practices when month not in
|
||||
var JuniorFeeMonthlyRate = map[string]int{
|
||||
"2025-09": 250,
|
||||
"2026-03": 250,
|
||||
"2026-08": 0,
|
||||
}
|
||||
|
||||
// Expected is the result of a junior fee calculation.
|
||||
@@ -21,17 +22,19 @@ type Expected struct {
|
||||
// the given monthKey (format "YYYY-MM").
|
||||
//
|
||||
// 0 practices → Expected{Value: 0}
|
||||
// 1 practice → Expected{Unknown: true} (manual review; Python sentinel "?")
|
||||
// 1 practice → Expected{Unknown: true} (manual review; Python sentinel "?"),
|
||||
// or Expected{Value: 0} when the month's rate is 0
|
||||
// 2+ → Expected{Value: JuniorFeeMonthlyRate[monthKey] or JuniorFeeDefault}
|
||||
func CalculateJuniorFee(attendanceCount int, monthKey string) Expected {
|
||||
if attendanceCount == 0 {
|
||||
return Expected{Value: 0}
|
||||
}
|
||||
if attendanceCount == 1 {
|
||||
rate, ok := JuniorFeeMonthlyRate[monthKey]
|
||||
if !ok {
|
||||
rate = JuniorFeeDefault
|
||||
}
|
||||
if attendanceCount == 1 && rate > 0 {
|
||||
return Expected{Unknown: true}
|
||||
}
|
||||
if rate, ok := JuniorFeeMonthlyRate[monthKey]; ok {
|
||||
return Expected{Value: rate}
|
||||
}
|
||||
return Expected{Value: JuniorFeeDefault}
|
||||
return Expected{Value: rate}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user