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

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

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 定额工料机组成 Response VO
 * 
 * @author yhy
 */
@Schema(description = "管理后台 - 定额工料机组成 Response VO")
@Data
public class QuotaResourceRespVO {

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

    @Schema(description = "定额子目ID", example = "1")
    private Long quotaItemId;

    @Schema(description = "资源项ID", example = "1")
    private Long resourceItemId;

    @Schema(description = "定额消耗量", example = "350.00")
    private BigDecimal dosage;

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

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    // ========== 扩展字段 ==========

    @Schema(description = "损耗率", example = "0.02")
    private BigDecimal lossRate;

    @Schema(description = "价格快照", example = "50.00")
    private BigDecimal price;

    @Schema(description = "资源编码快照", example = "R001")
    private String resourceCode;

    @Schema(description = "资源名称快照", example = "水泥")
    private String resourceName;

    @Schema(description = "资源单位快照", example = "kg")
    private String resourceUnit;

    @Schema(description = "实际消耗量（含损耗）", example = "357.00")
    private BigDecimal actualDosage;

    @Schema(description = "金额", example = "17850.00")
    private BigDecimal amount;
}
