|
|
|
@ -113,7 +113,8 @@ final class ServerDataTests: XCTestCase { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let tournament = Tournament(event: eventId, name: "RG Homme", startDate: Date(), endDate: nil, creationDate: Date(), isPrivate: false, groupStageFormat: MatchFormat.megaTie, roundFormat: MatchFormat.nineGames, loserRoundFormat: MatchFormat.nineGamesDecisivePoint, groupStageSortMode: GroupStageOrderingMode.snake, groupStageCount: 2, rankSourceDate: Date(), dayDuration: 5, teamCount: 3, teamSorting: TeamSortingType.rank, federalCategory: TournamentCategory.mix, federalLevelCategory: TournamentLevel.p1000, federalAgeCategory: FederalTournamentAge.a45, closedRegistrationDate: Date(), groupStageAdditionalQualified: 4, courtCount: 9, prioritizeClubMembers: true, qualifiedPerGroupStage: 1, teamsPerGroupStage: 2, entryFee: 30.0, additionalEstimationDuration: 5, isDeleted: true, publishTeams: true, publishSummons: true, publishGroupStages: true, publishBrackets: true, shouldVerifyBracket: true, shouldVerifyGroupStage: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true, loserBracketMode: .manual, initialSeedRound: 8, initialSeedCount: 4, accountIsRequired: false, licenseIsRequired: false, minimumPlayerPerTeam: 3, maximumPlayerPerTeam: 5, information: "Super", umpireCustomMail: "razmig@padelclub.app", umpireCustomContact: "Raz", umpireCustomPhone: "+33681598193", hideUmpireMail: true, hideUmpirePhone: true, disableRankingFederalRuling: true, teamCountLimit: false) |
|
|
|
let tournament = Tournament(event: eventId, name: "RG Homme", startDate: Date(), endDate: nil, creationDate: Date(), isPrivate: false, groupStageFormat: MatchFormat.megaTie, roundFormat: MatchFormat.nineGames, loserRoundFormat: MatchFormat.nineGamesDecisivePoint, groupStageSortMode: GroupStageOrderingMode.snake, groupStageCount: 2, rankSourceDate: Date(), dayDuration: 5, teamCount: 3, teamSorting: TeamSortingType.rank, federalCategory: TournamentCategory.mix, federalLevelCategory: TournamentLevel.p1000, federalAgeCategory: FederalTournamentAge.a45, closedRegistrationDate: Date(), groupStageAdditionalQualified: 4, courtCount: 9, prioritizeClubMembers: true, qualifiedPerGroupStage: 1, teamsPerGroupStage: 2, entryFee: 30.0, additionalEstimationDuration: 5, isDeleted: true, publishTeams: true, publishSummons: true, publishGroupStages: true, publishBrackets: true, shouldVerifyGroupStage: true, shouldVerifyBracket: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true, loserBracketMode: .manual, initialSeedRound: 8, initialSeedCount: 4, accountIsRequired: false, licenseIsRequired: false, minimumPlayerPerTeam: 3, maximumPlayerPerTeam: 5, information: "Super", umpireCustomMail: "razmig@padelclub.app", umpireCustomContact: "Raz", umpireCustomPhone: "+33681598193", hideUmpireMail: true, hideUmpirePhone: true, disableRankingFederalRuling: true, teamCountLimit: false, enableOnlinePayment: false, onlinePaymentIsMandatory: false, enableOnlinePaymentRefund: false, refundDateLimit: nil, stripeAccountId: nil, enableTimeToConfirm: false, isCorporateTournament: false, isTemplate: false |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
tournament.isCanceled = true |
|
|
|
tournament.isCanceled = true |
|
|
|
tournament.payment = .subscriptionUnit |
|
|
|
tournament.payment = .subscriptionUnit |
|
|
|
@ -176,6 +177,14 @@ final class ServerDataTests: XCTestCase { |
|
|
|
assert(t.hideUmpirePhone == tournament.hideUmpirePhone) |
|
|
|
assert(t.hideUmpirePhone == tournament.hideUmpirePhone) |
|
|
|
assert(t.disableRankingFederalRuling == tournament.disableRankingFederalRuling) |
|
|
|
assert(t.disableRankingFederalRuling == tournament.disableRankingFederalRuling) |
|
|
|
assert(t.teamCountLimit == tournament.teamCountLimit) |
|
|
|
assert(t.teamCountLimit == tournament.teamCountLimit) |
|
|
|
|
|
|
|
assert(t.enableOnlinePayment == tournament.enableOnlinePayment) |
|
|
|
|
|
|
|
assert(t.onlinePaymentIsMandatory == tournament.onlinePaymentIsMandatory) |
|
|
|
|
|
|
|
assert(t.enableOnlinePaymentRefund == tournament.enableOnlinePaymentRefund) |
|
|
|
|
|
|
|
assert(t.refundDateLimit?.formatted() == tournament.refundDateLimit?.formatted()) |
|
|
|
|
|
|
|
assert(t.stripeAccountId == tournament.stripeAccountId) |
|
|
|
|
|
|
|
assert(t.enableTimeToConfirm == tournament.enableTimeToConfirm) |
|
|
|
|
|
|
|
assert(t.isCorporateTournament == tournament.isCorporateTournament) |
|
|
|
|
|
|
|
assert(t.isTemplate == tournament.isTemplate) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
XCTFail("missing data") |
|
|
|
XCTFail("missing data") |
|
|
|
} |
|
|
|
} |
|
|
|
@ -289,7 +298,7 @@ final class ServerDataTests: XCTestCase { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let playerRegistration = PlayerRegistration(teamRegistration: teamRegistrationId, firstName: "juan", lastName: "lebron", licenceId: "123", rank: 11, paymentType: PlayerPaymentType.cash, sex: PlayerSexType.male, tournamentPlayed: 2, points: 33, clubName: "le club", ligueName: "la league", assimilation: "ass", phoneNumber: "123123", email: "email@email.com", birthdate: nil, computedRank: 222, source: PlayerRegistration.PlayerDataSource.frenchFederation, hasArrived: true) |
|
|
|
let playerRegistration = PlayerRegistration(teamRegistration: teamRegistrationId, firstName: "juan", lastName: "lebron", licenceId: "123", rank: 11, paymentType: PlayerPaymentType.cash, sex: PlayerSexType.male, tournamentPlayed: 2, points: 33, clubName: "le club", ligueName: "la league", assimilation: "ass", phoneNumber: "123123", email: "email@email.com", birthdate: nil, computedRank: 222, source: PlayerRegistration.PlayerDataSource.frenchFederation, hasArrived: true, coach: false, captain: false, registeredOnline: false, timeToConfirm: nil, registrationStatus: PlayerRegistration.RegistrationStatus.waiting, paymentId: nil) |
|
|
|
playerRegistration.storeId = "123" |
|
|
|
playerRegistration.storeId = "123" |
|
|
|
|
|
|
|
|
|
|
|
if let pr: PlayerRegistration = try await StoreCenter.main.service().post(playerRegistration) { |
|
|
|
if let pr: PlayerRegistration = try await StoreCenter.main.service().post(playerRegistration) { |
|
|
|
@ -316,6 +325,12 @@ final class ServerDataTests: XCTestCase { |
|
|
|
assert(pr.captain == playerRegistration.captain) |
|
|
|
assert(pr.captain == playerRegistration.captain) |
|
|
|
assert(pr.coach == playerRegistration.coach) |
|
|
|
assert(pr.coach == playerRegistration.coach) |
|
|
|
assert(pr.registeredOnline == playerRegistration.registeredOnline) |
|
|
|
assert(pr.registeredOnline == playerRegistration.registeredOnline) |
|
|
|
|
|
|
|
assert(pr.captain == playerRegistration.captain) |
|
|
|
|
|
|
|
assert(pr.coach == playerRegistration.coach) |
|
|
|
|
|
|
|
assert(pr.registeredOnline == playerRegistration.registeredOnline) |
|
|
|
|
|
|
|
assert(pr.timeToConfirm == playerRegistration.timeToConfirm) |
|
|
|
|
|
|
|
assert(pr.registrationStatus == playerRegistration.registrationStatus) |
|
|
|
|
|
|
|
assert(pr.paymentId == playerRegistration.paymentId) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
XCTFail("missing data") |
|
|
|
XCTFail("missing data") |
|
|
|
} |
|
|
|
} |
|
|
|
|