package com.eactive.eai.rms.onl.loader.intf.deploy;

import com.eactive.eai.data.entity.onl.message.EAIMessageEntity;
import com.eactive.eai.rms.onl.loader.service.DeployResource;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.emory.mathcs.backport.java.util.Arrays;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
public class EAIMessageDeploy extends DeployResource<EAIMessageEntity> {

    @Override
    public EAIMessageEntity probeForExample() {
        EAIMessageEntity probe = new EAIMessageEntity();
        probe.setEaisvcname(this.eaisvcname);
        return probe;
    }

    @Override
    public List<String> exactMatchFields() {
        return Arrays.asList(new String[]{
                "eaisvcname"
        });
    }
   /*EAI서비스코드*/
    @JsonProperty("InterfaceServiceCode")
    private String eaisvcname;

    @JsonProperty("Author")
    private String author;
    
    /*오류요청변환ID명*/
    @JsonProperty("ErrorRequestTransform")
    private String dmnderrchngidname;
    
    /*오류요청에러필드명*/
    @JsonProperty("ErrorRequestField")
    private String dmnderrfldname;

    @JsonProperty("BisinessCode")
    private String eaibzwkdstcd;

    /*EAI그룹회사코드*/
    @JsonProperty("GroupCode")
    private String eaigroupcocd;

    @JsonProperty("LastDateTime")
    @JsonFormat(pattern = "yyyyMMddHHmmssSSS")
    private LocalDateTime eailastamndyms;

    /*서버구분코드*/
    @JsonProperty("ServerType")
    private String eaisevrdstcd;

    @JsonProperty("InterfaceServiceDescription")
    private String eaisvcdesc;
    
    /*오류EAI서비스코드명*/
    @JsonProperty("ErrorInterfaceServiceCode")
    private String erreaisvcname;

    /*대외업무구분*/
    @JsonProperty("ExternalBusinessCode")
    private String extbizcd;

    /*FlowControl 라우팅명*/
    @JsonProperty("FlowControl")
    private String flowctrlroutname;

    /*기동시스템어댑터업무그룹명*/
    @JsonProperty("SourceAdapter")
    private String gstatsysadptrbzwkgroupname;

    /*내외부(서버)구분코드*/
    @JsonProperty("InternalExternalCode")
    private String internalexternaldvcd;

    /*거래유형(ONLINE/BATCH/FTP)*/
    @JsonProperty("PatternType")
    private String intgradsticname;

    @JsonProperty("StatusCode")
    private String modfimgtstusdstcd;

    /*참조키*/
    @JsonProperty("ReferenceKey")
    private String refkey;

    /*오류응답변환ID명*/
    @JsonProperty("ErrorResponseTransform")
    private String rspnserrchngidname;

    /*오류응답변환ID명*/
    @JsonProperty("ErrorResponseField")
    private String rspnserrfldname;

    /*서버 로그 레벨(WARNING[0]/INFO[1]/DEBUG[2])*/
    @JsonProperty("LogLevel")
    private Integer sevrloglvelno;

    /*보조 로그 사용여부 현재는 안씀임 예전에 4000byte로 끊을때 쓰던거임*/ 
    @JsonProperty("AddLogUseYn")
    private String svcbfclmnlogyn;

    /*업무운영 시간여부*/
    @JsonProperty("ServiceTimeYn")
    private String svchmseonot;

    /*서비스 로그 레벨(로그off[0]/에러로그만[1]/동기100,400,비동기200,400[2]/전체로그[3]/업무데이터제외[4])*/
    @JsonProperty("ServiceLogLevel")
    private Integer svcloglvelno;

    /*인터페이스 사용유형(SYNC/ASYN/ACKO)*/
    @JsonProperty("SyncAsyncType")
    private String svcmotivusedstcd;

    /*서비스처리유형(SINGLE/COMPLEX/PCOMPLEX/TIMER)*/
    @JsonProperty("ServiceProcessType")
    private String svcprcesdsticname;

    /*거래유형(R:일반거래/S:중단거래/T:시뮬레이션거래)*/
    @JsonProperty("SimulationType")
    private String trantype;

    /*거래ID*/
    @JsonProperty("ServiceId")
    private String txid;

    @JsonProperty("UseYn")
    private String useyn;

    @JsonProperty("VersionInfo")
    private String verinfo;

    @JsonProperty("AuthType")
	private String authtype;

    @JsonProperty("services")
    private List<ServiceMessageDeploy> serviceMessages = new ArrayList<>();

    @JsonProperty("bizKeys")
    private List<BizKeyDeploy> bizKeyDeploys = new ArrayList<>();

    @JsonProperty("standardMessages")
    private List<StandardMessageInfoDeploy> standardMessageInfoDeploys = new ArrayList<>();

    @JsonProperty("subMessages")
    private List<SubMessageInfoDeploy> subMessageInfoDeploys = new ArrayList<>();

}
