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

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;

@Data
public class ResourceItemSaveReqVO {

    @Schema(description = "资源项ID，创建为空，更新必填")
    private Long id;

    @Schema(description = "库条目ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull
    private Long catalogItemId;

    @Schema(description = "工料机名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    private String name;

    @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull
    private Long categoryId;

    @Schema(description = "类型 labor/material/machine", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    private String type;

    @Schema(description = "单位")
    private String unit;
    
    @Schema(description = "税率（默认0.09）")
    private java.math.BigDecimal taxRate;
    
    @Schema(description = "除税基价")
    private java.math.BigDecimal taxExclBasePrice;
    
    @Schema(description = "含税基价")
    private java.math.BigDecimal taxInclBasePrice;
    
    @Schema(description = "除税编制价")
    private java.math.BigDecimal taxExclCompilePrice;
    
    @Schema(description = "含税编制价")
    private java.math.BigDecimal taxInclCompilePrice;
    
    @Schema(description = "计算基数（当单位为%时使用）", example = "{\"formula\":\"人机 + 材\",\"variables\":{\"人机\":2,\"材\":3}}")
    private Map<String, Object> calcBase;
    
    @Schema(description = "复合数据标识符（0=普通，1=复合）")
    private Integer isMerged;

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

    @Schema(description = "工料机机类树节点ID")
    private Long categoryTreeId;
}
