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

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.time.LocalDateTime;

@Table(name = "TB_SCENARIO_HISTORY")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
public class TbScenarioHistory {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SEQ", nullable = false)
    private Long seq;
    @Column(name = "MASTER_SEQ", nullable = false)
    private Long masterSeq;
    @Column(name = "LAST_YN", nullable = false, length = 1)
    private String lastYn;
    @Column(name = "REGIST_ID", nullable = false, length = 20)
    private String registId;
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;

    @Builder
    public TbScenarioHistory(Long seq, Long masterSeq, String lastYn, String registId, LocalDateTime registDate) {
        this.seq = seq;
        this.masterSeq = masterSeq;
        this.lastYn = lastYn;
        this.registId = registId;
        this.registDate = registDate;
    }

    @Builder
    public TbScenarioHistory(Long masterSeq, String lastYn, String registId, LocalDateTime registDate) {
        this.masterSeq = masterSeq;
        this.lastYn = lastYn;
        this.registId = registId;
        this.registDate = registDate;
    }
}
