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

import com.njcn.rdms.module.project.dal.dataobject.attachment.AttachmentItem;
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 PersonalItemRespVO {

    @Schema(description = "个人事项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9001")
    private Long id;

    @Schema(description = "个人事项标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "整理供应商沟通纪要")
    private String taskTitle;

    @Schema(description = "个人事项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "todo")
    private String type;

    @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 = "是否终态", example = "false")
    private Boolean terminal;

    @Schema(description = "当前状态是否允许编辑", example = "true")
    private Boolean allowEdit;

    @Schema(description = "当前状态可执行动作")
    private List<PersonalItemLifecycleActionRespVO> availableActions;

    @Schema(description = "个人事项进度", example = "60.00")
    private BigDecimal progressRate;

    @Schema(description = "已填报工时合计（小时，0.5 颗粒）；逻辑删除的工时记录不计入。无记录默认为 0",
            example = "8.0")
    private BigDecimal totalSpentHours;

    @Schema(description = "计划开始日期")
    private LocalDate plannedStartDate;

    @Schema(description = "计划结束日期")
    private LocalDate plannedEndDate;

    @Schema(description = "实际开始日期")
    private LocalDate actualStartDate;

    @Schema(description = "实际结束日期")
    private LocalDate actualEndDate;

    @Schema(description = "个人事项说明")
    private String taskDesc;

    @Schema(description = "最近一次状态动作原因")
    private String lastStatusReason;

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

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

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