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

import cokr.xit.ens.modules.common.domain.support.FieldError;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;

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

@Entity
@Getter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ens_snd_dtl_kko_md_stat_his", schema = "", catalog = "", indexes = {
        @Index(name = "idx_snd_dtl_kko_md_stat_his_01", columnList = "regist_dt")
})
public class SendDetailKkoMydocStatHist {

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

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

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

    
    @Column(name = "external_document_uuid", nullable = true)
    @Setter
    private String externalDocumentUuid;


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

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

    
    @Column(name = "doc_box_sent_at", nullable = true)
    private Long docBoxSentAt;

    
    @Column(name = "doc_box_received_at", nullable = true)
    private Long docBoxReceivedAt;

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

    
    @Column(name = "token_used_at", nullable = true)
    private Long tokenUsedAt;

    
    @Column(name = "doc_box_read_at", nullable = true)
    private Long docBoxReadAt;

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

    
    @Column(name = "doc_distribution_received_at", nullable = true)
    private Long docDistributionReceivedAt;//???

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

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

    @Embedded
    private FieldError error;


}
