package com.njcn.rdms.module.project.controller.admin.overtime.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Schema(description = "管理后台 - 业务学习批量审批结果 Response VO")
@Data
public class OvertimeApplicationBatchResultRespVO {

    @Schema(description = "成功处理的数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
    private Integer successCount;

    @Schema(description = "失败的数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer failCount;

    @Schema(description = "失败的业务学习编号列表")
    private List<FailItem> failItems = new ArrayList<>();

    @Data
    @Schema(description = "批量审批失败项")
    public static class FailItem {

        @Schema(description = "业务学习编号", example = "3")
        @JsonSerialize(using = ToStringSerializer.class)
        private Long id;

        @Schema(description = "失败原因", example = "当前状态不允许该操作")
        private String reason;

    }

}
