package com.its.vms.entity;

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

import java.io.Serializable;

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

    private Long prkPlceNmbr;
    private String prkPlceManageNo;
    private String prkPlceNm;
    private String vmsDsplNm;
    private String cmncSttsCd;
    private Integer regPrkCmprtCo;
    private Integer runPrkCmprtCo;
    private Integer parkingCgsStts;
    private Integer remndrPrkCmprtCo;

    public TbVmsParkDto toDto() {
        TbVmsParkDto dto = TbVmsParkDto.builder()
                .prkPlceNmbr(this.prkPlceNmbr)
                .prkPlceManageNo(this.prkPlceManageNo)
                .prkPlceNm(this.prkPlceNm)
                .vmsDsplNm(this.vmsDsplNm)
                .cmncSttsCd(this.cmncSttsCd)
                .regPrkCmprtCo(this.regPrkCmprtCo)
                .runPrkCmprtCo(this.runPrkCmprtCo)
                .parkingCgsStts(this.parkingCgsStts)
                .remndrPrkCmprtCo(this.remndrPrkCmprtCo)
                .build();

        dto.setSuccess("CMS0".equals(this.cmncSttsCd));
        return dto;
    }
}
