package cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain;

import cokr.xit.ens.modules.common.code.IntgrnDtlStatCd;
import cokr.xit.ens.modules.common.code.PostSeCd;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.Bill;
import cokr.xit.ens.modules.common.domain.BaseEntity;
import cokr.xit.ens.modules.common.domain.support.FieldError;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;

@Entity
//@Data
@Getter
@ToString
@SuperBuilder
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ens_intgrn_snd_dtl", schema = "", catalog = "", indexes = {
        @Index(name = "idx_intgrn_linked_uuid", columnList = "linked_uuid"),
//        @Index(name = "idx_intgrn_bill_uid", columnList = "mk_bill_uid"),
})
public class IntgrnSendDetail extends BaseEntity {

    @Id
//	@GeneratedValue(strategy=GenerationType.AUTO)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "IntgrnSendDetail_Generator")
    @TableGenerator(table = "ens_seq_generator", name = "IntgrnSendDetail_Generator"
            , pkColumnName = "seq_name", pkColumnValue = "IntgrnSendDetail_id"
            , initialValue = 0, allocationSize = 50)
    
    private Long intSendDetailId;              

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "int_send_mast_id")
    private IntgrnSendMast intgrnSendMast;        

    
    @Column(name = "linked_uuid", length = 40)
    @Setter
    private String linkedUuid;

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

    
    @Column(name = "jid", nullable = true, length = 24)
    private String jid;

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


//	@Column(name = "json_kko_bill_link_info", nullable = true)
//	@Lob
//	private String jKkoBillLinkInfo;

    
    @Column(name = "json_tmplt_msg_data", nullable = true)
    @Lob
    private String jTmpltMsgData;

    
    @Column(name = "json_mbl_page_data", nullable = true)
    @Lob
    private String jMblPageData;


    @Column(name = "j_acpt_doc_kko_at", nullable = true)
    @Lob
    private String jAcptDocKkoAt;
    @Column(name = "j_acpt_doc_kko_md", nullable = true)
    @Lob
    private String jAcptDocKkoMd;
    @Column(name = "j_acpt_doc_nv_st", nullable = true)
    @Lob
    private String jAcptDocNvSt;
    @Column(name = "j_acpt_doc_kt_st", nullable = true)
    @Lob
    private String jAcptDocKtSt;
    @Column(name = "j_acpt_doc_kt_gbs", nullable = true)
    @Lob
    private String jAcptDocKtGbs;

    @Setter
    @Column(name = "cur_post_se", nullable = true)
    @Enumerated(EnumType.STRING)
    private PostSeCd curPostSe;
    @Setter
    @Column(name = "send_detail_id_kko_at", nullable = true)
    private Long sendDetailIdKkoAt;
    @Setter
    @Column(name = "send_detail_id_kko_md", nullable = true)
    private Long sendDetailIdKkoMd;
    @Setter
    @Column(name = "send_detail_id_nv_st", nullable = true)
    private Long sendDetailIdNvSt;
    @Setter
    @Column(name = "send_detail_id_kt_st", nullable = true)
    private Long sendDetailIdKtSt;
    @Setter
    @Column(name = "send_detail_id_kt_gbs", nullable = true)
    private Long sendDetailIdKtGbs;


    
    @Setter
    @Enumerated(EnumType.STRING)
    @Column(name = "cur_stat_cd", nullable = false)
    private IntgrnDtlStatCd curStatCd;
    
    @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;


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

//    @Column(name = "mk_bill_uid", nullable = true, length = 45)
//    private String mkBillUid;
    
    @JoinColumn(name = "bill_uid", referencedColumnName = "bill_uid")
    @OneToOne(fetch = FetchType.LAZY)
    private Bill bill;


    @Embedded
    @Setter
    private FieldError error;


}
