package cn.iocoder.yudao.module.mes.controller.admin.bom.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 产品BOM Response VO")
@Data
@ExcelIgnoreUnannotated
public class BomRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23849")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "BOM编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("BOM编码")
    private String code;

    @Schema(description = "BOM版本", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("BOM版本")
    private String version;

    @Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5633")
    @ExcelProperty("产品ID")
    private Long productId;
    @Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
    @ExcelProperty("产品")
    private String productName;

    @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24261")
    private Long unitId;
    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "个")
    @ExcelProperty("单位")
    private String unitName;

    @Schema(description = "成品率%")
    @ExcelProperty("成品率%")
    private BigDecimal yieldRate;

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

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否启用", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean isEnable;

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

}