refactor: change domain model IDs from UUID to String canonical IDs
This refactor fixes the achievement system by using stable canonical string IDs (e.g., "stadium_mlb_fenway_park") instead of random UUIDs. This ensures stadium mappings for achievements are consistent across app launches and CloudKit sync operations. Changes: - Stadium, Team, Game: id property changed from UUID to String - Trip, TripStop, TripPreferences: updated to use String IDs for games/stadiums - CKModels: removed UUID parsing, use canonical IDs directly - AchievementEngine: now matches against canonical stadium IDs - All test files updated to use String IDs instead of UUID() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,10 +24,10 @@ final class MockAppDataProvider: ObservableObject {
|
||||
|
||||
// MARK: - Internal Storage
|
||||
|
||||
private var teamsById: [UUID: Team] = [:]
|
||||
private var stadiumsById: [UUID: Stadium] = [:]
|
||||
private var teamsById: [String: Team] = [:]
|
||||
private var stadiumsById: [String: Stadium] = [:]
|
||||
private var games: [Game] = []
|
||||
private var gamesById: [UUID: Game] = [:]
|
||||
private var gamesById: [String: Game] = [:]
|
||||
|
||||
// MARK: - Configuration
|
||||
|
||||
@@ -140,11 +140,11 @@ final class MockAppDataProvider: ObservableObject {
|
||||
|
||||
// MARK: - Data Access
|
||||
|
||||
func team(for id: UUID) -> Team? {
|
||||
func team(for id: String) -> Team? {
|
||||
teamsById[id]
|
||||
}
|
||||
|
||||
func stadium(for id: UUID) -> Stadium? {
|
||||
func stadium(for id: String) -> Stadium? {
|
||||
stadiumsById[id]
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ final class MockAppDataProvider: ObservableObject {
|
||||
}.sorted { $0.dateTime < $1.dateTime }
|
||||
}
|
||||
|
||||
func fetchGame(by id: UUID) async throws -> Game? {
|
||||
func fetchGame(by id: String) async throws -> Game? {
|
||||
await simulateLatency()
|
||||
|
||||
if config.shouldFailOnFetch {
|
||||
|
||||
Reference in New Issue
Block a user