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

import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 单价构成计算结果
 * 
 * 用于定额单价计算中的第4-5层：取费项子单价计算结果
 * 
 * @author yhy
 */
@Schema(description = "工作台 - 单价构成计算结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FeeItemPriceResult {

    @Schema(description = "取费项ID", example = "1")
    private Long feeItemId;

    @Schema(description = "取费项代号", example = "RGF")
    private String code;

    @Schema(description = "取费项名称", example = "人工费")
    private String name;

    @Schema(description = "计算基数配置（原始配置）")
    private Map<String, Object> calcBase;

    @Schema(description = "计算基数值（公式计算结果）", example = "100.00")
    private BigDecimal calcBaseValue;

    @Schema(description = "费率代号", example = "10")
    private String rateCode;

    @Schema(description = "费率百分比", example = "10.00")
    private BigDecimal ratePercent;

    @Schema(description = "子单价（= 计算基数值 × 费率% / 100）", example = "10.00")
    private BigDecimal subPrice;

    @Schema(description = "是否为综合单价行", example = "false")
    private Boolean isTotal;

    @Schema(description = "计算公式（调试用，显示变量替换后的公式）", example = "100.00 + 50.00")
    private String evaluatedFormula;

    @Schema(description = "错误信息（如果计算失败）")
    private String errorMessage;
}
