gg
This commit is contained in:
@@ -10,6 +10,8 @@ import {
|
||||
MatchAnalysisResultDto,
|
||||
DailyBankoResponseDto,
|
||||
SmartCouponResultDto,
|
||||
FrequencyCouponRequestDto,
|
||||
FrequencyCouponResultDto,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
@@ -70,6 +72,15 @@ const suggestCoupon = (dto: SuggestCouponDto) => {
|
||||
});
|
||||
};
|
||||
|
||||
const generateFrequencyCoupon = (dto: FrequencyCouponRequestDto) => {
|
||||
return apiRequest<ApiResponse<FrequencyCouponResultDto>>({
|
||||
url: "/coupon/frequency-coupon",
|
||||
client: "core",
|
||||
method: "post",
|
||||
data: dto,
|
||||
});
|
||||
};
|
||||
|
||||
export const couponsService = {
|
||||
analyzeMatch,
|
||||
createCoupon,
|
||||
@@ -77,4 +88,6 @@ export const couponsService = {
|
||||
getHistory,
|
||||
getUserStats,
|
||||
suggestCoupon,
|
||||
generateFrequencyCoupon,
|
||||
};
|
||||
|
||||
|
||||
@@ -106,3 +106,50 @@ export interface SmartCouponResultDto {
|
||||
expected_win_rate: number;
|
||||
rejected_matches: SuggestedCouponRejectedMatchDto[];
|
||||
}
|
||||
|
||||
// ========================
|
||||
// Frequency Engine DTOs
|
||||
// ========================
|
||||
|
||||
export interface FrequencyCouponRequestDto {
|
||||
matchIds?: string[];
|
||||
maxMatches?: number;
|
||||
minSignal?: number;
|
||||
markets?: string[];
|
||||
}
|
||||
|
||||
export interface FrequencyCouponBetDto {
|
||||
match_id: string;
|
||||
match_name: string;
|
||||
league: string;
|
||||
market: string;
|
||||
pick: string;
|
||||
home_signal: number;
|
||||
away_signal: number;
|
||||
combined_signal: number;
|
||||
league_profile: string;
|
||||
historical_hit_rate: number;
|
||||
odds: number;
|
||||
home_odds_band: string;
|
||||
away_odds_band: string;
|
||||
home_match_count: number;
|
||||
away_match_count: number;
|
||||
}
|
||||
|
||||
export interface FrequencyCouponRejectedDto {
|
||||
match_id: string;
|
||||
match_name: string;
|
||||
reason: string;
|
||||
}
|
||||
|
||||
export interface FrequencyCouponResultDto {
|
||||
strategy: "FREQUENCY";
|
||||
generated_at: string;
|
||||
bets: FrequencyCouponBetDto[];
|
||||
total_odds: number;
|
||||
expected_hit_rate: number;
|
||||
expected_value: number;
|
||||
ev_positive: boolean;
|
||||
reasoning: string[];
|
||||
rejected_matches: FrequencyCouponRejectedDto[];
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
CreateCouponDto,
|
||||
SuggestCouponDto,
|
||||
AnalyzeMatchDto,
|
||||
FrequencyCouponRequestDto,
|
||||
} from "./types";
|
||||
|
||||
export const CouponsQueryKeys = {
|
||||
@@ -55,3 +56,11 @@ export const useSuggestCoupon = () => {
|
||||
mutationFn: (dto: SuggestCouponDto) => couponsService.suggestCoupon(dto),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGenerateFrequencyCoupon = () => {
|
||||
return useMutation({
|
||||
mutationFn: (dto: FrequencyCouponRequestDto) =>
|
||||
couponsService.generateFrequencyCoupon(dto),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user