package fees const JuniorFeeDefault = 500 // CZK fallback for 2+ practices when month not in JuniorFeeMonthlyRate // JuniorFeeMonthlyRate mirrors JUNIOR_MONTHLY_RATE in scripts/attendance.py. // Months absent from this map fall back to JuniorFeeDefault. var JuniorFeeMonthlyRate = map[string]int{ "2025-09": 250, "2026-03": 250, } // Expected is the result of a junior fee calculation. // When Unknown is true the fee requires manual review (Python returns "?"); // in that case Value is meaningless — always check Unknown first. type Expected struct { Value int Unknown bool } // CalculateJuniorFee returns the junior fee for attendanceCount practices in // the given monthKey (format "YYYY-MM"). // // 0 practices → Expected{Value: 0} // 1 practice → Expected{Unknown: true} (manual review; Python sentinel "?") // 2+ → Expected{Value: JuniorFeeMonthlyRate[monthKey] or JuniorFeeDefault} func CalculateJuniorFee(attendanceCount int, monthKey string) Expected { if attendanceCount == 0 { return Expected{Value: 0} } if attendanceCount == 1 { return Expected{Unknown: true} } if rate, ok := JuniorFeeMonthlyRate[monthKey]; ok { return Expected{Value: rate} } return Expected{Value: JuniorFeeDefault} }