package com.yhy.module.core.controller.admin.infoprice.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Map;

@Schema(description = "管理后台 - 信息价工料机信息创建/更新 Request VO")
@Data
public class InfoPriceResourceSaveReqVO {

    @Schema(description = "主键", example = "1")
    private Long id;

    @Schema(description = "分类树节点ID（创建时必填，更新时可选）", example = "1")
    private Long categoryTreeId;

    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "RES001")
    @NotBlank(message = "编码不能为空")
    private String code;

    @Schema(description = "名称（用于查找或创建工料机）", requiredMode = Schema.RequiredMode.REQUIRED, example = "水泥")
    @NotBlank(message = "名称不能为空")
    private String name;

    @Schema(description = "型号规格（用于查找或创建工料机）", example = "P.O 42.5")
    private String spec;

    @Schema(description = "单位（用于查找或创建工料机）", requiredMode = Schema.RequiredMode.REQUIRED, example = "t")
    @NotBlank(message = "单位不能为空")
    private String unit;

    @Schema(description = "除税编制价", example = "450.00")
    private BigDecimal priceTaxExcl;

    @Schema(description = "税率", example = "0.09")
    private BigDecimal taxRate;

    @Schema(description = "含税编制价", example = "490.50")
    private BigDecimal priceTaxIncl;

    @Schema(description = "图样（文件地址）", example = "http://example.com/drawing.pdf")
    private String drawingUrl;

    @Schema(description = "分类ID", example = "1")
    private Long categoryId;

    @Schema(description = "源工料机ID（用于复制价格历史）", example = "1")
    private Long sourceResourceItemId;

    @Schema(description = "备注", example = "备注信息")
    private String remark;

    @Schema(description = "扩展属性", example = "{}")
    private Map<String, Object> attributes;

}
