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

import com.eactive.eai.data.converter.LocalDateTimeFormatters;
import com.eactive.eai.data.entity.onl.transformer.transform.TransformEntity;
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 TransformDeploy extends DeployResource<TransformEntity> {

   @Override
   public TransformEntity probeForExample() {
      TransformEntity probe = new TransformEntity();
      probe.setCnvsnname(this.cnvsnname);
      return probe;
   }

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

   /** 변환명 */
   @JsonProperty("TransformName")
   private String cnvsnname;

   /** 변환설명 */
   @JsonProperty("TransformDescription")
   private String cnvsndesc;

   /** 최종수정시각 */
   @JsonProperty("LastDateTime")
   @JsonFormat(pattern = LocalDateTimeFormatters.FORMAT_YYYY_MM_DD_HH_MM_SS_19)
   private LocalDateTime lastamndhms;

   /** 담당자 */
   @JsonProperty("Author")
   private String author;

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

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

   /** EAI 서비스명 */
   @JsonProperty("IfServiceCode")
   private String eaisvcname;

   /** 사용 여부 */
   @JsonProperty("UseYn")
   private String useyn;

   /** 버전 정보 */
   @JsonProperty("VersionInfo")
   private String verinfo;

   @JsonProperty("TransformTypes")
   private List<TransformTypeDeploy> transformTypes;

   @JsonProperty("TransformItems")
   private List<TransformItemDeploy> transformItems;

}
