package cokr.xit.ens.modules.kkoalimtalk.service;

import cokr.xit.ens.modules.kkoalimtalk.domain.repository.SendDetailKkoAlimtalkReqHistRepository;
import cokr.xit.ens.modules.kkoalimtalk.domain.repository.SendDetailKkoAlimtalkRsltHistRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class KkoAlimtalkHisService {
    private final SendDetailKkoAlimtalkReqHistRepository sendDetailKkoAlimtalkReqHistRepository;
    private final SendDetailKkoAlimtalkRsltHistRepository sendDetailKkoAlimtalkRsltHistRepository;


    /**
     * 전송요청이력 영구 삭제
     *
     * @return
     */
    public Long truncateReqHist() {
        Long totCnt = sendDetailKkoAlimtalkReqHistRepository.count();
        sendDetailKkoAlimtalkReqHistRepository.truncate();

        return totCnt;
    }

    /**
     * 전송결과요청이력 영구 삭제
     *
     * @return
     */
    public Long truncateRsltHist() {
        Long totCnt = sendDetailKkoAlimtalkRsltHistRepository.count();
        sendDetailKkoAlimtalkRsltHistRepository.truncate();

        return totCnt;
    }


}
