package com.its.op.dto.its.vms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.its.op.entity.its.vms.TbVmsIfsc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * VMS 표출 일정 DTO Class
 */
@Data
@Builder
@ApiModel("VmsFormIfscDto(VMS 교통 정보 폼 정보제공구간 정보)")
public class VmsFormIfscDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("VMS 제어기 번호")  // N NUMBER(10)
    @JsonProperty("vms_ctlr_nmbr")
    private Long vmsCtlrNmbr;

    @ApiModelProperty("VMS 스케줄 유형(A:자동,F:고정,B:기본)")  // N VARCHAR2(5)
    @JsonProperty("vms_sch_type")
    private String vmsSchType;

    @ApiModelProperty("VMS 폼 스케쥴 유형(0:교통,1:돌발,2:공사행사,3:홍보,4:우회,5:정체,6:안전,7:동영상,8:스트리밍영상,9:대기환경,10:주차정보)")  // N NUMBER(3)
    @JsonProperty("vms_sch_form_type")
    private Integer vmsSchFormType;

    @ApiModelProperty("PHASE")  // N NUMBER(2)
    @JsonProperty("phase")
    private Integer phase;

    @ApiModelProperty("VMS FORM ID")  // Y NUMBER(5)
    @JsonProperty("vms_form_id")
    private Integer vmsFormId;

    @ApiModelProperty("VMS FORM 유형 코드")  // N NUMBER(3)
    @JsonProperty("vms_form_type_cd")
    private Integer vmsFormTypeCd;

    @ApiModelProperty("1단 VMS 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("frst_vms_ifsc")
    private FormIfscInfo frstVmsIfsc;

    @ApiModelProperty("2단 VMS 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("secd_vms_ifsc")
    private FormIfscInfo secdVmsIfsc;

    @ApiModelProperty("3단 VMS 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("thir_vms_ifsc")
    private FormIfscInfo thirVmsIfsc;

    @ApiModelProperty("4단 VMS 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("four_vms_ifsc")
    private FormIfscInfo fourVmsIfsc;

    @ApiModelProperty("1단 이미지 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("frst_img_ifsc")
    private FormIfscInfo frstImgIfsc;

    @ApiModelProperty("2단 이미지 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("secd_img_ifsc")
    private FormIfscInfo secdImgIfsc;

    @ApiModelProperty("3단 이미지 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("thir_img_ifsc")
    private FormIfscInfo thirImgIfsc;

    @ApiModelProperty("4단 이미지 정보제공구간")  // Y NUMBER(10)
    @JsonProperty("four_img_ifsc")
    private FormIfscInfo fourImgIfsc;

    public static class FormIfscInfo {

        @ApiModelProperty("VMS 정보제공구간 ID")  // N NUMBER(10)
        @JsonProperty("vms_ifsc_id")
        private Long vmsIfscId;

        @ApiModelProperty("VMS 정보제공구간 명")  // Y VARCHAR(60)
        @JsonProperty("vms_ifsc_nm")
        private String vmsIfscNm;

        @ApiModelProperty("표출 시작 노드 명")  // Y VARCHAR(30)
        @JsonProperty("dspl_strt_node_nm")
        private String dsplStrtNodeNm;

        @ApiModelProperty("표출 종료 노드 명")  // Y VARCHAR(30)
        @JsonProperty("dspl_end_node_nm")
        private String dsplEndNodeNm;

        @ApiModelProperty("도로명")  // Y VARCHAR(30)
        @JsonProperty("road_nm")
        private String roadNm;

        @ApiModelProperty("지점명")  // Y VARCHAR(30)
        @JsonProperty("spot_nm")
        private String spotNm;

        @ApiModelProperty("축정보 생성용")  // Y CHAR(1)
        @JsonProperty("axis_yn")
        private String axisYn;

         public FormIfscInfo(TbVmsIfsc ifsc) {
            if (ifsc != null) {
                this.vmsIfscId = ifsc.getVmsIfscId();
                this.vmsIfscNm = ifsc.getVmsIfscNm();
                this.dsplStrtNodeNm = ifsc.getDsplStrtNodeNm();
                this.dsplEndNodeNm = ifsc.getDsplEndNodeNm();
                this.roadNm = ifsc.getRoadNm();
                this.spotNm = ifsc.getSpotNm();
                this.axisYn = ifsc.getAxisYn();
            }
        }

    }
}
