package com.style24.batch.biz.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.style24.batch.biz.dao.TsbCartDao;
import com.style24.persistence.domain.Order;

import lombok.extern.slf4j.Slf4j;

/**
 * 쇼핑백 Service
 *
 * @author xodud1202
 * @since 2021. 05. 03
 */
@Service
@Slf4j
public class TsbCartService {

	@Autowired
	private TsbCartDao cartDao;

	/**
	 * 장바구니 만료 데이터 삭제
	 *
	 * @param param
	 * @author xodud1202
	 * @since  2021. 05. 03
	 */
	@Transactional("shopTxnManager")
	public int deleteCartExpriration(Order param) {
		return cartDao.deleteCartExpriration(param);
	}

	/**
	 * 장바구니 마스터 정보 없는 상세데이터 삭제
	 *
	 * @param order
	 * @author xodud1202
	 * @since  2021. 05. 03
	 */
	@Transactional("shopTxnManager")
	public void deleteCartDetail(Order param) {
		cartDao.deleteCartDetail(param);
	}
}
