import apiClient from '../api-client';
import { ReproMpt } from '@/types/reprompt.types';

/**
 * 번식정보(Reproduction) 관련 API - MPT(혈액검사) 전용
 */

export const reproApi = {
  /**
   * GET /repro/mpt - 전체 혈액검사(MPT) 정보 조회
   */
  findAllMpt: async (): Promise<ReproMpt[]> => {
    return await apiClient.get('/repro/mpt');
  },

  /**
   * GET /repro/mpt/:cowNo - 특정 개체의 혈액검사 정보 조회
   *
   * @param cowNo - 개체 번호
   */
  findMptByCowNo: async (cowNo: string | number): Promise<ReproMpt[]> => {
    return await apiClient.get(`/repro/mpt/${cowNo}`);
  },

  /**
   * GET /repro/mpt-average/category - 전체 농가 MPT 평균 (카테고리별)
   */
  getMptAverageByCategory: async (): Promise<Array<{ category: string; score: number }>> => {
    return await apiClient.get('/repro/mpt-average/category');
  },
};
