|
|
|
|
@ -50,6 +50,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
var publishBrackets: Bool = false |
|
|
|
|
var shouldVerifyGroupStage: Bool = false |
|
|
|
|
var shouldVerifyBracket: Bool = false |
|
|
|
|
var hideTeamsWeight: Bool = false |
|
|
|
|
|
|
|
|
|
@ObservationIgnored |
|
|
|
|
var navigationPath: [Screen] = [] |
|
|
|
|
@ -94,9 +95,10 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
case _publishBrackets = "publishBrackets" |
|
|
|
|
case _shouldVerifyGroupStage = "shouldVerifyGroupStage" |
|
|
|
|
case _shouldVerifyBracket = "shouldVerifyBracket" |
|
|
|
|
case _hideTeamsWeight = "hideTeamsWeight" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
internal init(event: String? = nil, name: String? = nil, startDate: Date = Date(), endDate: Date? = nil, creationDate: Date = Date(), isPrivate: Bool = false, groupStageFormat: MatchFormat? = nil, roundFormat: MatchFormat? = nil, loserRoundFormat: MatchFormat? = nil, groupStageSortMode: GroupStageOrderingMode, groupStageCount: Int = 4, rankSourceDate: Date? = nil, dayDuration: Int = 1, teamCount: Int = 24, teamSorting: TeamSortingType? = nil, federalCategory: TournamentCategory, federalLevelCategory: TournamentLevel, federalAgeCategory: FederalTournamentAge, closedRegistrationDate: Date? = nil, groupStageAdditionalQualified: Int = 0, courtCount: Int = 2, prioritizeClubMembers: Bool = false, qualifiedPerGroupStage: Int = 1, teamsPerGroupStage: Int = 4, entryFee: Double? = nil, additionalEstimationDuration: Int = 0, isDeleted: Bool = false, publishTeams: Bool = false, publishSummons: Bool = false, publishGroupStages: Bool = false, publishBrackets: Bool = false, shouldVerifyBracket: Bool = false, shouldVerifyGroupStage: Bool = false) { |
|
|
|
|
internal init(event: String? = nil, name: String? = nil, startDate: Date = Date(), endDate: Date? = nil, creationDate: Date = Date(), isPrivate: Bool = false, groupStageFormat: MatchFormat? = nil, roundFormat: MatchFormat? = nil, loserRoundFormat: MatchFormat? = nil, groupStageSortMode: GroupStageOrderingMode, groupStageCount: Int = 4, rankSourceDate: Date? = nil, dayDuration: Int = 1, teamCount: Int = 24, teamSorting: TeamSortingType? = nil, federalCategory: TournamentCategory, federalLevelCategory: TournamentLevel, federalAgeCategory: FederalTournamentAge, closedRegistrationDate: Date? = nil, groupStageAdditionalQualified: Int = 0, courtCount: Int = 2, prioritizeClubMembers: Bool = false, qualifiedPerGroupStage: Int = 1, teamsPerGroupStage: Int = 4, entryFee: Double? = nil, additionalEstimationDuration: Int = 0, isDeleted: Bool = false, publishTeams: Bool = false, publishSummons: Bool = false, publishGroupStages: Bool = false, publishBrackets: Bool = false, shouldVerifyBracket: Bool = false, shouldVerifyGroupStage: Bool = false, hideTeamsWeight: Bool = false) { |
|
|
|
|
self.event = event |
|
|
|
|
self.name = name |
|
|
|
|
self.startDate = startDate |
|
|
|
|
@ -130,6 +132,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
self.publishGroupStages = publishGroupStages |
|
|
|
|
self.shouldVerifyBracket = shouldVerifyBracket |
|
|
|
|
self.shouldVerifyGroupStage = shouldVerifyGroupStage |
|
|
|
|
self.hideTeamsWeight = hideTeamsWeight |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
required init(from decoder: Decoder) throws { |
|
|
|
|
@ -170,6 +173,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
publishBrackets = try container.decodeIfPresent(Bool.self, forKey: ._publishBrackets) ?? false |
|
|
|
|
shouldVerifyBracket = try container.decodeIfPresent(Bool.self, forKey: ._shouldVerifyBracket) ?? false |
|
|
|
|
shouldVerifyGroupStage = try container.decodeIfPresent(Bool.self, forKey: ._shouldVerifyGroupStage) ?? false |
|
|
|
|
hideTeamsWeight = try container.decodeIfPresent(Bool.self, forKey: ._hideTeamsWeight) ?? false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fileprivate static let _numberFormatter: NumberFormatter = NumberFormatter() |
|
|
|
|
@ -281,6 +285,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
try container.encode(publishGroupStages, forKey: ._publishGroupStages) |
|
|
|
|
try container.encode(shouldVerifyBracket, forKey: ._shouldVerifyBracket) |
|
|
|
|
try container.encode(shouldVerifyGroupStage, forKey: ._shouldVerifyGroupStage) |
|
|
|
|
try container.encode(hideTeamsWeight, forKey: ._hideTeamsWeight) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fileprivate func _encodePayment(container: inout KeyedEncodingContainer<CodingKeys>) throws { |
|
|
|
|
|