import apiClient from "../api-client";
import { RankingRequest } from "@/types/ranking.types";
import { CowDetailResponseDto } from "@/types/cow.types";

/**
 * 개체(Cow) 관련 API
 */
export const cowApi = {
  /**
   * GET /cow/:cowNo - 개체 상세 조회
   */
  findOne: async (cowNo: string): Promise<CowDetailResponseDto> => {
    return await apiClient.get(`/cow/${cowNo}`);
  },

  /**
   * POST /cow/ranking - 암소 랭킹 조회 (필터 + 랭킹 통합)
   */
  getRanking: async (rankingRequest: RankingRequest): Promise<any> => {
    return await apiClient.post("/cow/ranking", rankingRequest);
  },
};
