|
|
|
|
@ -32,7 +32,6 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
var federalCategory: TournamentCategory |
|
|
|
|
var federalLevelCategory: TournamentLevel |
|
|
|
|
var federalAgeCategory: FederalTournamentAge |
|
|
|
|
var groupStageCourtCount: Int? |
|
|
|
|
var closedRegistrationDate: Date? |
|
|
|
|
var groupStageAdditionalQualified: Int |
|
|
|
|
var courtCount: Int = 2 |
|
|
|
|
@ -74,7 +73,6 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
case _federalCategory = "federalCategory" |
|
|
|
|
case _federalLevelCategory = "federalLevelCategory" |
|
|
|
|
case _federalAgeCategory = "federalAgeCategory" |
|
|
|
|
case _groupStageCourtCount = "groupStageCourtCount" |
|
|
|
|
case _seedCount = "seedCount" |
|
|
|
|
case _closedRegistrationDate = "closedRegistrationDate" |
|
|
|
|
case _groupStageAdditionalQualified = "groupStageAdditionalQualified" |
|
|
|
|
@ -94,7 +92,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
case _publishBrackets = "publishBrackets" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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, groupStageCourtCount: Int? = nil, 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) { |
|
|
|
|
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) { |
|
|
|
|
self.event = event |
|
|
|
|
self.name = name |
|
|
|
|
self.startDate = startDate |
|
|
|
|
@ -113,7 +111,6 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
self.federalCategory = federalCategory |
|
|
|
|
self.federalLevelCategory = federalLevelCategory |
|
|
|
|
self.federalAgeCategory = federalAgeCategory |
|
|
|
|
self.groupStageCourtCount = groupStageCourtCount |
|
|
|
|
self.closedRegistrationDate = closedRegistrationDate |
|
|
|
|
self.groupStageAdditionalQualified = groupStageAdditionalQualified |
|
|
|
|
self.courtCount = courtCount |
|
|
|
|
@ -150,7 +147,6 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
federalCategory = try container.decode(TournamentCategory.self, forKey: ._federalCategory) |
|
|
|
|
federalLevelCategory = try container.decode(TournamentLevel.self, forKey: ._federalLevelCategory) |
|
|
|
|
federalAgeCategory = try container.decode(FederalTournamentAge.self, forKey: ._federalAgeCategory) |
|
|
|
|
groupStageCourtCount = try container.decodeIfPresent(Int.self, forKey: ._groupStageCourtCount) |
|
|
|
|
closedRegistrationDate = try container.decodeIfPresent(Date.self, forKey: ._closedRegistrationDate) |
|
|
|
|
groupStageAdditionalQualified = try container.decode(Int.self, forKey: ._groupStageAdditionalQualified) |
|
|
|
|
courtCount = try container.decode(Int.self, forKey: ._courtCount) |
|
|
|
|
@ -222,7 +218,6 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
try container.encode(federalCategory, forKey: ._federalCategory) |
|
|
|
|
try container.encode(federalLevelCategory, forKey: ._federalLevelCategory) |
|
|
|
|
try container.encode(federalAgeCategory, forKey: ._federalAgeCategory) |
|
|
|
|
try container.encodeIfPresent(groupStageCourtCount, forKey: ._groupStageCourtCount) |
|
|
|
|
try container.encodeIfPresent(closedRegistrationDate, forKey: ._closedRegistrationDate) |
|
|
|
|
try container.encode(groupStageAdditionalQualified, forKey: ._groupStageAdditionalQualified) |
|
|
|
|
try container.encode(courtCount, forKey: ._courtCount) |
|
|
|
|
@ -1637,7 +1632,7 @@ extension Tournament { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static func fake() -> Tournament { |
|
|
|
|
return Tournament(event: "Roland Garros", name: "Magic P100", startDate: Date(), endDate: Date(), creationDate: Date(), isPrivate: false, groupStageFormat: .nineGames, roundFormat: nil, loserRoundFormat: nil, groupStageSortMode: .snake, groupStageCount: 4, rankSourceDate: nil, dayDuration: 2, teamCount: 24, teamSorting: .rank, federalCategory: .men, federalLevelCategory: .p100, federalAgeCategory: .a45, groupStageCourtCount: nil, closedRegistrationDate: nil, groupStageAdditionalQualified: 0, courtCount: 4, prioritizeClubMembers: false, qualifiedPerGroupStage: 2, teamsPerGroupStage: 4, entryFee: nil) |
|
|
|
|
return Tournament(event: "Roland Garros", name: "Magic P100", startDate: Date(), endDate: Date(), creationDate: Date(), isPrivate: false, groupStageFormat: .nineGames, roundFormat: nil, loserRoundFormat: nil, groupStageSortMode: .snake, groupStageCount: 4, rankSourceDate: nil, dayDuration: 2, teamCount: 24, teamSorting: .rank, federalCategory: .men, federalLevelCategory: .p100, federalAgeCategory: .a45, closedRegistrationDate: nil, groupStageAdditionalQualified: 0, courtCount: 4, prioritizeClubMembers: false, qualifiedPerGroupStage: 2, teamsPerGroupStage: 4, entryFee: nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|