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

import com.its.api.its.model.dto.vds.TbVdsDtctLinkRltnDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;

/**
 * VDS 검지기 링크 관계 Entity Class
 */
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Builder
@AllArgsConstructor
@ApiModel("VDS 검지기 링크 관계")
@Entity
@Table(name = "TB_VDS_DTCT_LINK_RLTN")
//@IdClass(TbVdsDtctLinkRltnKey.class)
public class TbVdsDtctLinkRltn implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("검지기 번호")  // N VARCHAR(8)
    @Id
    @Column(name = "DTCT_NMBR", nullable = false, length = 8)
    private String dtctNmbr;

    @ApiModelProperty("링크ID")  // N NUMBER(10)
    //@Id
    @Column(name = "LINK_ID", nullable = false, columnDefinition = "NUMBER", length = 10)
    private Long linkId;

    public TbVdsDtctLinkRltnDto toDto() {
        return TbVdsDtctLinkRltnDto.builder()
                .dtctNmbr(this.dtctNmbr)
                .linkId(this.linkId)
                .build();
    }

    public void updateInfo(TbVdsDtctLinkRltnDto.TbVdsDtctLinkRltnUpdReq req) {
    }

}
