@@ -82,14 +82,14 @@ interface UpcomingMatchRow {
|
||||
|
||||
const MIN_MATCHES = 3;
|
||||
|
||||
const GOLCU_LEAGUES = new Set([
|
||||
// Strategy generator'dan türetilen yüksek golcü ligler
|
||||
// Lig isimleri veritabanındaki gibi
|
||||
]);
|
||||
// const GOLCU_LEAGUES = new Set([
|
||||
// // Strategy generator'dan türetilen yüksek golcü ligler
|
||||
// // Lig isimleri veritabanındaki gibi
|
||||
// ]);
|
||||
|
||||
const DEFANSIF_LEAGUES = new Set([
|
||||
// Düşük golcü ligler
|
||||
]);
|
||||
// const DEFANSIF_LEAGUES = new Set([
|
||||
// // Düşük golcü ligler
|
||||
// ]);
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
// Service
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
import {
|
||||
FrequencyEngineService,
|
||||
type MatchCandidate,
|
||||
type FrequencySignal,
|
||||
} from "./frequency-engine.service";
|
||||
|
||||
export type PredictionRiskLevel = "LOW" | "MEDIUM" | "HIGH" | "EXTREME";
|
||||
|
||||
@@ -123,7 +123,7 @@ export class PredictionsController {
|
||||
|
||||
const cached = await this.predictionsService.getCachedPrediction(matchId);
|
||||
if (cached) {
|
||||
await this.analysisService.recordUsage(user.id, false);
|
||||
// Do not record usage for cached predictions
|
||||
return cached;
|
||||
}
|
||||
|
||||
|
||||
@@ -1295,8 +1295,8 @@ export class PredictionsService implements OnModuleInit, OnModuleDestroy {
|
||||
): Promise<MatchPredictionDto | null> {
|
||||
const memCached = this.predictionMemCache.get(matchId);
|
||||
if (memCached) {
|
||||
if (Date.now() - memCached.timestamp < 10 * 60 * 1000) {
|
||||
// 10 mins TTL
|
||||
if (Date.now() - memCached.timestamp < 5 * 60 * 1000) {
|
||||
// 5 mins TTL
|
||||
return memCached.payload;
|
||||
} else {
|
||||
this.predictionMemCache.delete(matchId);
|
||||
@@ -1312,7 +1312,7 @@ export class PredictionsService implements OnModuleInit, OnModuleDestroy {
|
||||
}
|
||||
|
||||
const cacheAge = Date.now() - prediction.updatedAt.getTime();
|
||||
if (cacheAge > 6 * 60 * 60 * 1000) {
|
||||
if (cacheAge > 1 * 60 * 60 * 1000) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export class ImageRendererService implements OnModuleInit {
|
||||
this.drawMatchBlock(ctx, data, theme, homeImg, awayImg);
|
||||
this.drawScoreBlock(ctx, data, theme);
|
||||
this.drawPicks(ctx, data.topPicks, theme);
|
||||
this.drawFooter(ctx, data, theme);
|
||||
this.drawFooter(ctx, data);
|
||||
|
||||
const buffer = canvas.toBuffer("image/jpeg", { quality: 0.94 });
|
||||
fs.writeFileSync(outPath, buffer);
|
||||
@@ -460,7 +460,7 @@ export class ImageRendererService implements OnModuleInit {
|
||||
});
|
||||
}
|
||||
|
||||
private drawFooter(ctx: any, data: PredictionCardDto, theme: Theme) {
|
||||
private drawFooter(ctx: any, data: PredictionCardDto) {
|
||||
const riskText = `Risk: ${this.translateRisk(data.riskLevel)}`;
|
||||
ctx.font = "900 34px Arial";
|
||||
const riskW = Math.ceil(ctx.measureText(riskText).width + 72);
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import {
|
||||
IsString,
|
||||
IsOptional,
|
||||
IsEnum,
|
||||
IsDateString,
|
||||
IsInt,
|
||||
} from "class-validator";
|
||||
import { IsString, IsOptional, IsEnum } from "class-validator";
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { Exclude, Expose, Type } from "class-transformer";
|
||||
import { Exclude, Expose } from "class-transformer";
|
||||
|
||||
export enum PlanType {
|
||||
FREE = "free",
|
||||
|
||||
@@ -9,15 +9,6 @@ export interface PaddleWebhookEvent {
|
||||
notification_id: string;
|
||||
data: Record<string, unknown>;
|
||||
}
|
||||
|
||||
interface PaddleTransactionResponse {
|
||||
data: {
|
||||
id: string;
|
||||
customer_id: string;
|
||||
status: string;
|
||||
};
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class PaddleService {
|
||||
private readonly logger = new Logger(PaddleService.name);
|
||||
|
||||
@@ -108,10 +108,10 @@ export class SubscriptionsService {
|
||||
await this.handleSubscriptionResumed(data);
|
||||
break;
|
||||
case "transaction.completed":
|
||||
this.logger.log(`Transaction completed: ${data.id}`);
|
||||
this.logger.log(`Transaction completed: ${String(data.id)}`);
|
||||
break;
|
||||
case "transaction.payment_failed":
|
||||
this.logger.warn(`Payment failed for transaction: ${data.id}`);
|
||||
this.logger.warn(`Payment failed for transaction: ${String(data.id)}`);
|
||||
break;
|
||||
default:
|
||||
this.logger.debug(`Unhandled Paddle event: ${eventType}`);
|
||||
|
||||
@@ -466,8 +466,8 @@ export class DataFetcherTask {
|
||||
): { outcome: string; unitProfit: number } | null {
|
||||
const summary = this.asRecord(row.payloadSummary);
|
||||
const mainPick = this.asRecord(summary.main_pick);
|
||||
const market = String(mainPick.market || "");
|
||||
const pick = String(mainPick.pick || "");
|
||||
const market = typeof mainPick.market === "string" ? mainPick.market : "";
|
||||
const pick = typeof mainPick.pick === "string" ? mainPick.pick : "";
|
||||
const playable = mainPick.playable === true;
|
||||
const odds = Number(mainPick.odds || 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user