package com.kamco.cd.training.postgres.repository.train;

import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ModelMetricJsonDto;
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ModelTestFileName;
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.SimpleMetricJsonDto;
import java.time.ZonedDateTime;
import java.util.List;

public interface ModelTestMetricsJobRepositoryCustom {

  void updateModelMetricsTrainSaveYn(Long modelId, String stepNo);

  List<ResponsePathDto> getTestMetricSaveNotYetModelIds();

  ResponsePathDto getTestMetricSaveNotYetModelId(Long modelId);

  void insertModelMetricsTest(List<Object[]> batchArgs);

  ModelMetricJsonDto getTestMetricPackingInfo(Long modelId);

  /**
   * 간단한 형식의 테스트 메트릭 정보 조회 (ZIP 파일용)
   *
   * @param modelId 모델 ID
   * @return 간단한 JSON 형식 DTO
   */
  SimpleMetricJsonDto getSimpleTestMetricPackingInfo(Long modelId);

  ModelTestFileName findModelTestFileNames(Long modelId);

  void updatePackingStart(Long modelId, ZonedDateTime now);

  void updatePackingEnd(Long modelId, ZonedDateTime now, String failSuccState);

  /**
   * 특정 Epoch의 메트릭 정보 조회 (하이퍼파라미터별 ZIP 생성용)
   *
   * @param modelId 모델 ID
   * @param epoch Epoch 번호
   * @param metricType 메트릭 타입 (fscore, precision, recall)
   * @return 메트릭 JSON DTO
   */
  ModelMetricJsonDto getMetricsByEpoch(Long modelId, Integer epoch, String metricType);
}
