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

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Schema(description = "管理后台 - 项目入口页概览统计 Response VO")
@Data
public class ProjectOverviewSummaryRespVO {

    @Schema(description = "项目状态数量，按当前启用的项目状态模型返回（兼容旧前端的过渡字段，前端改造完成后移除）")
    private Map<String, Long> statusCounts;

    @Schema(description = "「全部」口径总数 = items 各状态 count 之和（2026-06-11 起「全部」= 启用状态全集，作废/归档计入）", example = "48")
    private Long total;

    @Schema(description = "状态看板项列表，覆盖状态机全部启用状态，按 sort 升序；状态机新增启用状态自动进入清单")
    private List<StatusBoardItemVO> items;

    @Schema(description = "游离项目数：未挂产品且状态属于「全部」口径（状态机启用状态全集）")
    private Long orphanCount;

    @Schema(description = "项目状态看板项")
    @Data
    public static class StatusBoardItemVO {

        @Schema(description = "状态编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "active")
        private String statusCode;
        @Schema(description = "状态名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "进行中")
        private String statusName;
        @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "12")
        private Long count;
        @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
        private Integer sort;
        @Schema(description = "是否终态", example = "false")
        private Boolean terminal;
        @Schema(description = "是否计入「全部」（当前口径无排除项，恒为 true）", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
        private Boolean includeInAll;

    }

}
