// TODO 미사용시작
package com.kamco.cd.training.dataset.service;

import com.kamco.cd.training.dataset.dto.MapSheetDto;
import com.kamco.cd.training.postgres.core.MapSheetCoreService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class MapSheetService {

  private final MapSheetCoreService mapSheetCoreService;

  /**
   * 도엽 목록 조회
   *
   * @param searchReq 검색 조건
   * @return 도엽 목록
   */
  public Page<MapSheetDto.Basic> searchMapSheets(MapSheetDto.SearchReq searchReq) {
    log.info("도엽 목록 조회 - 조건: {}", searchReq);
    return mapSheetCoreService.findMapSheetList(searchReq);
  }

  /**
   * 도엽 삭제 (다건)
   *
   * @param deleteReq 삭제 요청
   */
  @Transactional
  public void deleteMapSheets(MapSheetDto.DeleteReq deleteReq) {
    log.info("도엽 삭제 - 요청: {}", deleteReq);
    mapSheetCoreService.deleteMapSheets(deleteReq);
    log.info("도엽 삭제 완료 - 개수: {}", deleteReq.getItemIds().size());
  }
}
// TODO 미사용 끝
