package cokr.xit.ens.biz.iup.billpay.service;

import cokr.xit.ens.biz.iup.billpay.service.impl.IupKkoPayUseSysServiceImpl;
import cokr.xit.ens.biz.iup.billpay.service.impl.IupNvPayUseSysServiceImpl;
import cokr.xit.ens.core.exception.EnsException;
import cokr.xit.ens.core.exception.code.EnsErrCd;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class IupPayUseSysServiceFactory {
    private final IupKkoPayUseSysServiceImpl iupKkoPayUseSysService;
    private final IupNvPayUseSysServiceImpl iupNvPayUseSysService;

    public enum IupPaySe {
        kkopay,
        nvpay
    }

    public IupPayUseSysService getService(IupPaySe iupPaySe) {
        switch (iupPaySe) {
            case kkopay:
                return iupKkoPayUseSysService;
            case nvpay:
                return iupNvPayUseSysService;
            default:
                throw new EnsException(EnsErrCd.INVALID_REQUEST_URL, EnsErrCd.INVALID_REQUEST_URL.getCodeNm());
        }
    }

}
