wip
This commit is contained in:
@@ -31,6 +31,7 @@ struct Stadium: Identifiable, Codable, Hashable {
|
||||
let yearOpened: Int?
|
||||
let imageURL: URL?
|
||||
let timeZoneIdentifier: String?
|
||||
let primaryTeamAbbreviations: [String] // Teams that play here (e.g., ["LAC", "LAR"] for SoFi Stadium)
|
||||
|
||||
init(
|
||||
id: String,
|
||||
@@ -43,7 +44,8 @@ struct Stadium: Identifiable, Codable, Hashable {
|
||||
sport: Sport,
|
||||
yearOpened: Int? = nil,
|
||||
imageURL: URL? = nil,
|
||||
timeZoneIdentifier: String? = nil
|
||||
timeZoneIdentifier: String? = nil,
|
||||
primaryTeamAbbreviations: [String] = []
|
||||
) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
@@ -56,6 +58,7 @@ struct Stadium: Identifiable, Codable, Hashable {
|
||||
self.yearOpened = yearOpened
|
||||
self.imageURL = imageURL
|
||||
self.timeZoneIdentifier = timeZoneIdentifier
|
||||
self.primaryTeamAbbreviations = primaryTeamAbbreviations
|
||||
}
|
||||
|
||||
var timeZone: TimeZone? {
|
||||
|
||||
@@ -23,6 +23,8 @@ struct Team: Identifiable, Codable, Hashable {
|
||||
let sport: Sport
|
||||
let city: String
|
||||
let stadiumId: String // FK: "stadium_mlb_fenway_park"
|
||||
let conferenceId: String? // FK: "nba_eastern", "mlb_al"
|
||||
let divisionId: String? // FK: "nba_southeast", "mlb_al_east"
|
||||
let logoURL: URL?
|
||||
let primaryColor: String?
|
||||
let secondaryColor: String?
|
||||
@@ -34,6 +36,8 @@ struct Team: Identifiable, Codable, Hashable {
|
||||
sport: Sport,
|
||||
city: String,
|
||||
stadiumId: String,
|
||||
conferenceId: String? = nil,
|
||||
divisionId: String? = nil,
|
||||
logoURL: URL? = nil,
|
||||
primaryColor: String? = nil,
|
||||
secondaryColor: String? = nil
|
||||
@@ -44,6 +48,8 @@ struct Team: Identifiable, Codable, Hashable {
|
||||
self.sport = sport
|
||||
self.city = city
|
||||
self.stadiumId = stadiumId
|
||||
self.conferenceId = conferenceId
|
||||
self.divisionId = divisionId
|
||||
self.logoURL = logoURL
|
||||
self.primaryColor = primaryColor
|
||||
self.secondaryColor = secondaryColor
|
||||
|
||||
@@ -320,6 +320,8 @@ final class CanonicalTeam {
|
||||
sport: sportEnum ?? .mlb,
|
||||
city: city,
|
||||
stadiumId: stadiumCanonicalId,
|
||||
conferenceId: conferenceId,
|
||||
divisionId: divisionId,
|
||||
logoURL: logoURL.flatMap { URL(string: $0) },
|
||||
primaryColor: primaryColor,
|
||||
secondaryColor: secondaryColor
|
||||
|
||||
Reference in New Issue
Block a user