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

import com.its.op.dto.its.vms.TbVmsFormDsplMthdDto;
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_MTHD")
public class TbVmsFormDsplMthd implements Serializable {
    private static final long serialVersionUID = 1L;

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

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

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

    public TbVmsFormDsplMthdDto toDto() {
        return TbVmsFormDsplMthdDto.builder()
                .vmsFormDsplMthdCd(this.vmsFormDsplMthdCd)
                .vmsFormDsplMthdNm(this.vmsFormDsplMthdNm)
                .useYn(this.useYn)
                .build();
    }

}
