package com.style24.batch.biz.service;

import com.style24.batch.biz.dao.TsbMigrationDao;
import com.style24.persistence.domain.Migration;
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 swkim
 * @since 2021. 05. 17
 */
@Service
@Slf4j
public class TsbMigrationService {

	@Autowired
	private TsbMigrationDao migrationDao;

	//@Transactional("shopTxnManager")
	public int getCustomerCnt(Migration migration) {
		return migrationDao.getCustomerCnt(migration);
	}

	public Collection<Migration> getCustomerList(Migration migration) {

		return migrationDao.getCustomerList(migration);
	}

	@Transactional("shopTxnManager")
	public void updateCustomerEncrypt(Migration migration) {
		migrationDao.updateCustomerEncrypt(migration);
	}

	public int getCustomerAllCnt(Migration migration) {
		return migrationDao.getCustomerAllCnt(migration);
	}

	public Collection<Migration> getCustomerListAll(Migration migration) {
		return migrationDao.getCustomerListAll(migration);
	}

	public Collection<Migration> getCancelOrderDtlList() {
		return migrationDao.getCancelOrderDtlList();
	}

	@Transactional("shopTxnManager")
	public void updateOrderDetail(Migration migration) {
		migrationDao.updateOrderDetail(migration);
		migrationDao.updateOrderChangeDetail(migration);
	}

	public Migration getCancelOrderDtl(int ordDtlNo) {
		return migrationDao.getCancelOrderDtl(ordDtlNo);
	}

	public int getCustAccountCnt() {
		return migrationDao.getCustAccountCnt();
	}

	public Collection<Migration> getCustAccountList(Migration migration) {
		return migrationDao.getCustAccountList(migration);
	}

	@Transactional("shopTxnManager")
	public void updateCustAccountEnc(Migration migration) {
		migrationDao.updateCustAccountEnc(migration);
	}

	public int getRefundAccountCnt() {
		return migrationDao.getRefundAccountCnt();
	}

	public Collection<Migration> getRefundAccountList(Migration migration) {
		return migrationDao.getRefundAccountList(migration);
	}

	@Transactional("shopTxnManager")
	public void updateRefundAccountEnc(Migration migration) {
		migrationDao.updateRefundAccountEnc(migration);
	}
}
