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

import com.its.api.its.model.dto.link.LinkParaStupDto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "TB_LINK_PARA_STUP")
public class TbLinkParaStup {

    @Id
    @Column(nullable = false, unique = true, length = 7)
    private Long   LINK_ID;         //	N	NUMBER(10)	N			링크ID
    @Column(nullable = false, length = 7)
    private String FLTR_MTHD_CD;    //	N	VARCHAR2(7)	Y			필터링 방법 코드
    @Column(nullable = false, length = 7)
    private String FUSN_MTHD_CD;    //	N	VARCHAR2(7)	Y			퓨전 방법 코드
    @Column(nullable = false, length = 7)
    private String ADJS_MTHD_CD;    //	N	VARCHAR2(7)	Y			보정 방법 코드
    @Column(nullable = false, length = 7)
    private String SMTH_MTHD_CD;    //	N	VARCHAR2(7)	Y			평활화 방법 코드

    public TbLinkParaStup(Long LINK_ID) {
        this.LINK_ID = LINK_ID;
    }

    public void updateInfo(LinkParaStupDto.LinkParaStupUpdateReq req) {
        this.FLTR_MTHD_CD = req.getFLTR_MTHD_CD();
        this.FUSN_MTHD_CD = req.getFUSN_MTHD_CD();
        this.ADJS_MTHD_CD = req.getADJS_MTHD_CD();
        this.SMTH_MTHD_CD = req.getSMTH_MTHD_CD();
    }
}
