package com.kamco.cd.kamcoback.postgres.repository.label;

import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail;
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.UserList;
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
import java.time.LocalDate;
import java.util.List;
import java.util.UUID;

public interface LabelAllocateRepositoryCustom {

  List<AllocateInfoDto> fetchNextIds(
      Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage);

  void assignOwner(
      List<AllocateInfoDto> ids,
      String userId,
      Integer compareYyyy,
      Integer targetYyyy,
      Integer stage);

  List<LabelingAssignmentEntity> findAssignedLabelerList(
      Integer compareYyyy, Integer targetYyyy, Integer stage);

  Long findLabelUnAssignedCnt(Integer stage, Integer compareYyyy, Integer targetYyyy);

  void assignInspector(UUID assignmentUid, String userId);

  List<UserList> availUserList(String role);

  // 작업자 통계 조회
  List<WorkerStatistics> findWorkerStatistics(
      Long analUid, String workerType, String searchName, String searchEmployeeNo, String sortType);

  // 작업 진행 현황 조회
  WorkProgressInfo findWorkProgressInfo(Long analUid);

  // 작업자별 일일 처리량 조회
  Long findDailyProcessedCount(String workerId, String workerType, LocalDate date, Long analUid);

  void assignInspectorBulk(List<UUID> assignmentUids, String inspectorUid);

  InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage);

  public List<Long> fetchNextMoveIds(
      Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage);

  Long findLabelUnCompleteCnt(Long analUid);

  void assignOwnerMove(List<Long> sub, String userId);

  LabelerDetail findLabelerDetail(
      String userId, Integer compareYyyy, Integer targetYyyy, Integer stage);
}
