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

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cf.imes.framework.common.validation.NumberValid;
import com.cf.imes.framework.excel.core.annotations.DictFormat;
import com.cf.imes.framework.excel.core.convert.DictConvert;
import com.cf.imes.module.executor.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "管理后台 - 配件 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PartsRespVO {

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

    @Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26589")
    @ExcelProperty("配件编号")
    private String goodsId;

    @Schema(description = "是否复合部件：0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否复合部件", converter = DictConvert.class)
    @DictFormat(DictTypeConstants.BOOLEAN_STRING)
    private Boolean isComposite;

    @Schema(description = "子配件ID列表,复合部件时记录子配件ID,半角逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
//    @ExcelProperty("子配件ID列表")
    @ExcelIgnore
    private String subparts;

    @Schema(description = "配件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @ExcelProperty("配件类型")
    @DictFormat(DictTypeConstants.PART_CATEGORY)
    private String category;

    @Schema(description = "配件子类", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @ExcelProperty("配件子类")
    private String type;

    @Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("配件名称")
    private String name;

    @Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("型号")
    private String model;

    @Schema(description = "材质：颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("材质")
    private String material;

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

    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("单位")
    private String unit;

    @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("规格")
    private String spec;

    @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("品牌")
    private String brand;

    @Schema(description = "厂家", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("厂家")
    private String factory;


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

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

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

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

    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}