package com.its.vms.entity;

import com.its.vms.dto.TbVmsFormDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *  Entity Class
 */
@Data
@Builder
@NoArgsConstructor//(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class TbVmsForm implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer vmsFormId;
    private String vmsTypeCd;
    private Integer vmsFormTypeCd;
    private Integer vmsFormColrCd;
    private String vmsFormNm;
    private String vmsFormExpl;
    private Integer vmsFormDsplDrctCd;
    private Integer symbLibNmbr;
    private byte[] vmsFormImag;
    private Integer vmsFormDsplMthdCd;
    private Long cctvMngmNmbr;
    private String updtDt;
    private String validYn;

    public TbVmsFormDto toDto() {
        return TbVmsFormDto.builder()
                .vmsFormId(this.vmsFormId)
                .vmsTypeCd(this.vmsTypeCd)
                .vmsFormTypeCd(this.vmsFormTypeCd)
                .vmsFormColrCd(this.vmsFormColrCd)
                .vmsFormNm(this.vmsFormNm)
                .vmsFormExpl(this.vmsFormExpl)
                .vmsFormDsplDrctCd(this.vmsFormDsplDrctCd)
                .symbLibNmbr(this.symbLibNmbr)
                .vmsFormImag(this.vmsFormImag)
                .vmsFormDsplMthdCd(this.vmsFormDsplMthdCd)
                .cctvMngmNmbr(this.cctvMngmNmbr)
                .updtDt(this.updtDt)
                .validYn(this.validYn)
                .localFileName("")
                .ftpFileName("")
                .trfBackImgId("0")
                .isBottomTrfIfsc(false)     //도형식 하단 정보제공구간소통정보
                .isBottomTrfAxis(false)     //도형식 하단 축소통정보
                .isBottomFixedText(false)    //도형식 하단에 소통정보가 없을 경우 기본문자 표출여부, 20200515 추가함
                .isNewForm(false)   //신규이거나 변경된 경우 true
                .objects(new ArrayList<>())
                .build();
    }
}
