This commit is contained in:
2026-04-22 02:17:02 +03:00
parent 2ccd6831eb
commit df428ed1e8
19 changed files with 6436 additions and 9 deletions
+37 -1
View File
@@ -27,6 +27,7 @@ import {
AnalyzeMatchDto,
DailyBankoDto,
SuggestCouponDto,
FrequencyCouponDto,
} from "./dto/coupons-request.dto";
import { Public } from "../../common/decorators";
import { JwtAuthGuard } from "../auth/guards/auth.guards"; // Assuming standard guard
@@ -188,8 +189,43 @@ export class CouponsController {
return { success: true, data: coupon };
}
/**
* POST /coupon/frequency-coupon
* Generate a frequency-based parlay coupon (Conditional Frequency Engine)
*/
@Post("frequency-coupon")
@Public()
@HttpCode(HttpStatus.OK)
@ApiOperation({
summary: "Generate frequency-based parlay coupon",
description:
"Scans upcoming matches, applies conditional frequency analysis " +
"(team odds-band performance), and builds 2-5 match combos with +EV calculation.",
})
@ApiResponse({ status: 200, description: "Frequency coupon generated" })
async getFrequencyCoupon(@Body() dto: FrequencyCouponDto) {
const coupon = await this.smartCouponService.generateFrequencyBasedCoupon({
matchIds: dto.matchIds,
maxMatches: dto.maxMatches,
minSignal: dto.minSignal,
markets: dto.markets,
});
if (!coupon || coupon.bets.length === 0) {
return {
success: false,
message:
"Frekans analizine uygun yeterli maç bulunamadı. " +
"minSignal değerini düşürmeyi veya daha fazla maç beklemeyi deneyin.",
data: coupon,
};
}
return { success: true, data: coupon };
}
// ============================================
// USER COUPON ENDPOINTS (NEW)
// USER COUPON ENDPOINTS
// ============================================
/**