package com.its.op.dto.its.common;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

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

/**
 *  DTO Class
 */
@Data
@Builder
@ApiModel("FcltSttsSummaryDto(시설물현황종합)")
public class FcltSttsSummaryDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("시설물유형")  // Y VARCHAR(4)
    @JsonProperty("fclt_type")
    private String fcltType;

    @ApiModelProperty("시설물명")  // Y VARCHAR(100)
    @JsonProperty("fclt_nm")
    private String fcltNm;

    @Builder.Default
    @ApiModelProperty("전체개수")  // Y NUMBER(0)
    @JsonProperty("total_cnt")
    private Integer totalCnt = 0;

    @Builder.Default
    @ApiModelProperty("정상개수")  // Y NUMBER(0)
    @JsonProperty("normal_cnt")
    private Integer normalCnt = 0;

    @Builder.Default
    @ApiModelProperty("오류개수")  // Y NUMBER(0)
    @JsonProperty("error_cnt")
    private Integer errorCnt = 0;

    @Builder.Default
    @ApiModelProperty("수집이상")  // Y NUMBER(0)
    @JsonProperty("col_err_cnt")
    private Integer colErrCnt = 0;

    @Builder.Default
    @ApiModelProperty("도어열림")
    @JsonProperty("door_open")
    private Integer doorOpen = 0;

    @Builder.Default
    @ApiModelProperty("팬가동")
    @JsonProperty("fan_run")
    private Integer fanRun = 0;

    @Builder.Default
    @ApiModelProperty("히터가동")
    @JsonProperty("hetr_run")
    private Integer hetrRun = 0;

    @Builder.Default
    @ApiModelProperty("온도이상")
    @JsonProperty("temp_err")
    private Integer tempErr = 0;

    @Builder.Default
    @ApiModelProperty("모듈이상")
    @JsonProperty("modl_err")
    private Integer modlErr = 0;

    @Builder.Default
    @ApiModelProperty("모듈전원이상")
    @JsonProperty("modl_pwer_err")
    private Integer modlPwerErr = 0;

    @Builder.Default
    @ApiModelProperty("파워이상")
    @JsonProperty("pwer_err")
    private Integer pwerErr = 0;

    @Builder.Default
    @ApiModelProperty("카메라이상")
    @JsonProperty("cam_err")
    private Integer camErr = 0;

    @Builder.Default
    @ApiModelProperty("검지기이상")
    @JsonProperty("dtct_err")
    private Integer dtctErr = 0;

    @ApiModelProperty("시설물 목록")
    @JsonProperty("fclt_objs")
    private List<FcltSttsDto> fcltObjs;

    public void init() {
        this.doorOpen = 0;
        this.fanRun = 0;
        this.hetrRun = 0;
        this.tempErr = 0;
        this.modlErr = 0;
        this.modlPwerErr = 0;
        this.pwerErr = 0;
        this.camErr = 0;
        this.dtctErr = 0;

        this.fcltObjs = new ArrayList<>();

    }
}
