package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.project;

import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

/**
 * 项目申请 创建 Request VO
 *
 * @author 符溶馨
 */
@Schema(description = "管理后台 - 项目申请创建 Request VO")
@Data
@EqualsAndHashCode()
@ToString(callSuper = true)
public class BpmOAProjectCreateReqVO {

    @Schema(description = "项目类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "项目类型不能为空")
    private Integer type;

    @Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "项目名称不能为空")
    private String name;

    @Schema(description = "责任部门", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "责任部门不能为空")
    private Long responsibleDept;

    @Schema(description = "参与部门集合")
    private Set<Long> participationDept;

    @Schema(description = "责任人", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "责任人不能为空")
    private Long directorUserId;

    @Schema(description = "团队成员")
    private Set<Long> staff;

    @Schema(description = "项目开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "项目开始日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startDate;

    @Schema(description = "项目结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endDate;

    @Schema(description = "是否长期项目", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer isLongTerm;

    @Schema(description = "项目预算", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "项目预算不能为空")
    private BigDecimal projectBudget;

    @Schema(description = "项目内容", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "项目内容不能为空")
    private String content;

    @Schema(description = "项目额外属性", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Map<String, Object> dynamicAttribute;

    @Schema(description = "流程实例编号")
    private String processInstanceId;

    @Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer result;

    @Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<UploadUserFile> fileItems;
}
