package cokr.xit.ens.biz.iup.domain;

import cokr.xit.ens.biz.iup.code.IupPrcsCd;
import cokr.xit.ens.biz.iup.code.IupSendTypeCd;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
//@Data
@Getter
@ToString
@Builder
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_input_xit", schema = "", catalog = "")
public class TbInputXit {

    @Id
    @Column(name = "lnk_input_id", nullable = false)
    private Long lnkInputId;

    
    @Column(name = "org_cd", nullable = false, length = 100)
    private String orgCd;

    
    @JoinColumn(name = "job_cd")
    @ManyToOne(fetch = FetchType.LAZY)
    private FsJob fsJob;

    
    @Column(name = "tot_cnt", nullable = false)
    private Long totCnt;

    
    @Column(name = "prcs_cd", nullable = false)
    @Enumerated(EnumType.STRING)
    @Setter
    private IupPrcsCd prcsCd;

    
    @Column(name = "err_msg", nullable = true, length = 1000)
    @Setter
    private String errMsg;

    
    @Column(name = "run_dt", nullable = false)
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime runDt;

    
    @Column(name = "expires_dt", nullable = false)
    private LocalDateTime expiresDt;

    
    @Column(name = "send_type", nullable = false, length = 10)
    @Enumerated(EnumType.STRING)
    private IupSendTypeCd sendType;

    
    @Column(name = "reg_id", nullable = false, length = 20)
    private String regId;

    
    @Column(name = "reg_dt", nullable = false)
    private LocalDateTime regDt;

    
    @Column(name = "upd_id", nullable = true, length = 20)
    @Setter
    private String updId;

    
    @Column(name = "upd_dt", nullable = true)
    @UpdateTimestamp
    private LocalDateTime updDt;

    
    @Column(name = "rcpt_dt", nullable = true, length = 30)
    private String rcptDt;

    
    @Column(name = "pay_expires_dt", nullable = false)
    private LocalDateTime payExpiresDt;


}
