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

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_BREAK_NODE")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
public class TbScenarioBreakNode {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SEQ", nullable = false)
    private Long seq;

    @Column(name = "TOKEN", nullable = false, length = 44)
    private String token;

    @Column(name = "TALK_SEQ", nullable = false)
    private int talkSeq;

    @Column(name = "OPR_MNG_CODE", nullable = false, length = 100)
    private String oprMngCode;

    @Column(name = "SCENARIO_SEQ", nullable = false)
    private Long scenatioSeq;

    @Column(name = "RELEASE_SEQ", nullable = false)
    private Long releaseSeq;

    @Column(name = "SCENARIO_NAME", nullable = true, length = 50)
    private String scenarioName;

//    S : 성공
//    F : 이탈
    @Column(name = "SCENARIO_RESULT_CODE", nullable = false, length = 1)
    private String scenarioResultCode;

    @Column(name = "NODE_CODE", nullable = false,length = 4)
    private String nodeCode;

    @Column(name = "NODE_NAME", nullable = true, length = 50)
    private String nodeName;

    @Column(name = "NODE_TYPE", nullable = true, length = 50)
    private String nodeType;

    @Column(name = "REGIST_DATE", nullable = true)
    private LocalDateTime registDate;

    @Builder
    public TbScenarioBreakNode(Long seq, String token, int talkSeq, String oprMngCode, Long scenatioSeq, Long releaseSeq, String scenarioName, String scenarioResultCode, String nodeCode, String nodeName, String nodeType, LocalDateTime registDate) {
        this.seq = seq;
        this.token = token;
        this.talkSeq = talkSeq;
        this.oprMngCode = oprMngCode;
        this.scenatioSeq = scenatioSeq;
        this.releaseSeq = releaseSeq;
        this.scenarioName = scenarioName;
        this.scenarioResultCode = scenarioResultCode;
        this.nodeCode = nodeCode;
        this.nodeName = nodeName;
        this.nodeType = nodeType;
        this.registDate = registDate;
    }
}
