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

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_USER_REC")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbCallRecId.class)
public class TbCallUserRec {

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

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