|
|
|
|
@ -81,6 +81,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
public var isTemplate: Bool = false |
|
|
|
|
public var publishProg: Bool = false |
|
|
|
|
public var showTeamsInProg: Bool = false |
|
|
|
|
public var clubMemberFeeDeduction: Double? = nil |
|
|
|
|
public var unregisterDeltaInHours: Int = 24 |
|
|
|
|
|
|
|
|
|
public init( |
|
|
|
|
id: String = Store.randomId(), |
|
|
|
|
@ -151,7 +153,9 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
isCorporateTournament: Bool = false, |
|
|
|
|
isTemplate: Bool = false, |
|
|
|
|
publishProg: Bool = false, |
|
|
|
|
showTeamsInProg: Bool = false |
|
|
|
|
showTeamsInProg: Bool = false, |
|
|
|
|
clubMemberFeeDeduction: Double? = nil, |
|
|
|
|
unregisterDeltaInHours: Int = 24 |
|
|
|
|
) { |
|
|
|
|
super.init() |
|
|
|
|
self.id = id |
|
|
|
|
@ -223,6 +227,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
self.isTemplate = isTemplate |
|
|
|
|
self.publishProg = publishProg |
|
|
|
|
self.showTeamsInProg = showTeamsInProg |
|
|
|
|
self.clubMemberFeeDeduction = clubMemberFeeDeduction |
|
|
|
|
self.unregisterDeltaInHours = unregisterDeltaInHours |
|
|
|
|
} |
|
|
|
|
required public override init() { |
|
|
|
|
super.init() |
|
|
|
|
@ -300,6 +306,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
case _isTemplate = "isTemplate" |
|
|
|
|
case _publishProg = "publishProg" |
|
|
|
|
case _showTeamsInProg = "showTeamsInProg" |
|
|
|
|
case _clubMemberFeeDeduction = "clubMemberFeeDeduction" |
|
|
|
|
case _unregisterDeltaInHours = "unregisterDeltaInHours" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static func _decodePayment(container: KeyedDecodingContainer<CodingKeys>) throws -> TournamentPayment? { |
|
|
|
|
@ -440,6 +448,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
self.isTemplate = try container.decodeIfPresent(Bool.self, forKey: ._isTemplate) ?? false |
|
|
|
|
self.publishProg = try container.decodeIfPresent(Bool.self, forKey: ._publishProg) ?? false |
|
|
|
|
self.showTeamsInProg = try container.decodeIfPresent(Bool.self, forKey: ._showTeamsInProg) ?? false |
|
|
|
|
self.clubMemberFeeDeduction = try container.decodeIfPresent(Double.self, forKey: ._clubMemberFeeDeduction) ?? nil |
|
|
|
|
self.unregisterDeltaInHours = try container.decodeIfPresent(Int.self, forKey: ._unregisterDeltaInHours) ?? 24 |
|
|
|
|
try super.init(from: decoder) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -514,6 +524,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
try container.encode(self.isTemplate, forKey: ._isTemplate) |
|
|
|
|
try container.encode(self.publishProg, forKey: ._publishProg) |
|
|
|
|
try container.encode(self.showTeamsInProg, forKey: ._showTeamsInProg) |
|
|
|
|
try container.encode(self.clubMemberFeeDeduction, forKey: ._clubMemberFeeDeduction) |
|
|
|
|
try container.encode(self.unregisterDeltaInHours, forKey: ._unregisterDeltaInHours) |
|
|
|
|
try super.encode(to: encoder) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -593,6 +605,8 @@ public class BaseTournament: SyncedModelObject, SyncedStorable { |
|
|
|
|
self.isTemplate = tournament.isTemplate |
|
|
|
|
self.publishProg = tournament.publishProg |
|
|
|
|
self.showTeamsInProg = tournament.showTeamsInProg |
|
|
|
|
self.clubMemberFeeDeduction = tournament.clubMemberFeeDeduction |
|
|
|
|
self.unregisterDeltaInHours = tournament.unregisterDeltaInHours |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static func relationships() -> [Relationship] { |
|
|
|
|
|