package com.style24.batch.biz.task;

import com.style24.batch.biz.job.migration.TsbCancelQtyOrderDetailJob;
import com.style24.batch.biz.job.migration.TsbRefundAccountJob;
import com.style24.batch.biz.job.migration.TsbReturnQtyOrderDetailJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 주문마이그레이션 Task
 * @author jsshin
 * @since 2021. 03. 08
 */
@Component
@Slf4j
public class TsbMigrationOrderTask {

	@Autowired
	TsbCancelQtyOrderDetailJob cancelQtyOrderDetailJob;

	@Autowired
	TsbReturnQtyOrderDetailJob returnQtyOrderDetailJob;

	@Autowired
	TsbRefundAccountJob refundAccountJob;

	//@Scheduled(fixedDelay=999999999)
	@Async
	public void cancelQtyOrderDetailJob() throws Exception {
		cancelQtyOrderDetailJob.run("cancelQtyOrderDetailJob");
	}

	//@Scheduled(fixedDelay=999999999)
	@Async
	public void returnQtyOrderDetailJob() throws Exception {
		returnQtyOrderDetailJob.run("returnQtyOrderDetailJob");
	}

	//@Scheduled(fixedDelay=999999999)
	@Async
	public void refundAccountJob() throws Exception {
		refundAccountJob.run("refundAccountJob");
	}

}
