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

import cn.iocoder.yudao.module.bpm.controller.admin.upload.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.LocalDateTime;
import java.util.List;

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

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

    @Schema(description = "出差原因", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "出差事由不能为空")
    private String reason;

    @Schema(description = "出差起点", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "出差起点不能为空")
    private String startLocation;

    @Schema(description = "出差终点", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "出差终点不能为空")
    private String endLocation;

    @Schema(description = "出差的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime startTime;

    @Schema(description = "出差的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "结束时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime endTime;

    @Schema(description = "出差时长", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "出差时长不能为空")
    private BigDecimal timeLength;

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