package com.cf.imes.module.plan.controller.admin.orderimport.webcad.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 *
 *
 * @author Gqr
 * @since 2026/1/29 15:18
 */
@NoArgsConstructor
@Schema(description = "管理后台 - webcad部件分组 - RequestVO")
@Data
public class WebCadDataComponentGroupReqVO {
    /**
     * 组ID
     */
    @JsonProperty("groupID")
    private Integer groupId;

    /**
     * 部件名称
     */
    private String name;

    @Valid
    private BoxSizeDTO boxSize = new BoxSizeDTO();

    @Valid
    private List<WebCadDataComponentGroupReqVO> children = new ArrayList<>();

    @NoArgsConstructor
    @Data
    public static class BoxSizeDTO {
        @Max(value = 99999, message = "部件宽度不能超过99999")
        @Min(value = 0, message = "部件宽度最小值为0")
        private Double width;

        @Max(value = 99999, message = "部件高度不能超过99999")
        @Min(value = 0, message = "部件高度最小值为0")
        private Double height;

        @Max(value = 99999, message = "部件深度不能超过99999")
        @Min(value = 0, message = "部件深度最小值为0")
        private Double depth;
    }
}
