package com.jasamedika.medifirst2000.service.impl;

import com.jasamedika.medifirst2000.dao.RekapLogbookDokterDao;
import com.jasamedika.medifirst2000.entities.RekapLogbookDokter;
import com.jasamedika.medifirst2000.service.RekapLogbookDokterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * @author Salman
 * @version 1.0.0
 * @since 01/01/2024
 */
@Service
@Transactional
public class RekapLogbookDokterServiceImpl implements RekapLogbookDokterService {

	@Autowired
	private RekapLogbookDokterDao rekapLogbookDokterDao;

	@Override
	public void deleteByPeriod(Date tglAwal, Date tglAkhir) {
		List<RekapLogbookDokter> listRekap = rekapLogbookDokterDao.findByBulanBetween(tglAwal, tglAkhir);
		rekapLogbookDokterDao.delete(listRekap);
	}
}
