package com.icomsys.main_vm.db.jpa.entity.conversation;

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Table(name = "TB_SLOT_MASTER")
@Entity
@Getter
@Setter
@NoArgsConstructor
public class TbSlotMaster {
    @Id
    @Column(name = "SEQ", nullable = false, length = 20)
    private Long seq;
    @Column(name = "OPR_MNG_CODE", nullable = false, length = 50)
    private String oprMngCode;
    @Column(name = "GROUP_NAME", nullable = true, length = 50)
    private String groupName;
    @Column(name = "INTENT_SEQ", nullable = false, length = 11)
    private Long intentSeq;
    @Column(name = "IF_MAPPING_ID", nullable = true, length = 20)
    private Long ifMappingId;
    @Column(name = "USE_YN", nullable = true, length = 1)
    private String useYn;
    @Column(name = "REGIST_ID", nullable = false, length = 20)
    private String registId;
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;
    @Column(name = "UPDATE_ID", nullable = true, length = 20)
    private String updateId;
    @Column(name = "UPDATE_DATE", nullable = true)
    private LocalDateTime updateDate;

    @Builder
    public TbSlotMaster(Long seq, String oprMngCode, String groupName, Long intentSeq, Long ifMappingId, String useYn, String registId, LocalDateTime registDate, String updateId, LocalDateTime updateDate) {
        this.seq = seq;
        this.oprMngCode = oprMngCode;
        this.groupName = groupName;
        this.intentSeq = intentSeq;
        this.ifMappingId = ifMappingId;
        this.useYn = useYn;
        this.registId = registId;
        this.registDate = registDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
    }

    public TbSlotMaster updateUseY(){
        this.useYn = "Y";
        return this;
    }


    public TbSlotMaster updateUseN(){
        this.useYn = "N";
        return this;
    }

}
