gg
Deploy Iddaai Backend / build-and-deploy (push) Successful in 32s

This commit is contained in:
2026-05-12 17:41:49 +03:00
parent 2b8dce665f
commit 2507678bc0
9 changed files with 19 additions and 35 deletions
@@ -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}`);