package com.dbnt.sims.fpiMgt.affair.model;

import com.dbnt.sims.config.BaseModel;
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 org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "affair_board")
public class AffairBoard extends BaseModel {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "affair_key")
  private Integer affairKey;
  @Column(name = "affair_type1")
  private String affairType1;
  @Column(name = "affair_type2")
  private String affairType2;
  @Column(name = "affair_type3")
  private String affairType3;
  @Column(name = "affair_type4")
  private String affairType4;
  @Column(name = "title")
  private String title;
  @Column(name = "content")
  private String content;
  @Column(name = "wrt_organ")
  private String wrtOrgan;
  @Column(name = "wrt_part")
  private String wrtPart;
  @Column(name = "wrt_user_nm")
  private String wrtUserNm;
  @Column(name = "wrt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
  private LocalDateTime wrtDt;
  @Column(name = "wrt_user_seq")
  private Integer wrtUserSeq;
  @Column(name = "etc")
  private String etc;
  @Column(name = "report_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate reportDt;
  @Column(name = "auto_delete")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate autoDelete;
  @Column(name = "view_status")
  private String viewStatus;
  @Column(name = "affair_category")
  private String affairCategory;

  @Transient
  private String organUp;
  @Transient
  private String affairRate;
  @Transient
  private String affairStatus;
  @Transient
  private String ratingOrgan;

  @Transient
  private String hashTags;
  @Transient
  private Integer fileCnt;
  @Transient
  private String userType;
  @Transient
  private List<AffairFile> fileList;
  @Transient
  private List<AffairRating> rateList;
  @Transient
  private List<MultipartFile> multipartFileList;

}
