package cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support;

import cokr.xit.ens.modules.common.code.PostSeCd;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendDetail;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendMast;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.kkoalimtalk.AcceptDataByKkoAlimtalk;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.kkomydoc.AcceptDataByKkoMydoc;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.ktGibis.AcceptDataByKtGibis;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.ktSigntalk.AcceptDataByKtSigntalk;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.nvsigntalk.AcceptDataByNvSigntalk;
import lombok.RequiredArgsConstructor;

import java.util.List;

@RequiredArgsConstructor
public class AcceptDataMakerFactory extends AcceptDataFactory<AcceptData> {
    private final IntgrnSendMast sendMast;
    private final List<IntgrnSendDetail> sendDetails;

    private final Boolean isReserveSend;

    @Override
    public AcceptData get(PostSeCd postSeCd) {
        switch (postSeCd) {
            case kkoAlimtalk:
                return new AcceptDataByKkoAlimtalk(sendMast, sendDetails, isReserveSend);
            case kkoMydoc:
                return new AcceptDataByKkoMydoc(sendMast, sendDetails, isReserveSend);
            case nvSigntalk:
                return new AcceptDataByNvSigntalk(sendMast, sendDetails, isReserveSend);
            case ktSigntalk:
                return new AcceptDataByKtSigntalk(sendMast, sendDetails, isReserveSend);
            case ktGibis:
                return new AcceptDataByKtGibis(sendMast, sendDetails, isReserveSend);
            default:
                throw new IllegalAccessError(postSeCd.getCode() + "에 대한 전자고지 접수 Class가 정의되지 않았습니다.");
        }
    }
}
