package com.its.api.its.model.entity.vms;

import com.its.api.its.model.dto.vms.TbVmsFormTypeDto;
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 FORM 유형 Entity Class
 */
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Builder
@AllArgsConstructor
@ApiModel("VMS FORM 유형")
@Entity
@Table(name = "TB_VMS_FORM_TYPE")
public class TbVmsFormType implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("VMS FORM 유형 코드")  // N NUMBER(3)
    @Id
    @Column(name = "VMS_FORM_TYPE_CD", nullable = false, columnDefinition = "NUMBER", length = 3)
    private Integer vmsFormTypeCd;

    @ApiModelProperty("VMS FORM 유형 명")  // Y VARCHAR(60)
    @Column(name = "VMS_FORM_TYPE_NM", length = 60)
    private String vmsFormTypeNm;

    @ApiModelProperty("편집 코드")  // Y VARCHAR(7)
    @Column(name = "EDTN_CD", length = 7)
    private String edtnCd;

    public TbVmsFormTypeDto toDto() {
        return TbVmsFormTypeDto.builder()
                .vmsFormTypeCd(this.vmsFormTypeCd)
                .vmsFormTypeNm(this.vmsFormTypeNm)
                .build();
    }

}
