package com.style24.batch.biz.service;

import java.util.Collection;

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

import com.style24.batch.biz.dao.TsbShoplinkerDao;
import com.style24.persistence.domain.ShoplinkerGoods;
import com.style24.persistence.domain.ShoplinkerSearch;

import lombok.extern.slf4j.Slf4j;

/**
 * 샵링커 Service
 *
 * @author jmh
 * @since 2021. 06. 22
 */
@Service
@Slf4j
public class TsbShoplinkerService {

	@Autowired
	private TsbShoplinkerDao shoplinkerDao;


	/**
	 * 샵링커 전송 이력
	 *
	 * @param ShoplinkerGoods
	 * @return
	 * @author jmh
	 * @since 2021. 6. 22
	 */
	public void	insertShoplinerApiHst(ShoplinkerGoods shoplinkerGoods) {
		shoplinkerDao.insertShoplinerApiHst(shoplinkerGoods);
	}

	/**
	 * 재고수정
	 *
	 * @return
	 * @author jmh
	 * @since  2021. 06. 22
	 */
	public void updateStockInfo(ShoplinkerGoods shoplinkerGoods) {
		shoplinkerDao.updateStockInfo(shoplinkerGoods);
	}

	/**
	 * 재고 전체 동기화
	 *
	 * @return
	 * @author jmh
	 * @since  2021. 06. 22
	 */
	public void updateSyncStock() {
		shoplinkerDao.updateSyncStock();
	}

	/**
	 * 재고 변경 목록
	 *
	 * @return
	 * @author jmh
	 * @since  2021. 06. 22
	 */
	public Collection<ShoplinkerGoods> getSyncStockList() {
		return shoplinkerDao.getSyncStockList();
	}

	/**
	 * 주문수집 배치 - 마지막 배치실행시간
	 *
	 * @return
	 * @author jmh
	 * @since  2021. 06. 22
	 */
	public ShoplinkerSearch getShoplinkerOrderLastBatchInfo() {
		return shoplinkerDao.getShoplinkerOrderLastBatchInfo();
	}

	/**
	 * 주문수집 배치 - 주문수집 날짜 정보
	 *
	 * @return
	 * @author jmh
	 * @since  2021. 06. 22
	 */
	public ShoplinkerSearch getOrdDateInfo() {
		return shoplinkerDao.getOrdDateInfo();
	}

	// 주문수집 배치 - 주문수집 날짜 정보 (테스트기간 30일전 날짜)
	public ShoplinkerSearch getOrdDateInfoTest30() {
		return shoplinkerDao.getOrdDateInfoTest30();
	}

}
