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

import com.cf.imes.framework.common.validation.NumberValid;
import com.cf.imes.module.executor.validation.manage.parts.PartsCategoryValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;

@Schema(description = "管理后台 - 配件 新增/修改 Request VO")
@Data
public class PartsSaveReqVO {

    @Schema(description = "配件 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11238")
    private Long id;

    @Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26589")
    @NotEmpty(message = "设计端商品ID不能为空")
    @Size(max = 32, message = "设计端商品ID长度不能超过32个字符")
    private String goodsId;

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

    @Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
    @Size(max = 32, message = "颜色长度不能超过32个字符")
//    @NotEmpty(message = "颜色不能为空")
    private String color;

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

    @Schema(description = "配件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotEmpty(message = "配件类型不能为空")
    @Size(max = 32, message = "配件类型长度不能超过32个字符")
    @PartsCategoryValid
    private String category;

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

    @Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotEmpty(message = "型号不能为空")
    @Size(max = 64, message = "型号长度不能超过64个字符")
    private String model;

    @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
    @NumberValid(name = "价格")
    private Double price;

    @Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NumberValid(name = "宽度")
    private Double width;

    @Schema(description = "长度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NumberValid(name = "长度")
    private Double length;

    @Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NumberValid(name = "厚度")
    private Double thickness;

    @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
    @Size(max = 64, message = "规格长度不能超过64个字符")
    private String spec;

    @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
    @Size(max = 64, message = "品牌长度不能超过64个字符")
    private String brand;

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

    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotEmpty(message = "单位不能为空")
    @Size(max = 32, message = "单位长度不能超过32个字符")
    private String unit;

    @Schema(description = "是否复合部件：0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotNull(message = "是否复合部件不能为空")
    private Boolean isComposite;

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

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

    private Long organId;

}