package com.dbnt.kcscbackend.admin.contents.survey.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_survey")
public class TnSurvey {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "svy_seq")
  private Integer svySeq;

  @Column(name = "svy_title")
  @NotBlank(message = "설문 제목을 입력해주세요.")
  private String svyTitle;
  @Column(name = "svy_desc")
  private String svyDesc;
  @Column(name = "svy_start_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate svyStartDt;
  @Column(name = "svy_end_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate svyEndDt;
  @Column(name = "file_grp_id")
  private String fileGrpId;
  @Column(name = "svy_subcnt")
  private Integer svySubcnt;
  @Column(name = "frst_crt_id")
  private String frstCrtId;
  @Column(name = "frst_crt_dt")
  private LocalDateTime frstCrtDt;
  @Column(name = "last_chg_id")
  private String lastChgId;
  @Column(name = "last_chg_dt")
  private LocalDateTime lastChgDt;
  @Column(name = "use_yn")
  private String useYn;
  @Column(name = "old_seq")
  private Integer oldSeq;
}
