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>({ url: `/predictions/${matchId}?nocache=true`, client: "core", method: "get", }); }; const generatePrediction = (body: { matchId: string; sport?: SportType }) => { return apiRequest>({ url: "/predictions/generate", client: "core", method: "post", data: body, }); }; const getUpcoming = () => { return apiRequest>({ url: "/predictions/upcoming", client: "core", method: "get", }); }; const getValueBets = () => { return apiRequest>({ url: "/predictions/value-bets", client: "core", method: "get", }); }; const getHistory = () => { return apiRequest>({ url: "/predictions/history", client: "core", method: "get", }); }; const checkHealth = () => { return apiRequest>({ url: "/predictions/health", client: "core", method: "get", }); }; const getCommentary = (matchId: string) => { return apiRequest>({ url: `/predictions/${matchId}/commentary`, client: "core", method: "get", }); }; const generateSmartCoupon = (body: SmartCouponRequestDto) => { return apiRequest>({ url: "/predictions/smart-coupon", client: "core", method: "post", data: body, }); }; export const predictionsService = { getPrediction, generatePrediction, getUpcoming, getValueBets, getHistory, checkHealth, generateSmartCoupon, getCommentary, };