package com.kamco.cd.training.postgres.core;

import com.kamco.cd.training.postgres.repository.train.ModelTestMetricsJobRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@RequiredArgsConstructor
public class ModelTestMetricsJobCoreService {

  private final ModelTestMetricsJobRepository modelTestMetricsJobRepository;

  @Transactional
  public void updateModelMetricsTrainSaveYn(Long modelId, String stepNo) {
    modelTestMetricsJobRepository.updateModelMetricsTrainSaveYn(modelId, stepNo);
  }

  // Test 로직 시작
  public List<Long> getTestMetricSaveNotYetModelIds() {
    return modelTestMetricsJobRepository.getTestMetricSaveNotYetModelIds();
  }

  public void insertModelMetricsTest(List<Object[]> batchArgs) {
    modelTestMetricsJobRepository.insertModelMetricsTest(batchArgs);
  }
}
