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:
@@ -477,11 +477,13 @@ struct RecentVisitRow: View {
|
||||
.font(.body)
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
|
||||
HStack(spacing: Theme.Spacing.sm) {
|
||||
// Date, Away @ Home on one line, left aligned
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(visit.shortDateDescription)
|
||||
if let matchup = visit.matchup {
|
||||
Text("•")
|
||||
Text(matchup)
|
||||
if let away = visit.awayTeamName, let home = visit.homeTeamName {
|
||||
Text(away)
|
||||
Text("@")
|
||||
Text(home)
|
||||
}
|
||||
}
|
||||
.font(.subheadline)
|
||||
@@ -490,15 +492,6 @@ struct RecentVisitRow: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
if visit.photoCount > 0 {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "photo")
|
||||
Text("\(visit.photoCount)")
|
||||
}
|
||||
.font(.caption)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
}
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.caption)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
|
||||
Reference in New Issue
Block a user