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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

import static com.njcn.rdms.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 项目半月报保存 Request VO")
@Data
public class ProjectReportSaveReqVO {

    @NotNull(message = "项目编号不能为空")
    private Long projectId;

    @NotBlank(message = "周期编码不能为空")
    private String periodKey;

    @NotBlank(message = "周期名称不能为空")
    private String periodLabel;

    @NotNull(message = "周期开始日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate periodStartDate;

    @NotNull(message = "周期结束日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate periodEndDate;

    @NotNull(message = "上半月/下半月标记不能为空")
    private Integer flag;

    private String projectStatusDesc;

    private String projectProgressPlan;

    private String projectKeyPoints;

    private String projectProblems;

    @Valid
    private List<ProjectReportItemReqVO> currentItems;

    @Valid
    private List<ProjectReportItemReqVO> nextItems;
}
