package com.yhy.module.core.controller.admin.infoprice.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 信息价册创建/更新 Request VO")
@Data
public class InfoPriceBookSaveReqVO {

    @Schema(description = "主键", example = "1")
    private Long id;

    @Schema(description = "树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "树节点ID不能为空")
    private Long treeNodeId;

    @Schema(description = "信息价库版本号", example = "2024-v1.0")
    private String catalogVersion;

    @Schema(description = "信息价册名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024年1月信息价")
    @NotBlank(message = "信息价册名称不能为空")
    private String name;

    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
    @NotNull(message = "开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startTime;

    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-31")
    @NotNull(message = "结束时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endTime;

    @Schema(description = "发布状态", example = "published")
    private String publishStatus;

    @Schema(description = "发布时间", example = "2024-01-01 10:00:00")
    private LocalDateTime publishTime;

    @Schema(description = "附件", example = "http://example.com/file.pdf")
    private String attachment;
}
