package com.dbnt.faisp.main.fpiMgt.affairResult.model;

import com.dbnt.faisp.config.BaseModel;
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
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 = "result_board")
public class ResultBoard extends BaseModel {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "result_key")
  private Integer resultKey;
  @Column(name = "result_state")
  private String resultState;
  @Column(name = "clear_title")
  private String clearTitle;
  @Column(name = "result_title")
  private String resultTitle;
  @Column(name = "use_start_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate useStartDt;
  @Column(name = "use_end_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate useEndDt;
  @Column(name = "work_start_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate workStartDt;
  @Column(name = "work_end_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate workEndDt;
  @Column(name = "plan_price")
  private Double planPrice;
  @Column(name = "use_price")
  private Double usePrice;
  @Column(name="result_etc")
  private String resultEtc;
  @Column(name="clear_etc")
  private String clearEtc;
  @Column(name = "wrt_organ")
  private String wrtOrgan;
  @Column(name = "wrt_part")
  private String wrtPart;
  @Column(name = "wrt_user_seq")
  private Integer wrtUserSeq;
  @Column(name = "wrt_user_grd")
  private String wrtUserGrd;
  @Column(name = "wrt_user_nm")
  private String wrtUserNm;
  @Column(name = "wrt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
  private LocalDateTime wrtDt;


  @Transient
  private String userType;
  @Transient
  private Integer affairCnt;
  @Transient
  private Integer fileCnt;
  @Transient
  private List<ResultApprv> apprvList;
  @Transient
  private List<ResultFile> fileList;
  @Transient
  private List<MultipartFile> multipartFileList;
  @Transient
  private List<ClearInfo> clearInfoList;
  @Transient
  private List<ResultInfo> resultInfoList;
  @Transient
  private List<ResultToAffair> affairList;
  @Transient
  private List<AffairBoard> affairBoardList;
}
