package cokr.xit.ens.modules.common.ctgy.intgrnbill.support.service.repair;

import cokr.xit.ens.core.exception.EnsException;
import cokr.xit.ens.core.exception.code.EnsErrCd;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.service.repair.RepairPayResultService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RequiredArgsConstructor
public class PayRepairServiceFactory {
    private final Map<String, RepairPayResultService> repairPayResultServiceMap;

    public enum PRepairPaySe {
        kko,
        nv,
    }

    public RepairPayResultService getService(PRepairPaySe PTriggerPaySe) {
        String beanName = PTriggerPaySe.name() + "PayRepairService";
        if (repairPayResultServiceMap.containsKey(beanName))
            return repairPayResultServiceMap.get(beanName);
        else
            throw new EnsException(EnsErrCd.NOT_FOUND_BEAN, EnsErrCd.NOT_FOUND_BEAN.getCodeNm());
    }
}
