first
Deploy Iddaai Frontend / build-and-deploy (push) Successful in 4m0s

This commit is contained in:
2026-04-16 13:36:34 +03:00
parent de5e145c4e
commit fc7a1ba567
218 changed files with 32370 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
import { apiRequest } from "@/lib/api/api-service";
import type { SportType } from "@/lib/api/matches/types";
import { ApiResponse } from "@/types/api-response";
import {
MatchPredictionDto,
UpcomingPredictionsDto,
ValueBetDto,
PredictionHistoryResponseDto,
AIHealthDto,
SmartCouponRequestDto,
SmartCouponResponseDto,
} from "./types";
/**
* Predictions Service
* Backend: /api/predictions/*
*/
const getPrediction = (matchId: string) => {
return apiRequest<ApiResponse<MatchPredictionDto>>({
url: `/predictions/${matchId}`,
client: "core",
method: "get",
});
};
const generatePrediction = (body: { matchId: string; sport?: SportType }) => {
return apiRequest<ApiResponse<MatchPredictionDto>>({
url: "/predictions/generate",
client: "core",
method: "post",
data: body,
});
};
const getUpcoming = () => {
return apiRequest<ApiResponse<UpcomingPredictionsDto>>({
url: "/predictions/upcoming",
client: "core",
method: "get",
});
};
const getValueBets = () => {
return apiRequest<ApiResponse<ValueBetDto[]>>({
url: "/predictions/value-bets",
client: "core",
method: "get",
});
};
const getHistory = () => {
return apiRequest<ApiResponse<PredictionHistoryResponseDto>>({
url: "/predictions/history",
client: "core",
method: "get",
});
};
const checkHealth = () => {
return apiRequest<ApiResponse<AIHealthDto>>({
url: "/predictions/health",
client: "core",
method: "get",
});
};
const generateSmartCoupon = (body: SmartCouponRequestDto) => {
return apiRequest<ApiResponse<SmartCouponResponseDto>>({
url: "/predictions/smart-coupon",
client: "core",
method: "post",
data: body,
});
};
export const predictionsService = {
getPrediction,
generatePrediction,
getUpcoming,
getValueBets,
getHistory,
checkHealth,
generateSmartCoupon,
};