package com.dbnt.kcscbackend.commonCode.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_popup_mng")
public class TnPopupMng {

  @Id
  @Column(name = "popup_seq")
  private Long popupSeq;

  @Column(name = "popup_title")
  private String popupTitle;

  @Column(name = "popup_start_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime popupStartDate;

  @Column(name = "popup_end_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime popupEndDate;

  @Column(name = "file_grp_id")
  private String fileGrpId;

  @Column(name = "popup_contents")
  private String popupContents;

  @Column(name = "frst_crt_id")
  private String frstCrtId;

  @Column(name = "frst_crt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime frstCrtDt;

  @Column(name = "last_chg_id")
  private String lastChgId;

  @Column(name = "last_chg_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime lastChgDt;

  @Column(name = "use_yn")
  private String useYn;


  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class TnPopupMngId implements Serializable {
    private static final long serialVersionUID = -6558812991140219351L;
    private String popupSeq;
  }

}