@lyxa.ai/marketing 1.0.50 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +31 -6
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts +2 -0
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.repository.js +8 -0
- package/dist/lib/modules/tournament/participant/participant.repository.js.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.router.d.ts +27 -4
- package/dist/lib/modules/tournament/participant/participant.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.router.js +7 -0
- package/dist/lib/modules/tournament/participant/participant.router.js.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.service.d.ts +2 -2
- package/dist/lib/modules/tournament/participant/participant.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.service.js +20 -6
- package/dist/lib/modules/tournament/participant/participant.service.js.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.validation.d.ts +144 -36
- package/dist/lib/modules/tournament/participant/participant.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.validation.js +10 -3
- package/dist/lib/modules/tournament/participant/participant.validation.js.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.service.js +2 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.router.d.ts +2 -2
- package/dist/lib/modules/tournament/team/team.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.service.js +2 -0
- package/dist/lib/modules/tournament/team/team.service.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.validation.d.ts +14 -14
- package/dist/lib/modules/tournament/tournament.router.d.ts +148 -122
- package/dist/lib/modules/tournament/tournament.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.router.js +7 -2
- package/dist/lib/modules/tournament/tournament.router.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.service.d.ts +3 -1
- package/dist/lib/modules/tournament/tournament.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.service.js +17 -2
- package/dist/lib/modules/tournament/tournament.service.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.types.d.ts +5 -0
- package/dist/lib/modules/tournament/tournament.types.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.types.js +7 -1
- package/dist/lib/modules/tournament/tournament.types.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.validation.d.ts +15 -0
- package/dist/lib/modules/tournament/tournament.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.validation.js +4 -1
- package/dist/lib/modules/tournament/tournament.validation.js.map +1 -1
- package/dist/types/index.d.ts +31 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.repository.d.ts +2 -0
- package/dist/types/modules/tournament/participant/participant.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.router.d.ts +27 -4
- package/dist/types/modules/tournament/participant/participant.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.service.d.ts +2 -2
- package/dist/types/modules/tournament/participant/participant.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.validation.d.ts +144 -36
- package/dist/types/modules/tournament/participant/participant.validation.d.ts.map +1 -1
- package/dist/types/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.router.d.ts +2 -2
- package/dist/types/modules/tournament/team/team.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.validation.d.ts +14 -14
- package/dist/types/modules/tournament/tournament.router.d.ts +148 -122
- package/dist/types/modules/tournament/tournament.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.service.d.ts +3 -1
- package/dist/types/modules/tournament/tournament.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.types.d.ts +5 -0
- package/dist/types/modules/tournament/tournament.types.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.validation.d.ts +15 -0
- package/dist/types/modules/tournament/tournament.validation.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prediction.service.js","sourceRoot":"/","sources":["modules/tournament/prediction/prediction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,4EAAyF;AAOzF,mEAA6D;AAC7D,6DAAuD;AACvD,4EAAsE;AAEtE,gEAAoE;AACpE,0DAA2C;AAGpC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAClB,UAAU,CAAuB;IACjC,eAAe,CAA4B;IAC3C,kBAAkB,CAAqB;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAoB,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAyB,CAAC,CAAC;QAChE,IAAI,CAAC,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,wCAAkB,CAAC,CAAC;IAChE,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,YAAqC,EAAE,OAAgC;QAC3F,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU;YAAE,MAAM,IAAA,4BAAa,EAAC,oCAAoC,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK;YAAE,MAAM,IAAA,4BAAa,EAAC,iBAAiB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C,gBAAgB,CACjD,WAAW,CAAC,GAAG,EACf,KAAK,CAAC,OAAO,EACb,sCAAiB,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAClD,CAAC;QACF,IAAI,CAAC,MAAM;YAAE,MAAM,IAAA,4BAAa,EAAC,uBAAuB,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO;YAAE,MAAM,IAAA,4BAAa,EAAC,mCAAmC,CAAC,CAAC;QAEvE,OAAO,OAAyC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAA+B,EAAE,KAA4B;QAC1E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QACrG,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxG,OAAQ,UAA6C,IAAI,IAAI,CAAC;IAClE,CAAC;CACJ,CAAA;AArHY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,gBAAO,GAAE;;GACG,iBAAiB,CAqH7B;AAEY,QAAA,iBAAiB,GAAG,gBAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {badRequestError, notFoundError} from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n CreatePredictionInputDTO,\n EditPredictionInputDTO,\n GetPredictionInputDTO,\n PredictionOutputDTO\n} from './prediction.validation';\nimport {PredictionRepository} from './prediction.repository';\nimport {PredictionBuilder} from './prediction.builder';\nimport {ParticipantService} from '../participant/participant.service';\nimport {TournamentParticipantOutputDTO} from '../participant/participant.validation';\nimport {TournamentMatchRepository} from '../match/match.repository';\nimport {utcNow} from '../tournament.utils';\n\n@Service()\nexport class PredictionService {\n private repository: PredictionRepository;\n private matchRepository: TournamentMatchRepository;\n private participantService: ParticipantService;\n\n constructor() {\n this.repository = Container.get(PredictionRepository);\n this.matchRepository = Container.get(TournamentMatchRepository);\n this.participantService = Container.get(ParticipantService);\n }\n\n private async findMatch(tournamentId: mongoose.Types.ObjectId, matchId: mongoose.Types.ObjectId) {\n const tournament = await this.matchRepository.findMatchInTournament(tournamentId, matchId);\n if (!tournament) throw notFoundError('Match not found in this tournament');\n const match = tournament.matches.find(m => m._id.toString() === matchId.toString());\n if (!match) throw notFoundError('Match not found');\n return match;\n }\n\n private ensureMatchIsOpen(match: { startingDate?: Date | null; endDate?: Date | null }) {\n if (match.endDate) throw badRequestError('This match has already ended'); // change to flag \"matchEnded\n if (match.startingDate && match.startingDate <= utcNow()) {\n throw badRequestError('The prediction window for this match has closed');\n }\n }\n\n private ensureMatchInvolvesParticipantTeam(\n match: { team1: { teamId: mongoose.Types.ObjectId }; team2: { teamId: mongoose.Types.ObjectId } },\n participant: TournamentParticipantOutputDTO\n ) {\n const teamId = participant.teamId.toString();\n const involved = match.team1.teamId.toString() === teamId || match.team2.teamId.toString() === teamId;\n if (!involved) throw badRequestError('You can only predict for matches involving your selected team');\n }\n\n private ensureNoPriorPrediction(participant: TournamentParticipantOutputDTO, matchId: mongoose.Types.ObjectId) {\n const exists = participant.predictions.some(p => p.matchId.toString() === matchId.toString());\n if (exists) throw badRequestError('You have already predicted for this match');\n }\n\n private findPrediction(participant: TournamentParticipantOutputDTO, matchId: mongoose.Types.ObjectId) {\n const prediction = participant.predictions.find(p => p.matchId.toString() === matchId.toString());\n if (!prediction) throw notFoundError('No prediction found for this match');\n return prediction;\n }\n\n private resolveOutcomes(\n participants: TournamentParticipantOutputDTO[],\n matchId: mongoose.Types.ObjectId,\n finalScore: { team1: number; team2: number }\n ): {winnerIds: mongoose.Types.ObjectId[]; loserIds: mongoose.Types.ObjectId[]} {\n const winnerIds: mongoose.Types.ObjectId[] = [];\n const loserIds: mongoose.Types.ObjectId[] = [];\n\n for (const participant of participants) {\n const prediction = participant.predictions.find(p => p.matchId.toString() === matchId.toString());\n if (!prediction) continue;\n\n const isWinner = prediction.score.team1 === finalScore.team1 && prediction.score.team2 === finalScore.team2;\n (isWinner ? winnerIds : loserIds).push(participant.userId);\n }\n\n return {winnerIds, loserIds};\n }\n\n public async evaluate(\n tournamentId: mongoose.Types.ObjectId,\n matchId: mongoose.Types.ObjectId,\n finalScore: { team1: number; team2: number }\n ): Promise<{winnerIds: mongoose.Types.ObjectId[]; loserIds: mongoose.Types.ObjectId[]}> {\n const participants = await this.participantService.getAll(tournamentId);\n const outcomes = this.resolveOutcomes(participants, matchId, finalScore);\n await this.repository.evaluate(tournamentId, matchId, finalScore);\n return outcomes;\n }\n\n public async create(userId: mongoose.Types.ObjectId, input: CreatePredictionInputDTO): Promise<PredictionOutputDTO> {\n const match = await this.findMatch(input.tournamentId, input.matchId);\n this.ensureMatchIsOpen(match);\n\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n this.ensureMatchInvolvesParticipantTeam(match, participant);\n this.ensureNoPriorPrediction(participant, input.matchId);\n\n const prediction = PredictionBuilder.buildPrediction(input.matchId, input.score);\n const result = await this.repository.addPrediction(participant._id, prediction);\n if (!result) throw notFoundError('Participant not found');\n\n return prediction as PredictionOutputDTO;\n }\n\n public async edit(userId: mongoose.Types.ObjectId, input: EditPredictionInputDTO): Promise<PredictionOutputDTO> {\n const match = await this.findMatch(input.tournamentId, input.matchId);\n this.ensureMatchIsOpen(match);\n\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n this.ensureMatchInvolvesParticipantTeam(match, participant);\n this.findPrediction(participant, input.matchId);\n\n const result = await this.repository.updatePrediction(\n participant._id,\n input.matchId,\n PredictionBuilder.buildScoreUpdate(input.score)\n );\n if (!result) throw notFoundError('Participant not found');\n\n const updated = result.predictions.find(p => p.matchId.toString() === input.matchId.toString());\n if (!updated) throw notFoundError('Prediction not found after update');\n\n return updated as unknown as PredictionOutputDTO;\n }\n\n public async get(userId: mongoose.Types.ObjectId, input: GetPredictionInputDTO): Promise<PredictionOutputDTO | null> {\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n const prediction = participant.predictions.find(p => p.matchId.toString() === input.matchId.toString());\n return (prediction as unknown as PredictionOutputDTO) ?? null;\n }\n}\n\nexport const predictionService = Container.get(PredictionService);\n"]}
|
|
1
|
+
{"version":3,"file":"prediction.service.js","sourceRoot":"/","sources":["modules/tournament/prediction/prediction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,4EAAyF;AAOzF,mEAA6D;AAC7D,6DAAuD;AACvD,4EAAsE;AAEtE,gEAAoE;AACpE,0DAA2C;AAGpC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAClB,UAAU,CAAuB;IACjC,eAAe,CAA4B;IAC3C,kBAAkB,CAAqB;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAoB,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAyB,CAAC,CAAC;QAChE,IAAI,CAAC,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,wCAAkB,CAAC,CAAC;IAChE,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,YAAqC,EAAE,OAAgC;QAC3F,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU;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AAI,CAAC;IAClE,CAAC;CACJ,CAAA;AAtHY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,gBAAO,GAAE;;GACG,iBAAiB,CAsH7B;AAEY,QAAA,iBAAiB,GAAG,gBAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {badRequestError, notFoundError} from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n CreatePredictionInputDTO,\n EditPredictionInputDTO,\n GetPredictionInputDTO,\n PredictionOutputDTO\n} from './prediction.validation';\nimport {PredictionRepository} from './prediction.repository';\nimport {PredictionBuilder} from './prediction.builder';\nimport {ParticipantService} from '../participant/participant.service';\nimport {TournamentParticipantOutputDTO} from '../participant/participant.validation';\nimport {TournamentMatchRepository} from '../match/match.repository';\nimport {utcNow} from '../tournament.utils';\n\n@Service()\nexport class PredictionService {\n private repository: PredictionRepository;\n private matchRepository: TournamentMatchRepository;\n private participantService: ParticipantService;\n\n constructor() {\n this.repository = Container.get(PredictionRepository);\n this.matchRepository = Container.get(TournamentMatchRepository);\n this.participantService = Container.get(ParticipantService);\n }\n\n private async findMatch(tournamentId: mongoose.Types.ObjectId, matchId: mongoose.Types.ObjectId) {\n const tournament = await this.matchRepository.findMatchInTournament(tournamentId, matchId);\n if (!tournament) throw notFoundError('Match not found in this tournament');\n const match = tournament.matches.find(m => m._id.toString() === matchId.toString());\n if (!match) throw notFoundError('Match not found');\n return match;\n }\n\n private ensureMatchIsOpen(match: { startingDate?: Date | null; endDate?: Date | null }) {\n if (match.endDate) throw badRequestError('This match has already ended'); // change to flag \"matchEnded\n if (match.startingDate && match.startingDate <= utcNow()) {\n throw badRequestError('The prediction window for this match has closed');\n }\n }\n\n private ensureMatchInvolvesParticipantTeam(\n match: { team1: { teamId: mongoose.Types.ObjectId }; team2: { teamId: mongoose.Types.ObjectId } },\n participant: TournamentParticipantOutputDTO\n ) {\n if (!participant.teamId) throw badRequestError('You have not joined this tournament');\n const teamId = participant.teamId.toString();\n const involved = match.team1.teamId.toString() === teamId || match.team2.teamId.toString() === teamId;\n if (!involved) throw badRequestError('You can only predict for matches involving your selected team');\n }\n\n private ensureNoPriorPrediction(participant: TournamentParticipantOutputDTO, matchId: mongoose.Types.ObjectId) {\n const exists = participant.predictions.some(p => p.matchId.toString() === matchId.toString());\n if (exists) throw badRequestError('You have already predicted for this match');\n }\n\n private findPrediction(participant: TournamentParticipantOutputDTO, matchId: mongoose.Types.ObjectId) {\n const prediction = participant.predictions.find(p => p.matchId.toString() === matchId.toString());\n if (!prediction) throw notFoundError('No prediction found for this match');\n return prediction;\n }\n\n private resolveOutcomes(\n participants: TournamentParticipantOutputDTO[],\n matchId: mongoose.Types.ObjectId,\n finalScore: { team1: number; team2: number }\n ): {winnerIds: mongoose.Types.ObjectId[]; loserIds: mongoose.Types.ObjectId[]} {\n const winnerIds: mongoose.Types.ObjectId[] = [];\n const loserIds: mongoose.Types.ObjectId[] = [];\n\n for (const participant of participants) {\n const prediction = participant.predictions.find(p => p.matchId.toString() === matchId.toString());\n if (!prediction) continue;\n\n const isWinner = prediction.score.team1 === finalScore.team1 && prediction.score.team2 === finalScore.team2;\n (isWinner ? winnerIds : loserIds).push(participant.userId);\n }\n\n return {winnerIds, loserIds};\n }\n\n public async evaluate(\n tournamentId: mongoose.Types.ObjectId,\n matchId: mongoose.Types.ObjectId,\n finalScore: { team1: number; team2: number }\n ): Promise<{winnerIds: mongoose.Types.ObjectId[]; loserIds: mongoose.Types.ObjectId[]}> {\n const participants = await this.participantService.getAll(tournamentId);\n const outcomes = this.resolveOutcomes(participants, matchId, finalScore);\n await this.repository.evaluate(tournamentId, matchId, finalScore);\n return outcomes;\n }\n\n public async create(userId: mongoose.Types.ObjectId, input: CreatePredictionInputDTO): Promise<PredictionOutputDTO> {\n const match = await this.findMatch(input.tournamentId, input.matchId);\n this.ensureMatchIsOpen(match);\n\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n this.ensureMatchInvolvesParticipantTeam(match, participant);\n this.ensureNoPriorPrediction(participant, input.matchId);\n\n const prediction = PredictionBuilder.buildPrediction(input.matchId, input.score);\n const result = await this.repository.addPrediction(participant._id, prediction);\n if (!result) throw notFoundError('Participant not found');\n\n return prediction as PredictionOutputDTO;\n }\n\n public async edit(userId: mongoose.Types.ObjectId, input: EditPredictionInputDTO): Promise<PredictionOutputDTO> {\n const match = await this.findMatch(input.tournamentId, input.matchId);\n this.ensureMatchIsOpen(match);\n\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n this.ensureMatchInvolvesParticipantTeam(match, participant);\n this.findPrediction(participant, input.matchId);\n\n const result = await this.repository.updatePrediction(\n participant._id,\n input.matchId,\n PredictionBuilder.buildScoreUpdate(input.score)\n );\n if (!result) throw notFoundError('Participant not found');\n\n const updated = result.predictions.find(p => p.matchId.toString() === input.matchId.toString());\n if (!updated) throw notFoundError('Prediction not found after update');\n\n return updated as unknown as PredictionOutputDTO;\n }\n\n public async get(userId: mongoose.Types.ObjectId, input: GetPredictionInputDTO): Promise<PredictionOutputDTO | null> {\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n const prediction = participant.predictions.find(p => p.matchId.toString() === input.matchId.toString());\n return (prediction as unknown as PredictionOutputDTO) ?? null;\n }\n}\n\nexport const predictionService = Container.get(PredictionService);\n"]}
|
|
@@ -142,6 +142,7 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
142
142
|
team2: number | null;
|
|
143
143
|
};
|
|
144
144
|
stage: string;
|
|
145
|
+
matchStatus: import("../tournament.types").MatchStatus;
|
|
145
146
|
prediction: {
|
|
146
147
|
score: {
|
|
147
148
|
team1: number | null;
|
|
@@ -150,7 +151,6 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
150
151
|
succeeded: boolean | null;
|
|
151
152
|
} | null;
|
|
152
153
|
canPredict: boolean;
|
|
153
|
-
matchStatus: import("../tournament.types").MatchStatus;
|
|
154
154
|
endDate?: Date | null | undefined;
|
|
155
155
|
additionalTag?: string | undefined;
|
|
156
156
|
winnerId?: string | mongoose.Types.ObjectId | null | undefined;
|
|
@@ -180,6 +180,7 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
180
180
|
team2: number | null;
|
|
181
181
|
};
|
|
182
182
|
stage: string;
|
|
183
|
+
matchStatus: import("../tournament.types").MatchStatus;
|
|
183
184
|
prediction: {
|
|
184
185
|
score: {
|
|
185
186
|
team1: number | null;
|
|
@@ -188,7 +189,6 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
188
189
|
succeeded: boolean | null;
|
|
189
190
|
} | null;
|
|
190
191
|
canPredict: boolean;
|
|
191
|
-
matchStatus: import("../tournament.types").MatchStatus;
|
|
192
192
|
endDate?: Date | null | undefined;
|
|
193
193
|
additionalTag?: string | undefined;
|
|
194
194
|
winnerId?: string | mongoose.Types.ObjectId | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.service.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACH,0BAA0B,EAC1B,sBAAsB,EAEtB,8BAA8B,EAC9B,4BAA4B,EAC/B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAKxE,qBACa,WAAW;IACpB,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,kBAAkB,CAAqB;;IAO/C,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,iBAAiB;IAYZ,GAAG,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAU1E,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAcpF,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"team.service.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACH,0BAA0B,EAC1B,sBAAsB,EAEtB,8BAA8B,EAC9B,4BAA4B,EAC/B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAKxE,qBACa,WAAW;IACpB,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,kBAAkB,CAAqB;;IAO/C,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,iBAAiB;IAYZ,GAAG,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAU1E,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAcpF,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC;CAyCnI;AAED,eAAO,MAAM,WAAW,aAA6B,CAAC"}
|
|
@@ -107,6 +107,8 @@ let TeamService = class TeamService {
|
|
|
107
107
|
throw (0, error_common_1.notFoundError)('Tournament not found');
|
|
108
108
|
const teamPictureById = new Map(tournament.teams.map(t => [t._id.toString(), t.picture]));
|
|
109
109
|
const now = (0, tournament_utils_1.utcNow)();
|
|
110
|
+
if (!participant.teamId)
|
|
111
|
+
throw (0, error_common_1.badRequestError)('You have not joined this tournament');
|
|
110
112
|
const teamMatches = this.filterMatchesByTeam(tournament.matches, participant.teamId);
|
|
111
113
|
const filteredMatches = this.applyStatusFilter(teamMatches, now, input.filter);
|
|
112
114
|
const predictionsByMatchId = new Map(participant.predictions.map(p => [p.matchId.toString(), p]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.service.js","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAEzC,
|
|
1
|
+
{"version":3,"file":"team.service.js","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAEzC,4EAA2F;AAQ3F,uDAA6D;AAC7D,4EAAwE;AACxE,iDAA6C;AAG7C,0DAA2C;AAC3C,0DAAgD;AAGzC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACZ,UAAU,CAA2B;IACrC,kBAAkB,CAAqB;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,0CAAwB,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,wCAAkB,CAAC,CAAC;IAChE,CAAC;IAEO,mBAAmB,CAAC,OAAmC,EAAE,MAA+B;QAC5F,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC1B,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAC7F,CAAC;IACN,CAAC;IAEO,cAAc,CAAC,KAA+B,EAAE,GAAS;QAC7D,IAAI,KAAK,CAAC,OAAO;YAAE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YAAY,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;gBACrE,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC;aAC/C,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO;YACH,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO;SACwB,CAAC;IACxC,CAAC;CACJ,CAAA;AAlGY,kCAAW;sBAAX,WAAW;IADvB,IAAA,gBAAO,GAAE;;GACG,WAAW,CAkGvB;AAEY,QAAA,WAAW,GAAG,gBAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { mongoose } from '@typegoose/typegoose';\nimport { badRequestError, notFoundError } from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n AddTournamentTeamsInputDTO,\n GetTeamMatchesInputDTO,\n TournamentTeamOutputDTO,\n TournamentWithMatchesOutputDTO,\n TournamentWithTeamsOutputDTO,\n} from './team.validation';\nimport { TournamentTeamRepository } from './team.repository';\nimport { ParticipantService } from '../participant/participant.service';\nimport { TeamBuilder } from './team.builder';\nimport { TournamentConfigOutputDTO } from '../config/config.validation';\nimport { TournamentMatchOutputDTO } from '../match/match.validation';\nimport {utcNow} from '../tournament.utils';\nimport {MatchStatus} from '../tournament.types';\n\n@Service()\nexport class TeamService {\n private repository: TournamentTeamRepository;\n private participantService: ParticipantService;\n\n constructor() {\n this.repository = Container.get(TournamentTeamRepository);\n this.participantService = Container.get(ParticipantService);\n }\n\n private filterMatchesByTeam(matches: TournamentMatchOutputDTO[], teamId: mongoose.Types.ObjectId): TournamentMatchOutputDTO[] {\n return matches.filter(match =>\n [match.team1.teamId.toString(), match.team2.teamId.toString()].includes(teamId.toString())\n );\n }\n\n private getMatchStatus(match: TournamentMatchOutputDTO, now: Date): MatchStatus {\n if (match.endDate) return MatchStatus.ENDED;\n if (match.startingDate && match.startingDate <= now) return MatchStatus.STARTED;\n return MatchStatus.UPCOMING;\n }\n\n private applyStatusFilter(matches: TournamentMatchOutputDTO[], now: Date, filter?: MatchStatus): TournamentMatchOutputDTO[] {\n const filtered = filter\n ? matches.filter(match => this.getMatchStatus(match, now) === filter)\n : matches;\n\n return filtered.sort((a, b) => {\n const aTime = a.startingDate ? new Date(a.startingDate).getTime() : 0;\n const bTime = b.startingDate ? new Date(b.startingDate).getTime() : 0;\n return filter === MatchStatus.ENDED ? bTime - aTime : aTime - bTime;\n });\n }\n\n public async add(input: AddTournamentTeamsInputDTO): Promise<TournamentConfigOutputDTO> {\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n const result = await this.repository.addTeams(input.tournamentId, TeamBuilder.buildTeams(input.teams));\n if (!result) throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: 'Failed to add teams' });\n\n return result as TournamentConfigOutputDTO;\n }\n\n public async getAll(tournamentId: mongoose.Types.ObjectId): Promise<TournamentWithTeamsOutputDTO> {\n const tournament = await this.repository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n return {\n tournamentId,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n teams: tournament.teams as TournamentTeamOutputDTO[],\n } as TournamentWithTeamsOutputDTO;\n }\n\n public async getMatches(userId: mongoose.Types.ObjectId, input: GetTeamMatchesInputDTO): Promise<TournamentWithMatchesOutputDTO> {\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n const teamPictureById = new Map(\n (tournament.teams as TournamentTeamOutputDTO[]).map(t => [t._id.toString(), t.picture])\n );\n\n const now = utcNow();\n if (!participant.teamId) throw badRequestError('You have not joined this tournament');\n const teamMatches = this.filterMatchesByTeam(tournament.matches as TournamentMatchOutputDTO[], participant.teamId);\n const filteredMatches = this.applyStatusFilter(teamMatches, now, input.filter);\n\n const predictionsByMatchId = new Map(\n participant.predictions.map(p => [p.matchId.toString(), p])\n );\n\n const matches = filteredMatches.map(match => {\n const prediction = predictionsByMatchId.get(match._id.toString());\n return {\n ...match,\n team1: { ...match.team1, picture: teamPictureById.get(match.team1.teamId.toString()) },\n team2: { ...match.team2, picture: teamPictureById.get(match.team2.teamId.toString()) },\n prediction: prediction\n ? { score: prediction.score, succeeded: prediction.succeeded ?? null }\n : null,\n canPredict: !match.startingDate || now < new Date(match.startingDate),\n matchStatus: this.getMatchStatus(match, now),\n };\n });\n\n return {\n tournamentId: input.tournamentId,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n matches,\n } as TournamentWithMatchesOutputDTO;\n }\n}\n\nexport const teamService = Container.get(TeamService);\n"]}
|
|
@@ -198,6 +198,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
198
198
|
team2: number | null;
|
|
199
199
|
};
|
|
200
200
|
stage: string;
|
|
201
|
+
matchStatus: MatchStatus;
|
|
201
202
|
prediction: {
|
|
202
203
|
score: {
|
|
203
204
|
team1: number | null;
|
|
@@ -206,7 +207,6 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
206
207
|
succeeded: boolean | null;
|
|
207
208
|
} | null;
|
|
208
209
|
canPredict: boolean;
|
|
209
|
-
matchStatus: MatchStatus;
|
|
210
210
|
endDate?: Date | null | undefined;
|
|
211
211
|
additionalTag?: string | undefined;
|
|
212
212
|
winnerId?: import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -228,6 +228,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
228
228
|
team2: number | null;
|
|
229
229
|
};
|
|
230
230
|
stage: string;
|
|
231
|
+
matchStatus: MatchStatus;
|
|
231
232
|
prediction: {
|
|
232
233
|
score: {
|
|
233
234
|
team1: number | null;
|
|
@@ -236,7 +237,6 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
236
237
|
succeeded: boolean | null;
|
|
237
238
|
} | null;
|
|
238
239
|
canPredict: boolean;
|
|
239
|
-
matchStatus: MatchStatus;
|
|
240
240
|
endDate?: Date | null | undefined;
|
|
241
241
|
additionalTag?: string | undefined;
|
|
242
242
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -263,6 +263,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
263
263
|
team2: number | null;
|
|
264
264
|
};
|
|
265
265
|
stage: string;
|
|
266
|
+
matchStatus: MatchStatus;
|
|
266
267
|
prediction: {
|
|
267
268
|
score: {
|
|
268
269
|
team1: number | null;
|
|
@@ -271,7 +272,6 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
271
272
|
succeeded: boolean | null;
|
|
272
273
|
} | null;
|
|
273
274
|
canPredict: boolean;
|
|
274
|
-
matchStatus: MatchStatus;
|
|
275
275
|
endDate?: Date | null | undefined;
|
|
276
276
|
additionalTag?: string | undefined;
|
|
277
277
|
winnerId?: import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -300,6 +300,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
300
300
|
team2: number | null;
|
|
301
301
|
};
|
|
302
302
|
stage: string;
|
|
303
|
+
matchStatus: MatchStatus;
|
|
303
304
|
prediction: {
|
|
304
305
|
score: {
|
|
305
306
|
team1: number | null;
|
|
@@ -308,7 +309,6 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
308
309
|
succeeded: boolean | null;
|
|
309
310
|
} | null;
|
|
310
311
|
canPredict: boolean;
|
|
311
|
-
matchStatus: MatchStatus;
|
|
312
312
|
endDate?: Date | null | undefined;
|
|
313
313
|
additionalTag?: string | undefined;
|
|
314
314
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -634,6 +634,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
634
634
|
team2: number | null;
|
|
635
635
|
};
|
|
636
636
|
stage: string;
|
|
637
|
+
matchStatus: MatchStatus;
|
|
637
638
|
prediction: {
|
|
638
639
|
score: {
|
|
639
640
|
team1: number | null;
|
|
@@ -642,7 +643,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
642
643
|
succeeded: boolean | null;
|
|
643
644
|
} | null;
|
|
644
645
|
canPredict: boolean;
|
|
645
|
-
matchStatus: MatchStatus;
|
|
646
646
|
endDate?: Date | null | undefined;
|
|
647
647
|
additionalTag?: string | undefined;
|
|
648
648
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -671,6 +671,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
671
671
|
team2: number | null;
|
|
672
672
|
};
|
|
673
673
|
stage: string;
|
|
674
|
+
matchStatus: MatchStatus;
|
|
674
675
|
prediction: {
|
|
675
676
|
score: {
|
|
676
677
|
team1: number | null;
|
|
@@ -679,7 +680,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
679
680
|
succeeded: boolean | null;
|
|
680
681
|
} | null;
|
|
681
682
|
canPredict: boolean;
|
|
682
|
-
matchStatus: MatchStatus;
|
|
683
683
|
endDate?: Date | null | undefined;
|
|
684
684
|
additionalTag?: string | undefined;
|
|
685
685
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -710,6 +710,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
710
710
|
team2: number | null;
|
|
711
711
|
};
|
|
712
712
|
stage: string;
|
|
713
|
+
matchStatus: MatchStatus;
|
|
713
714
|
prediction: {
|
|
714
715
|
score: {
|
|
715
716
|
team1: number | null;
|
|
@@ -718,7 +719,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
718
719
|
succeeded: boolean | null;
|
|
719
720
|
} | null;
|
|
720
721
|
canPredict: boolean;
|
|
721
|
-
matchStatus: MatchStatus;
|
|
722
722
|
endDate?: Date | null | undefined;
|
|
723
723
|
additionalTag?: string | undefined;
|
|
724
724
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -755,6 +755,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
755
755
|
team2: number | null;
|
|
756
756
|
};
|
|
757
757
|
stage: string;
|
|
758
|
+
matchStatus: MatchStatus;
|
|
758
759
|
prediction: {
|
|
759
760
|
score: {
|
|
760
761
|
team1: number | null;
|
|
@@ -763,7 +764,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
763
764
|
succeeded: boolean | null;
|
|
764
765
|
} | null;
|
|
765
766
|
canPredict: boolean;
|
|
766
|
-
matchStatus: MatchStatus;
|
|
767
767
|
endDate?: Date | null | undefined;
|
|
768
768
|
additionalTag?: string | undefined;
|
|
769
769
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -799,6 +799,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
799
799
|
team2: number | null;
|
|
800
800
|
};
|
|
801
801
|
stage: string;
|
|
802
|
+
matchStatus: MatchStatus;
|
|
802
803
|
prediction: {
|
|
803
804
|
score: {
|
|
804
805
|
team1: number | null;
|
|
@@ -807,7 +808,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
807
808
|
succeeded: boolean | null;
|
|
808
809
|
} | null;
|
|
809
810
|
canPredict: boolean;
|
|
810
|
-
matchStatus: MatchStatus;
|
|
811
811
|
endDate?: Date | null | undefined;
|
|
812
812
|
additionalTag?: string | undefined;
|
|
813
813
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -836,6 +836,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
836
836
|
team2: number | null;
|
|
837
837
|
};
|
|
838
838
|
stage: string;
|
|
839
|
+
matchStatus: MatchStatus;
|
|
839
840
|
prediction: {
|
|
840
841
|
score: {
|
|
841
842
|
team1: number | null;
|
|
@@ -844,7 +845,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
844
845
|
succeeded: boolean | null;
|
|
845
846
|
} | null;
|
|
846
847
|
canPredict: boolean;
|
|
847
|
-
matchStatus: MatchStatus;
|
|
848
848
|
endDate?: Date | null | undefined;
|
|
849
849
|
additionalTag?: string | undefined;
|
|
850
850
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -877,6 +877,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
877
877
|
team2: number | null;
|
|
878
878
|
};
|
|
879
879
|
stage: string;
|
|
880
|
+
matchStatus: MatchStatus;
|
|
880
881
|
prediction: {
|
|
881
882
|
score: {
|
|
882
883
|
team1: number | null;
|
|
@@ -885,7 +886,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
885
886
|
succeeded: boolean | null;
|
|
886
887
|
} | null;
|
|
887
888
|
canPredict: boolean;
|
|
888
|
-
matchStatus: MatchStatus;
|
|
889
889
|
endDate?: Date | null | undefined;
|
|
890
890
|
additionalTag?: string | undefined;
|
|
891
891
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -915,6 +915,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
915
915
|
team2: number | null;
|
|
916
916
|
};
|
|
917
917
|
stage: string;
|
|
918
|
+
matchStatus: MatchStatus;
|
|
918
919
|
prediction: {
|
|
919
920
|
score: {
|
|
920
921
|
team1: number | null;
|
|
@@ -923,7 +924,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
923
924
|
succeeded: boolean | null;
|
|
924
925
|
} | null;
|
|
925
926
|
canPredict: boolean;
|
|
926
|
-
matchStatus: MatchStatus;
|
|
927
927
|
endDate?: Date | null | undefined;
|
|
928
928
|
additionalTag?: string | undefined;
|
|
929
929
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -963,6 +963,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
963
963
|
team2: number | null;
|
|
964
964
|
};
|
|
965
965
|
stage: string;
|
|
966
|
+
matchStatus: MatchStatus;
|
|
966
967
|
prediction: {
|
|
967
968
|
score: {
|
|
968
969
|
team1: number | null;
|
|
@@ -971,7 +972,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
971
972
|
succeeded: boolean | null;
|
|
972
973
|
} | null;
|
|
973
974
|
canPredict: boolean;
|
|
974
|
-
matchStatus: MatchStatus;
|
|
975
975
|
endDate?: Date | null | undefined;
|
|
976
976
|
additionalTag?: string | undefined;
|
|
977
977
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -1001,6 +1001,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
1001
1001
|
team2: number | null;
|
|
1002
1002
|
};
|
|
1003
1003
|
stage: string;
|
|
1004
|
+
matchStatus: MatchStatus;
|
|
1004
1005
|
prediction: {
|
|
1005
1006
|
score: {
|
|
1006
1007
|
team1: number | null;
|
|
@@ -1009,7 +1010,6 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
1009
1010
|
succeeded: boolean | null;
|
|
1010
1011
|
} | null;
|
|
1011
1012
|
canPredict: boolean;
|
|
1012
|
-
matchStatus: MatchStatus;
|
|
1013
1013
|
endDate?: Date | null | undefined;
|
|
1014
1014
|
additionalTag?: string | undefined;
|
|
1015
1015
|
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|