fix: resolve specificStadium achievement ID mismatch
The Green Monster (Fenway) and Ivy League (Wrigley) achievements weren't working because: 1. Symbolic IDs use lowercase sport (stadium_mlb_bos) 2. Sport enum uses uppercase raw values (MLB) 3. Visits store stadium UUIDs, not symbolic IDs Added resolveSymbolicStadiumId() helper that: - Uppercases the sport string before Sport(rawValue:) - Looks up team by abbreviation and sport - Returns the team's stadiumId as UUID string Also fixed: - getStadiumIdsForLeague returns UUID strings (not symbolic IDs) - AchievementProgress.isEarned computed from progress OR stored record - getStadiumIdsForDivision queries CanonicalTeam properly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -118,11 +118,18 @@ struct VisitSummary: Identifiable {
|
||||
let visitDate: Date
|
||||
let visitType: VisitType
|
||||
let sport: Sport
|
||||
let matchup: String?
|
||||
let homeTeamName: String?
|
||||
let awayTeamName: String?
|
||||
let score: String?
|
||||
let photoCount: Int
|
||||
let notes: String?
|
||||
|
||||
/// Combined matchup for backwards compatibility
|
||||
var matchup: String? {
|
||||
guard let home = homeTeamName, let away = awayTeamName else { return nil }
|
||||
return "\(away) @ \(home)"
|
||||
}
|
||||
|
||||
var dateDescription: String {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateStyle = .medium
|
||||
|
||||
@@ -39,7 +39,7 @@ struct Team: Identifiable, Codable, Hashable {
|
||||
}
|
||||
|
||||
var fullName: String {
|
||||
"\(city) \(name)"
|
||||
city.isEmpty ? name : "\(city) \(name)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user