package cokr.xit.ens.modules.kkotalk.domain;

import java.time.*;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.*;

import org.hibernate.annotations.*;

import cokr.xit.ens.modules.common.domain.support.*;
import lombok.*;

@Entity
@Getter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ens_snd_dtl_kko_talk_stat_his", indexes = {
        @Index(name = "idx_snd_dtl_kko_talk_stat_his_01", columnList = "regist_dt")
})
public class SendDetailKkoTalkStatHist {

    @Id
//	@GeneratedValue(strategy=GenerationType.AUTO)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SendDetailKkoTalkStatHist_Generator")
    @TableGenerator(table = "ens_seq_generator", name = "SendDetailKkoTalkStatHist_Generator"
            , pkColumnName = "seq_name", pkColumnValue = "SendDetailKkoTalkStatHist_id"
            , initialValue = 0, allocationSize = 200)
    private Long id;


    @Column(name = "send_detail_id", nullable = false)
    private Long sendDetailId;


    @Column(name = "envelope_id", nullable = true)
    private String envelopeId;


    @Column(name = "external_id", nullable = true)
    @Setter
    private String externalId;


//	@Column(name = "resp_raw_msg", nullable = true, length = 1000)
//	private String respRawMsg;


    @Column(name = "status", nullable = true)
//	@Enumerated(EnumType.STRING)
    private String status;


    @Column(name = "sent_at", nullable = true)
    private String sentAt;


    @Column(name = "received_at", nullable = true)
    private String receivedAt;


    @Column(name = "authenticated_at", nullable = true)
    private String authenticatedAt;


    @Column(name = "ott_verified_at", nullable = true)
    private String ottVerifiedAt;


    @Column(name = "read_at", nullable = true)
    private String readAt;

    @Column(name = "read_expired_at", nullable = true)
    private String readExpiredAt;

    @Column(name = "user_notified_at", nullable = true)
    private String userNotifiedAt;


    @Column(name = "distribution_received_at", nullable = true)
    private String distributionReceivedAt;//???


    @Column(name = "payload", nullable = true)
    private String payload;


    @Column(name = "regist_dt", nullable = true)
    @CreationTimestamp
    private LocalDateTime registDt;

    @Embedded
    private FieldError error;


}
