.
This commit is contained in:
1 parent
7a43a667f1
commit
c00545f281
21 files changed
+1920
-5
No files matched your search
@@ -15,6 +15,7 @@ import {
|
||||
TeamSide,
|
||||
} from '../global/database/schema';
|
||||
import { RiotAccountEnrichmentService } from '../riot/riot-account-enrichment.service';
|
||||
import { TournamentCodeService } from '../tournament-code/tournament-code.service';
|
||||
|
||||
const AUCTION_MAX_TEAM_SIZE = 5;
|
||||
|
||||
@@ -43,6 +44,7 @@ export class AuctionService {
|
||||
constructor(
|
||||
private readonly connectionService: ConnectionService,
|
||||
private readonly enrichmentService: RiotAccountEnrichmentService,
|
||||
private readonly tournamentCodeService: TournamentCodeService,
|
||||
) {}
|
||||
|
||||
public async start(params: StartAuctionParams): Promise<AuctionDocument> {
|
||||
@@ -173,7 +175,9 @@ export class AuctionService {
|
||||
});
|
||||
|
||||
match.status = 'team-built';
|
||||
match.teamBuiltAt = match.teamBuiltAt ?? new Date();
|
||||
await match.save();
|
||||
await this.tournamentCodeService.reserveForMatch(match);
|
||||
|
||||
return auction;
|
||||
}
|
||||
@@ -312,8 +316,11 @@ export class AuctionService {
|
||||
|
||||
await auction.deleteOne({ session });
|
||||
if (match.status === 'team-built') {
|
||||
await this.tournamentCodeService.releaseFromMatch(match);
|
||||
match.status = 'recruiting';
|
||||
match.teams = [];
|
||||
match.tournamentCodeIds = [];
|
||||
match.teamBuiltAt = undefined;
|
||||
await match.save({ session });
|
||||
}
|
||||
await session.commitTransaction();
|
||||
@@ -393,7 +400,9 @@ export class AuctionService {
|
||||
};
|
||||
});
|
||||
match.status = 'team-built';
|
||||
match.teamBuiltAt = match.teamBuiltAt ?? new Date();
|
||||
await match.save();
|
||||
await this.tournamentCodeService.reserveForMatch(match);
|
||||
}
|
||||
|
||||
private resolveTeamName(side: TeamSide): string {
|
||||
|
||||
Reference in new issue
Block a user