package cokr.xit.ens.modules.kkoalimtalk.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_at_req_his", schema = "", catalog = "", indexes = {
        @Index(name = "idx_snd_dtl_kko_at_req_his_01", columnList = "regist_dt")
})
public class SendDetailKkoAlimtalkReqHist {

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

//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "send_mast_id")

//    private SendMast sendMast;

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

    
    @Column(nullable = false)
    @Lob
    private String sendRawMsg;

    
    @Column(nullable = false)
    private String btToken;

    
    @Column(nullable = true)
    private String responseCode;

    
    @Column(nullable = true, length = 1000)
    private String msg;

    
    @Column(nullable = true)
    private String reqMsgIdx;

    
    @Column(nullable = true)
    private String msgResponseCode;

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

    @Embedded
    @Setter
    private FieldError error;

}
