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

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

import java.time.LocalDateTime;
import java.util.List;

/**
 * 管理后台 - 产品需求 Response VO
 */
@Schema(description = "管理后台 - 产品需求 Response VO")
@Data
public class ProductRequirementRespVO {

    @Schema(description = "需求ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long id;

    @Schema(description = "父需求ID（0表示顶级需求）", example = "0")
    private Long parentId;

    @Schema(description = "所属模块ID", example = "1024")
    private Long moduleId;

    @Schema(description = "是否需要评审（0不需要；1需要）", example = "0")
    private Integer reviewRequired;

    @Schema(description = "需求标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "支持需求模块化管理")
    private String title;

    @Schema(description = "需求描述（富文本）", example = "<p>详细描述需求内容</p>")
    private String description;

    @Schema(description = "需求分类字典值", requiredMode = Schema.RequiredMode.REQUIRED, example = "function")
    private String category;

    @Schema(description = "需求分类名称", example = "功能需求")
    private String categoryName;

    @Schema(description = "来源类型（manual:手工新增, work_order:工单流转）", requiredMode = Schema.RequiredMode.REQUIRED, example = "manual")
    private String sourceType;

    @Schema(description = "来源业务ID", example = "1024")
    private Long sourceBizId;

    @Schema(description = "优先级（0低 1中 2高 3紧急）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer priority;

    @Schema(description = "优先级名称", example = "中")
    private String priorityName;

    @Schema(description = "当前状态编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "pending_dispatch")
    private String statusCode;

    @Schema(description = "当前状态名称", example = "待分流")
    private String statusName;

    @Schema(description = "最近一次状态动作原因", example = "评审通过")
    private String lastStatusReason;

    @Schema(description = "提出人用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long proposerId;

    @Schema(description = "提出人用户姓名", example = "张三")
    private String proposerNickname;

    @Schema(description = "当前处理人用户编号", example = "1024")
    private Long currentHandlerUserId;

    @Schema(description = "当前处理人姓名", example = "李四")
    private String currentHandlerUserNickname;

    @Schema(description = "默认实现项目编号", example = "1024")
    private Long implementProjectId;

    @Schema(description = "实现项目名称", example = "NPQS-10086")
    private String implementProjectName;

    @Schema(description = "预期完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime completionDate;

    @Schema(description = "排序值", example = "0")
    private Integer sort;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime updateTime;

    @Schema(description = "子需求列表（树形结构）")
    private List<ProductRequirementRespVO> children;

    @Schema(description = "是否为终态（已拒绝、已取消、已关闭）", example = "false")
    private Boolean terminal;

}
