package cokr.xit.ens.modules.ktsigntalk.direct.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_kt_st_stat_his", schema = "", catalog = "", indexes = {
        @Index(name = "idx_snd_dtl_kt_st_stat_his_01", columnList = "regist_dt")
})
@Schema(name = "SendDetailKtSigntalkStatHist")
public class SendDetailKtSigntalkStatHist {

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

    @Schema(required = true, title = "발송상세ID", example = " ")
    @Column(name = "send_detail_id", nullable = false)
    private Long sendDetailId;

    @Schema(required = false, title = "문서식별번호(내부)", example = " ")
    @Column(name = "src_key", nullable = true)
    private String srcKey;

//    @Schema(required = false, title = "문서식별번호(외부)", example = " ")
//    @Column(name = "client_src_key", nullable = true)
//    @Setter
//    private String clientSrcKey;

    @Schema(required = true, title = "MMS발송결과", example = " ")
    @Column(name = "mms_sndg_rslt_sqno", nullable = true, length = 8)
    private Integer mmsSndgRsltSqno;

    @Schema(required = true, title = "처리일자", example = " ")
    @Column(name = "prcs_dt", nullable = true, length = 8)
    private String prcsDt;

    @Schema(required = true, title = "문서코드", example = " ")
    @Column(name = "mms_bsns_dvcd", nullable = true, length = 5)
    private String mmsBsnsDvcd;

    @Schema(required = false, title = "수신동의여부", example = " ")
    @Column(name = "approve_yn", nullable = true, length = 1)
    private String approveYn;

    @Schema(required = false, title = "수신동의일시", example = " ")
    @Column(name = "approve_date", nullable = true, length = 14)
    private String approveDate;

    @Schema(required = false, title = "수신거부여부", example = " ")
    @Column(name = "receive_refuse_yn", nullable = true, length = 1)
    private String receiveRefuseYn;

    @Schema(required = false, title = "수신거부일시", example = " ")
    @Column(name = "receive_refuse_date", nullable = true, length = 14)
    private String receiveRefuseDate;

    @Schema(required = false, title = "선택채널", example = " ")
    @Column(name = "choice_channel", nullable = true, length = 2)
    private String choiceChannel;

    @Schema(required = false, title = "모바일사업자구분코드", example = " ")
    @Column(name = "mbl_bzowr_dvcd", nullable = true, length = 2)
    private String mblBzowrDvcd;

    @Schema(required = false, title = "실제 발송번호(일부)", example = " ")
    @Column(name = "rl_mms_sndg_telno", nullable = true, length = 20)
    private String rlMmsSndgTelno;

    @Schema(required = true, title = "발송결과코드", example = " ")
    @Column(name = "mms_sndg_rslt_dvcd", nullable = true, length = 2)
    private String mmsSndgRsltDvcd;

    @Schema(required = true, title = "발송타임스템프", example = " ")
    @Column(name = "mms_sndg_tmst", nullable = true, length = 14)
    private String mmsSndgTmst;

    @Schema(required = false, title = "수신타임스템프", example = " ")
    @Column(name = "mms_rcv_tmst", nullable = true, length = 14)
    private String mmsRcvTmst;

    @Schema(required = false, title = "열람타임스템프", example = " ")
    @Column(name = "mms_rdg_tmst", nullable = true, length = 14)
    private String mmsRdgTmst;


    @Schema(required = false, title = "등록일시", example = " ")
    @Column(name = "regist_dt", nullable = true)
    @CreationTimestamp
    private LocalDateTime registDt;

    @Embedded
    private FieldError error;


}
