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

import com.icomsys.main_vm.db.jpa.entity.monitoring.id.TbCallInfoId;
import com.icomsys.main_vm.db.jpa.entity.monitoring.id.TbCallRecId;
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_CALL_BOT_REC")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbCallRecId.class)
public class TbCallBotRec {

    @Id
    @Column(name = "TOKEN", nullable = false)
    private String token;
    @Id
    @Column(name = "TALK_SEQ", nullable = false)
    private int talkSeq;
    @Column(name = "REC_FILE_PATH", nullable = false, length = 200)
    private String recFilePath;
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;

    @Builder
    public TbCallBotRec(String token, int talkSeq, String recFilePath, LocalDateTime registDate) {
        this.token = token;
        this.talkSeq = talkSeq;
        this.recFilePath = recFilePath;
        this.registDate = registDate;
    }
}
