package com.style24.batch.biz.service;

import com.style24.batch.biz.dao.TsbGiftcardDao;
import com.style24.persistence.domain.GiftCard;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;

/**
 * 상품권 Service
 *
 * @author sowon
 * @since 2021. 05. 20
 */
@Service
@Slf4j
public class TsbGiftcardService {

	@Autowired
	private TsbGiftcardDao giftcardDao;

	
	/**
	 * 상품권 소멸 리스트
	 *
	 * @param giftcard
	 * @return Collection<Giftcard>
	 * @author sowon
	 * @since  2021. 05. 20
	 */
	@Transactional("shopTxnManager")
	public Collection<GiftCard> getExpireGiftcardList(GiftCard giftcard){
		return giftcardDao.getExpireGiftcardList(giftcard);
	}

	/**
	 * 상품권 hst insert
	 *
	 * @param point
	 * @return 
	 * @author sowon
	 * @since  2021. 05. 20
	 */
	@Transactional("shopTxnManager")
	public void saveExpireGiftcardHst(GiftCard giftcard) {
		giftcardDao.saveExpireGiftcardHst(giftcard);
	}
	
	/**
	 * 상품권 기간만료 알림톡(30일) 리스트
	 *
	 * @param giftcard
	 * @return Collection<Giftcard>
	 * @author sowon
	 * @since  2021. 05. 27
	 */
	@Transactional("shopTxnManager")
	public Collection<GiftCard> getSendGiftcardExpectList(GiftCard giftcard){
		return giftcardDao.getSendGiftcardExpectList(giftcard);
	}
}
