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

import org.springframework.stereotype.*;

import cokr.xit.ens.biz.iup.billpay.service.impl.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import lombok.*;

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

    // FIXME: 결재구분 - jsp에서 호출시 PathVariable로 set(payse)[카카오 - kkopay, 네이버 - nvpay]
    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());
        }
    }

}
