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

import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

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

@Schema(description = "管理后台 - BPM OA 工单创建 Request VO")
@Data
public class BpmOAWorkOrderCreateReqVO {

    @Schema(description = "工单标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统登录问题")
    @NotEmpty(message = "工单标题不能为空")
    private String title;

    @Schema(description = "工单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "it_support")
    @NotEmpty(message = "工单类型不能为空")
    private String type;

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

    @Schema(description = "工单内容描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "用户无法登录系统，提示密码错误")
    @NotEmpty(message = "工单内容不能为空")
    private String content;

    @Schema(description = "期望完成时间", example = "2024-12-20 18:00:00")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime expectedTime;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<UploadUserFile> fileItems;

}
