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

import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.List;

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

/**
 * 工作任务 创建 Request VO
 *
 * @author yj
 */
@Schema(description = "管理后台 - 工作任务分配 Request VO")
@Data
public class BpmOAWorkTaskReqVO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long id;

    @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "任务名称不能为空")
    private String taskName;

    @Schema(description = "任务内容", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "任务内容不能为空")
    private String taskContent;

    @Schema(description = "任务级别", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "任务级别不能为空")
    private Integer level;

    @Schema(description = "任务的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "截止时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startTime;

    @Schema(description = "任务的截止时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "截止时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endTime;

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

    @Schema(description = "任务进度百分比", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long schedule ;

    @Schema(description = "工作任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1:待启动，2:进行中，3.已完成，4.延期, 5.搁置")
    private Integer workTaskStatus ;

    @Schema(description = "搁置或延期原因")
    private String reason;

    @Schema(description = "搁置后 任务开始日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate shelveStartTime;

    @Schema(description = "搁置后 任务结束日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate shelveEndTime;

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

    @Schema(description = "跟踪内容集合")
    private BpmOAWorkTaskTrackInfo trackInfos;
}
