package com.its.api.its.model.dto.analysis;

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

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 링크 소통상황 수집 이력 DTO Class
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("TbClctSystSttsHsClctDto(교통정보수집결과분석)")
public class TbClctSystSttsHsClctDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("가공 일시")  // N VARCHAR(14)
    @JsonProperty("prcn_dt")
    private String prcnDt;

    @ApiModelProperty("총수집개수")
    @JsonProperty("clct_tot")
    private int    clctTot;        // 총수집개수

    @ApiModelProperty("운영자개입 속도")  // Y NUMBER(3)
    @JsonProperty("OPER01")
    private Integer oper01;

    @ApiModelProperty("중앙센터-UTIS 속도")  // Y NUMBER(3)
    @JsonProperty("UTIS01")
    private Integer utis01;

    @ApiModelProperty("중앙센터-ITS 속도")  // Y NUMBER(3)
    @JsonProperty("UTIS02")
    private Integer utis02;

    @ApiModelProperty("영상VDS 속도")  // Y NUMBER(3)
    @JsonProperty("VDS01")
    private Integer vds01;

    @ApiModelProperty("민간정보 속도")  // Y NUMBER(3)
    @JsonProperty("MOCT01")
    private Integer moct01;

    public void makeClctTot() {
        this.clctTot = this.oper01 + this.utis01 + this.utis02 + this.vds01 + this.moct01;
    }

    public TbClctSystSttsHsClctDto(String prcnDt, BigDecimal OPER01, BigDecimal UTIS01, BigDecimal UTIS02, BigDecimal VDS01, BigDecimal MOCT01) {
        this.prcnDt = prcnDt;
        this.oper01 = OPER01.intValue();
        this.utis01 = UTIS01.intValue();
        this.utis02 = UTIS02.intValue();
        this.vds01 = VDS01.intValue();
        this.moct01 = MOCT01.intValue();
        this.clctTot = 0;
    }
}
