package com.zt.plat.module.base.api.materialinfomation.dto;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Map;

/**
 * 物料信息精简 Response DTO
 */
@Data
public class MaterialInfomationSimpleRespDTO {

    @JsonIgnore
    @Schema(description = "物料信息ID", example = "1024")
    private Long id;

    @JsonIgnore
    @Schema(description = "物料编码")
    private String code;

    @JsonIgnore
    @Schema(description = "物料名称")
    private String name;

    @JsonIgnore
    @Schema(description = "分类ID")
    private Long classesId;

    @JsonIgnore
    @Schema(description = "备注")
    private String remark;

    @JsonIgnore
    @Schema(description = "物料基础字段 + 属性编码->原值的动态键值，基础字段优先，序列化时直接展开为顶层字段")
    private Map<String, Object> flatAttributes;

    @JsonAnyGetter
    public Map<String, Object> getFlatAttributes() {
        return flatAttributes;
    }
}