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

import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Data;

/**
 * 工作台工料机消耗 创建/更新 Request VO
 */
@Schema(description = "工作台 - 工料机消耗创建/更新 Request VO")
@Data
public class WbBoqResourceSaveReqVO {

    @Schema(description = "ID（更新时必填）", example = "1")
    private Long id;

    @Schema(description = "关联定额节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "定额节点ID不能为空")
    private Long divisionId;

    @Schema(description = "引用工料机ID", example = "1")
    private Long sourceResourceItemId;

    @Schema(description = "引用定额工料机组成ID", example = "1")
    private Long sourceQuotaResourceId;

    @Schema(description = "类型：labor-人工, material-材料, machine-机械", example = "material")
    @Size(max = 20, message = "类型长度不能超过20个字符")
    private String resourceType;

    @Schema(description = "编码", example = "C001")
    @Size(max = 50, message = "编码长度不能超过50个字符")
    private String code;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "水泥")
    @NotBlank(message = "名称不能为空")
    @Size(max = 200, message = "名称长度不能超过200个字符")
    private String name;

    @Schema(description = "规格型号", example = "P.O 42.5")
    @Size(max = 500, message = "规格型号长度不能超过500个字符")
    private String spec;

    @Schema(description = "单位", example = "t")
    @Size(max = 20, message = "单位长度不能超过20个字符")
    private String unit;

    @Schema(description = "消耗量", example = "0.5")
    private BigDecimal consumeQty;

    @Schema(description = "调整消耗量（用户手动覆写，null表示使用原始逻辑值）", example = "0.6")
    private BigDecimal adjustConsumeQty;

    @Schema(description = "调整系数", example = "1.0")
    private BigDecimal adjustRate;

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

    @Schema(description = "除税基价", example = "450.00")
    private BigDecimal taxExclBasePrice;

    @Schema(description = "含税基价", example = "490.50")
    private BigDecimal taxInclBasePrice;

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

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

    @Schema(description = "用量", example = "10.00")
    private BigDecimal usageQty;
}
