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 jakarta.validation.Valid;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

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

@Schema(description = "管理后台 - 个人事项保存 Request VO")
@Data
public class PersonalItemSaveReqVO {

    @Schema(description = "执行编号，仅用于创建/编辑时补充执行成员合法性校验", example = "5001")
    private Long executionId;

    @Schema(description = "个人事项标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "整理供应商沟通纪要")
    @NotBlank(message = "个人事项标题不能为空")
    @Size(max = 300, message = "个人事项标题长度不能超过300个字符")
    private String taskTitle;

    @Schema(description = "个人事项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "todo")
    @NotBlank(message = "个人事项类型不能为空")
    @Size(max = 32, message = "个人事项类型长度不能超过32个字符")
    private String type;

    @Schema(description = "个人事项进度（0~100）", example = "60.00")
    @DecimalMin(value = "0.00", message = "个人事项进度不能小于 0")
    @DecimalMax(value = "100.00", message = "个人事项进度不能大于 100")
    private BigDecimal progressRate;

    @Schema(description = "计划开始日期", example = "2026-05-20")
    private LocalDate plannedStartDate;

    @Schema(description = "计划结束日期", example = "2026-05-25")
    private LocalDate plannedEndDate;

    @Schema(description = "个人事项说明（富文本 HTML）")
    private String taskDesc;

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