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

import com.njcn.rdms.framework.common.pojo.PageParam;
import com.njcn.rdms.framework.dict.validation.InDict;
import com.njcn.rdms.module.system.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

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

@Schema(description = "管理后台 - 产品分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ProductPageReqVO extends PageParam {

    @Schema(description = "关键词，匹配产品编码或产品名称", example = "CNPD2026001")
    private String keyword;

    @Schema(description = "产品方向字典值", example = "direction_value")
    @InDict(type = DictTypeConstants.OBJECT_DIRECTION)
    private String directionCode;

    @Schema(description = "产品经理用户编号", example = "1024")
    private Long managerUserId;

    @Schema(description = "产品状态编码", example = "active")
    @Size(max = 32, message = "产品状态编码长度不能超过32个字符")
    private String statusCode;

    @Schema(description = "更新时间", example = "[2026-04-01 00:00:00, 2026-04-30 23:59:59]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] updateTime;

}
