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

import com.eactive.eai.data.entity.onl.bizkey.BizKey;
import com.eactive.eai.data.entity.onl.bizkey.BizKeyId;
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 java.time.LocalDateTime;
import java.util.List;

@Data
public class BizKeyDeploy extends DeployResource<BizKey> {

    @Override
    public BizKey probeForExample() {
        BizKeyId id = new BizKeyId();
        id.setEaisvcname(this.eaisvcname);
        BizKey probe = new BizKey();
        probe.setId(id);
        return probe;
    }

    @Override
    public List<String> exactMatchFields() {
        return Arrays.asList(new String[]{
                "id.eaisvcname"
        });
    }

    @JsonProperty("InterfaceServiceCode")
    private String eaisvcname;

    /*추출구분*/
    @JsonProperty("ExtractorCode")
    private String etractdstcd;

    /*순번*/
    @JsonProperty("Sequence")
    private Integer fldprcssno;

    /*업무필드명*/
    @JsonProperty("FieldName")
    private String bzwkfldname;

    /*eai최종수정일시*/
    @JsonProperty("LastDateTime")
    @JsonFormat(pattern = "yyyyMMddHHmmssSSS")
    private LocalDateTime eailastamndyms;

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

    /*변경관리상태구분코드*/
    @JsonProperty("StatusCode")
    private String modfimgtstusdstcd;

    /*메시지유형*/
    @JsonProperty("MessageType")
    private String msgdstcd;

}
