This commit is contained in:
wchino
2026-06-13 17:38:25 +08:00
parent e7e938f261
commit 7b33d9f9fa
190 changed files with 23222 additions and 4336 deletions

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { Decimal } from '@prisma/client/runtime/library';
import { PrismaService } from '../../shared/prisma/prisma.service';
import { appBadRequest, appConflict, appNotFound } from '../../shared/common/app-error';
import { MatchesService } from './matches.service';
import { MatchBetStatsService } from './match-bet-stats.service';
const TERMINAL_MATCH_STATUSES = new Set(['SETTLED', 'CANCELLED', 'VOID']);
@@ -39,7 +39,7 @@ export type LeagueArchivePreview = {
export class CatalogArchiveService {
constructor(
private prisma: PrismaService,
private matches: MatchesService,
private matchBetStats: MatchBetStatsService,
) {}
async getMatchArchivePreview(matchId: bigint): Promise<MatchArchivePreview> {
@@ -114,7 +114,7 @@ export class CatalogArchiveService {
});
const matchIds = matches.map((m) => m.id);
const stats = await this.matches.betStatsForMatches(matchIds);
const stats = await this.matchBetStats.betStatsForMatches(matchIds);
const previewBatches = matchIds.length
? await this.prisma.settlementBatch.findMany({
where: { matchId: { in: matchIds }, status: 'PREVIEW' },