package cn.palmte.work.model.process;

import com.fasterxml.jackson.annotation.JsonFormat;

import org.hibernate.annotations.GenericGenerator;

import java.time.LocalDate;
import java.time.LocalDateTime;

import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import cn.palmte.work.model.enums.ProcessStatus;
import cn.palmte.work.model.enums.ProcessType;
import lombok.Data;

/**
 * 项目相关的流程
 *
 * @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
 * @since 2.0 2022/12/14 16:11
 */
@Data
@Entity
@Table(name = "project_process")
public class ProjectProcess {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @GenericGenerator(name = "persistenceGenerator", strategy = "increment")
  private Integer id;

  private Integer projectId;

  // 项目编号
  private String projectNo;

  @JsonFormat(pattern = "yyyy-MM-dd")
  private LocalDate applyDate;

  // 项目标题
  private String projectTitle;

  // 申请人
  private String applyPersonName;

  // 申请人 ID
  private Integer applyPersonId;

  // 申请部门
  private String applyDept;

  // 申请部门领导
  private String applyDeptLeaderName;

  // 合同编号
  private String contractNo;

  // 合同名称
  private String contractName;

  // 用印类型
  @Convert(converter = SealTypeArrayConverter.class)
  private SealTypeArray sealTypes;

  // 税率
  private String taxRate;

  // 状态
  @Enumerated(EnumType.STRING)
  private ProcessStatus status;

  // 当前审核人
  private String currentAudit;

  // 最后更新时间

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime lastUpdateAt;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime createAt;

  @Enumerated(EnumType.STRING)
  private ProcessType processType;

  private String remark;

  // 项目类型
//  @Enumerated(EnumType.STRING)
//  private ProjectType projectType;

  // 合作类型
//  @Enumerated(EnumType.STRING)
//  private CooperationType cooperationType;
}
