package com.its.op.entity.its.vms;

import com.its.op.dto.its.vms.TbVmsFormDsplDrctDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * VMS 메시지 표출 방향 Entity Class
 */
@Getter
@NoArgsConstructor//(access = AccessLevel.PROTECTED)
@Builder
@AllArgsConstructor
@ApiModel("VMS 메시지 표출 방향")
@Entity
@Table(name = "TB_VMS_FORM_DSPL_DRCT")
public class TbVmsFormDsplDrct implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("VMS 폼 표출 방향 코드")  // N NUMBER(3)
    @Id
    @Column(name = "VMS_FORM_DSPL_DRCT_CD", nullable = false, columnDefinition = "NUMBER", length = 3)
    private Integer vmsFormDsplDrctCd;

    @ApiModelProperty("VMS 폼 표출 방향 명칭")  // Y VARCHAR2(60)
    @Column(name = "VMS_FORM_DSPL_DRCT_NM", length = 60)
    private String vmsFormDsplDrctNm;

    @ApiModelProperty("사용 여부")  // Y CHAR(1)
    @Column(name = "USE_YN", columnDefinition = "CHAR", length = 1)
    private String useYn;

    public TbVmsFormDsplDrctDto toDto() {
        return TbVmsFormDsplDrctDto.builder()
                .vmsFormDsplDrctCd(this.vmsFormDsplDrctCd)
                .vmsFormDsplDrctNm(this.vmsFormDsplDrctNm)
                .useYn(this.useYn)
                .build();
    }

}
