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

import com.njcn.rdms.module.project.dal.dataobject.attachment.AttachmentItem;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 管理后台 - 产品需求拆分 Request VO
 */
@Schema(description = "管理后台 - 产品需求拆分 Request VO")
@Data
public class ProductRequirementSplitReqVO {

    @Schema(description = "父需求ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "父需求编号不能为空")
    private Long parentId;

    @Schema(description = "所属产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "产品编号不能为空")
    private Long productId;

    @Schema(description = "所属模块ID，为空时归入全部需求模块", example = "1024")
    private Long moduleId;

    @Schema(description = "是否需要评审，0不需要，1需要", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    @NotNull(message = "是否需要评审不能为空")
    private Integer reviewRequired;

    @Schema(description = "需求标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "支持需求模块化管理")
    @NotBlank(message = "需求标题不能为空")
    @Size(max = 200, message = "需求标题长度不能超过200个字符")
    private String title;

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

    @Schema(description = "需求分类字典值", requiredMode = Schema.RequiredMode.REQUIRED, example = "function")
    @NotBlank(message = "需求分类不能为空")
    @Size(max = 64, message = "需求分类长度不能超过64个字符")
    private String category;

    @Schema(description = "优先级，0低、1中、2高、3紧急", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "优先级不能为空")
    private Integer priority;

    @Schema(description = "提出人用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "提出人不能为空")
    private Long proposerId;

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

    @Schema(description = "预期完成时间", example = "2026-05-31")
    private LocalDate expectedTime;

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

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

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

    @Schema(description = "排序值，越小越靠前", example = "0")
    private Integer sort;

    @Schema(description = "附件列表")
    @Valid
    private List<AttachmentItem> attachments;

}
