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

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 static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 请假申请 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class BpmOALeaveRespVO extends BpmOALeaveBaseVO {

    @Schema(description = "请假表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long id;

    @Schema(description = "假期名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private String leaveName;

    @Schema(description = "请假时长（单位根据请假最小单位来 按天or按半天 单位为天 按小时单位为小时）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private BigDecimal duration;

    @Schema(description = "请假最小单位 1按天 2按半天 3按小时", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Integer minUnit;

    @Schema(description = "开始时间额外字段 根据请假最小单位来 1按天则为空 2按半天则1为上午 2为下午 3按小时则 格式为 HH:mm", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private String startTimeExtraFields;

    @Schema(description = "结束时间额外字段 根据请假最小单位来 1按天则为空 2按半天则1为上午 2为下午 3按小时则 格式为 HH:mm", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private String endTimeExtraFields;

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

    @Schema(description = "申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "申请时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime createTime;

    @Schema(description = "流程id")
    private String processInstanceId;

}
