package cokr.xit.ens.modules.ktsigntalk.gibis.domain;

import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.Bill;
import cokr.xit.ens.modules.common.domain.SendMast;
import cokr.xit.ens.modules.common.domain.support.FieldError;
import cokr.xit.ens.modules.ktsigntalk.gibis.code.KtGibisStatusCd;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.persistence.*;

@Entity
@Getter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ens_snd_dtl_kt_gbs", schema = "", catalog = "")
public class SendDetailKtGibis {

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

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "send_mast_id")
    private SendMast sendMast;

    
    @Column(name = "linked_uuid", nullable = false, length = 50)
    @Setter
    private String linkedUuid;


//    @Column(name = "title", nullable = true, length = 40)
//    @Setter
//    private String title;

    
    @Column(name = "hash", nullable = true, length = 64)
    @Setter
    private String hash;

    
    @Column(name = "src_seq", nullable = true, length = 8)
    private String srcSeq;

    
    @Column(name = "ci", nullable = true, length = 128)
    @Setter
    private String ci;

    
    @Column(name = "mms_dtl_cnts", nullable = true, length = 4000)
    @Setter
    private String mmsDtlCnts;

    
    @Column(name = "mms_title", nullable = true, length = 40)
    @Setter
    private String mmsTitle;

    
    @Column(name = "rcs_dtl_cnts", nullable = true)
    @Lob
    @Setter
    private String rcsDtlCnts;

    
//    @Column(name = "url", nullable = true, length = 50)
    @Column(name = "url", nullable = true, length = 255)
    private String url;

    
    @Column(name = "mdn", nullable = true, length = 11)
    private String mdn;

    @Embedded
    @Setter
    private FieldError error;


    
    @Column(name = "src_key", nullable = true, length = 50, unique = true)
    @Setter
    private String srcKey;

    
    @Column(name = "mk_bill_use_yn", nullable = true, length = 1)
    private String mkBillUseYn;

//    @JoinColumn(name = "bill_mast_id")
//    @OneToOne(fetch = FetchType.LAZY)
//    private KkoBillMast kkoBillMast;
    
    @JoinColumn(name = "bill_uid", referencedColumnName = "bill_uid")
    @OneToOne(fetch = FetchType.LAZY)
    private Bill bill;
    
    @Column(name = "mk_jid", nullable = true, length = 24)
    private String mkJid;
    
    @Column(name = "mk_tmplt_msg_json_data", nullable = true, length = 4000)
    private String mkTmpltMsgJsonData;


    @Enumerated(EnumType.STRING)
    
    @Column(name = "doc_stat", nullable = false, length = 30)
    @Setter
    private KtGibisStatusCd docStat;
    
    @Column(name = "doc_sent_dt", nullable = true, length = 14)
    @Setter
    private String docSentDt;
    
    @Column(name = "doc_received_dt", nullable = true, length = 14)
    @Setter
    private String docReceivedDt;
    
    @Column(name = "doc_auth_frst_dt", nullable = true, length = 14)
    @Setter
    private String docAuthFrstDt;
    
    @Column(name = "doc_token_vrfy_frst_dt", nullable = true, length = 14)
    @Setter
    private String docTokenVrfyFrstDt;
    
    @Column(name = "doc_read_frst_dt", nullable = true, length = 14)
    @Setter
    private String docReadFrstDt;

//    @Column(name = "doc_user_notied_dt", nullable = true, length = 14)
//    @Setter
//    private String docUserNotiedDt;

}
