package com.its.vms.dto;

import com.its.vms.entity.TbVmsIfscTraf;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;

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

    private Long vmsIfscId;
    private String vmsIfscNm;
    private String dsplStrtNodeNm;
    private String dsplEndNodeNm;
    private Long detrId;
    private String roadNm;
    private String spotNm;
    private String axisYn;
    private Integer cngstSpd;
    private String useYn;

    private String prcnDt;
    private String cmtrGradCd;
    private Integer sped;
    private Integer trvlHh;

    public TbVmsIfscTraf toEntity() {
        return TbVmsIfscTraf.builder()
                .vmsIfscId(this.vmsIfscId)
                .vmsIfscNm(this.vmsIfscNm)
                .dsplStrtNodeNm(this.dsplStrtNodeNm)
                .dsplEndNodeNm(this.dsplEndNodeNm)
                .detrId(this.detrId)
                .roadNm(this.roadNm)
                .spotNm(this.spotNm)
                .axisYn(this.axisYn)
                .prcnDt(this.prcnDt)
                .cmtrGradCd(this.cmtrGradCd)
                .sped(this.sped)
                .trvlHh(this.trvlHh)
                .cngstCnt(0)
                .cngstDt("")
                .build();
    }

    public void trafCopy(TbVmsIfscTraf traf) {
        traf.setDsplStrtNodeNm(this.dsplStrtNodeNm);
        traf.setDsplEndNodeNm(this.dsplEndNodeNm);
        traf.setDetrId(this.detrId);
        traf.setRoadNm(this.roadNm);
        traf.setSpotNm(this.spotNm);
        traf.setAxisYn(this.axisYn);
        traf.setPrcnDt(this.prcnDt);
        traf.setCmtrGradCd(this.cmtrGradCd);
        traf.setSped(this.sped);
        traf.setTrvlHh(this.trvlHh);
    }
}
