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

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

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 执行 Response VO")
@Data
public class ProjectExecutionRespVO {

    @Schema(description = "执行编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5001")
    private Long id;
    @Schema(description = "所属项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2001")
    private Long projectId;
    @Schema(description = "关联项目需求编号")
    private Long projectRequirementId;
    @Schema(description = "关联项目需求名称（service 层批量回填，避免 N+1）", example = "前端联调-需求A")
    private String projectRequirementName;
    @Schema(description = "关联项目需求状态编码（service 层批量回填）", example = "implementing")
    private String projectRequirementStatusCode;
    @Schema(description = "执行名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "后端接口联调")
    private String executionName;
    @Schema(description = "执行类型", example = "feature")
    private String executionType;
    @Schema(description = "执行负责人用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3001")
    private Long ownerId;
    @Schema(description = "执行负责人昵称", example = "张三")
    private String ownerNickname;
    @Schema(description = "执行状态编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "pending")
    private String statusCode;
    @Schema(description = "执行状态名称", example = "待开始")
    private String statusName;
    @Schema(description = "优先级编码（字典 rdms_req_priority），0=P0(最高) ~ 3=P3(最低)", example = "0")
    private String priority;
    @Schema(description = "优先级名称（字典 label，后端不填、前端按字典 cache 自译）", example = "P0")
    private String priorityName;
    @Schema(description = "是否终态", example = "false")
    private Boolean terminal;
    @Schema(description = "当前状态是否允许编辑", example = "true")
    private Boolean allowEdit;
    @Schema(description = "当前状态可执行动作")
    private List<ProjectExecutionLifecycleActionRespVO> availableActions;
    @Schema(description = "计划开始日期")
    private LocalDate plannedStartDate;
    @Schema(description = "计划结束日期")
    private LocalDate plannedEndDate;
    @Schema(description = "实际开始日期")
    private LocalDate actualStartDate;
    @Schema(description = "实际结束日期")
    private LocalDate actualEndDate;
    @Schema(description = "执行进度")
    private BigDecimal progressRate;
    @Schema(description = "执行说明")
    private String executionDesc;
    @Schema(description = "最近一次状态动作原因")
    private String lastStatusReason;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime updateTime;

}
