package com.dbnt.sims.fpiMgt.affairPlan.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 = "plan_board")
public class PlanBoard extends BaseModel {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "plan_key")
  private Integer planKey;
  @Column(name = "content_title")
  private String contentTitle;
  @Column(name = "plan_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate planDt;
  @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 String userType;
  @Transient
  private Integer fileCnt;
  @Transient
  private List<PlanMainInfo> mainInfoList;
  @Transient
  private List<PlanApprv> apprvList;
  @Transient
  private List<PlanFile> fileList;
  @Transient
  private List<MultipartFile> multipartFileList;

}
