|
|
|
|
@ -39,9 +39,10 @@ final class Club : ModelObject, Storable, Hashable { |
|
|
|
|
var longitude: Double? |
|
|
|
|
var courtCount: Int = 2 |
|
|
|
|
var broadcastCode: String? |
|
|
|
|
var timezone: String? |
|
|
|
|
// var alphabeticalName: Bool = false |
|
|
|
|
|
|
|
|
|
internal init(creator: String? = nil, name: String, acronym: String? = nil, phone: String? = nil, code: String? = nil, address: String? = nil, city: String? = nil, zipCode: String? = nil, latitude: Double? = nil, longitude: Double? = nil, courtCount: Int = 2, broadcastCode: String? = nil) { |
|
|
|
|
internal init(creator: String? = nil, name: String, acronym: String? = nil, phone: String? = nil, code: String? = nil, address: String? = nil, city: String? = nil, zipCode: String? = nil, latitude: Double? = nil, longitude: Double? = nil, courtCount: Int = 2, broadcastCode: String? = nil, timezone: String? = nil) { |
|
|
|
|
self.name = name |
|
|
|
|
self.creator = creator |
|
|
|
|
self.acronym = acronym ?? name.acronym() |
|
|
|
|
@ -54,6 +55,7 @@ final class Club : ModelObject, Storable, Hashable { |
|
|
|
|
self.longitude = longitude |
|
|
|
|
self.courtCount = courtCount |
|
|
|
|
self.broadcastCode = broadcastCode |
|
|
|
|
self.timezone = TimeZone.current.identifier |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override func copyFromServerInstance(_ instance: any Storable) -> Bool { |
|
|
|
|
@ -102,6 +104,7 @@ final class Club : ModelObject, Storable, Hashable { |
|
|
|
|
case _longitude = "longitude" |
|
|
|
|
case _courtCount = "courtCount" |
|
|
|
|
case _broadcastCode = "broadcastCode" |
|
|
|
|
case _timezone = "timezone" |
|
|
|
|
// case _alphabeticalName = "alphabeticalName" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -121,6 +124,7 @@ final class Club : ModelObject, Storable, Hashable { |
|
|
|
|
try container.encode(longitude, forKey: ._longitude) |
|
|
|
|
try container.encode(courtCount, forKey: ._courtCount) |
|
|
|
|
try container.encode(broadcastCode, forKey: ._broadcastCode) |
|
|
|
|
try container.encode(timezone, forKey: ._timezone) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|