package com.style24.batch.biz.job.customer;

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

import com.style24.batch.biz.job.TsbAbstractJob;
import com.style24.batch.biz.service.TsbCustomerService;

import lombok.extern.slf4j.Slf4j;

/**
 * 넷퍼시메일 솔루션에 회원정보 연동 처리
 *
 * @author gagamel
 * @since 2021. 5. 10
 */
@Component
@Slf4j
public class TsbNetpathyMailJob extends TsbAbstractJob<String, String, String> {

	@Autowired
	private TsbCustomerService customerService;

	@Override
	public String read() throws Exception {
		return "OK";
	}

	@Override
	public String process(String result) throws Exception {
		// 넷퍼시메일 회원정보 생성
		customerService.createNetpathyMailCustomer();

		// 넷퍼시메일 탈퇴/휴면회원정보 생성
		customerService.createNetpathyMailWithdrawalCustomer();

		// 넷퍼시메일 회원포인트 정보 생성
		customerService.createNetpathyMailCustomerPoint();

		return result;
	}

	@Override
	public String write(String result) throws Exception {
		return result;
	}

	@Override
	public void notify(String result) throws Exception {
		// Do nothing
	}

}
