package com.cf.imes.module.executor.controller.admin.manage.parts.vo;

import com.cf.imes.framework.common.pojo.PageParam;
import com.cf.imes.module.executor.validation.manage.parts.PartsNumberValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;

import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 查询
 */
@Schema(description = "管理后台 - 配件分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PartsPageReqVO extends PageParam {

    @Schema(description = "设计端商品ID", example = "26589")
    @Size(max = 32, message = "配件编号长度不能超过32个字符")
    private String goodsId;

    @Schema(description = "配件名称", example = "张三")
    @Size(max = 64, message = "配件名称长度不能超过64个字符")
    private String name;

    @Schema(description = "颜色")
    @Size(max = 32, message = "颜色长度不能超过32个字符")
    private String color;

    @Schema(description = "材质：颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
    @Size(max = 64, message = "材质长度不能超过64个字符")
    private String material;

    @Schema(description = "配件类型", example = "2")
    @Size(max = 32, message = "配件类型长度不能超过323个字符")
    private String category;

    @Schema(description = "配件子类", example = "2")
    @Size(max = 64, message = "配件子类长度不能超过64个字符")
    private String type;

    @Schema(description = "型号")
    @Size(max = 64, message = "配件型号长度不能超过64个字符")
    private String model;

    @Schema(description = "规格")
    @Size(max = 64, message = "配件规格不能超过64个字符")
    private String spec;

    @Schema(description = "价格")
    @PartsNumberValid(name = "价格")
    private Double[] price;

    @Schema(description = "宽度")
    @PartsNumberValid(name = "宽度")
    private Double[] width;

    @Schema(description = "长度")
    @PartsNumberValid(name = "长度")
    private Double[] length;

    @Schema(description = "厚度")
    @PartsNumberValid(name = "厚度")
    private Double[] thickness;

    @Schema(description = "品牌")
    @Size(max = 64, message = "配件品牌不能超过64个字符")
    private String brand;

    @Schema(description = "厂家")
    @Size(max = 128, message = "厂家长度不能超过64个字符")
    private String factory;

    @Schema(description = "单位")
    @Size(max = 32, message = "单位长度不能超过64个字符")
    private String unit;

    @Schema(description = "是否复合部件：0 否 1 是")
    private Boolean isComposite;

    @Schema(description = "子配件ID列表,复合部件时记录子配件ID,半角逗号分隔", example = "你说的对")
    @Size(max = 255, message = "子配件列表长度不能超过255个字符")
    private String subparts;

    @Schema(description = "备注", example = "你说的对")
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    private Long organId;

    @Schema(description = "排序", example = "ascend")
    private String order;

    @Schema(description = "排序字段", example = "id")
    private String field;

}
