This commit is contained in:
2026-04-16 17:21:48 +03:00
parent c8fa4c442d
commit c8e7e4e927
116 changed files with 3720 additions and 4197 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
import { Injectable, Logger } from '@nestjs/common';
import { PrismaService } from '../../database/prisma.service';
import { Injectable, Logger } from "@nestjs/common";
import { PrismaService } from "../../database/prisma.service";
import {
MatchAnalysisService,
AnalysisResult,
} from '../../services/match-analysis.service';
} from "../../services/match-analysis.service";
@Injectable()
export class AnalysisService {
@@ -50,9 +50,9 @@ export class AnalysisService {
}
// Build URL for analysis
const sport = (targetMatch as any).sport || 'football';
const sport = (targetMatch as any).sport || "football";
const slug = (targetMatch as any).matchSlug || matchId;
const url = `https://www.mackolik.com/${sport === 'basketball' ? 'basketbol/mac' : 'mac'}/${slug}/${matchId}`;
const url = `https://www.mackolik.com/${sport === "basketball" ? "basketbol/mac" : "mac"}/${slug}/${matchId}`;
// Run analysis
const result = await this.matchAnalysisService.analyzeMatch(
@@ -110,7 +110,7 @@ export class AnalysisService {
// Check limits (default: 10 analyses, 3 coupons per day)
const user = await this.prisma.user.findUnique({ where: { id: userId } });
const isPremium = user?.subscriptionStatus === 'active';
const isPremium = user?.subscriptionStatus === "active";
const maxAnalyses = isPremium ? 50 : 10;
const maxCoupons = isPremium ? 10 : 3;
@@ -145,7 +145,7 @@ export class AnalysisService {
async getAnalysisHistory(userId: string, limit: number = 20) {
return this.prisma.analysis.findMany({
where: { userId },
orderBy: { createdAt: 'desc' },
orderBy: { createdAt: "desc" },
take: limit,
});
}