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_req_his", schema = "", catalog = "", indexes = {
        @Index(name = "idx_snd_dtl_kt_st_req_his_01", columnList = "regist_dt")
})
@Schema(name = "SendDetailKtSigntalkReqHist")
public class SendDetailKtSigntalkReqHist {

    @Id
//	@GeneratedValue(strategy=GenerationType.AUTO)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SendDetailKtSigntalkReqHist_Generator")
    @TableGenerator(table = "ens_seq_generator", name = "SendDetailKtSigntalkReqHist_Generator"
            , pkColumnName = "seq_name", pkColumnValue = "SendDetailKtSigntalkReqHist_id"
            , initialValue = 0, allocationSize = 200)
    @Schema(required = true, title = "PK", example = " ")
    private Long id;


//    @JoinColumn(name = "send_mast_id")
//    @Schema(required = true, title = "발송마스터ID(FK)", example = " ")
//    private SendMast sendMast;
    @Schema(required = false, title = "발송상세ID", example = " ")
    @Column(name = "send_detail_id", nullable = true)
    private Long sendDetailId;

    @Schema(required = true, title = "전송요청 메시지", example = " ")
    @Column(name = "send_raw_msg", nullable = false, length = 4000)
    private String sendRawMsg;

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

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

    @Schema(required = false, title = "응답 메시지", example = " ")
    @Column(name = "resp_raw_msg", nullable = true, length = 1000)
    private String respRawMsg;

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

    @Embedded
    @Setter
    private FieldError error;

}
