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

import com.dbnt.faisp.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.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_status")
  private String affairStatus;
  @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 = "plan_state")
  private String planState;
  @Column(name = "wrt_user_seq")
  private Integer wrtUserSeq;


  @Transient
  private List<AffairFile> fileList;
  @Transient
  private List<AffairRating> rateList;
  @Transient
  private List<MultipartFile> multipartFileList;

}
