package de.effigenix.infrastructure.inventory.web.dto;

import de.effigenix.domain.inventory.StockBatchAllocation;

import java.math.BigDecimal;

public record StockBatchAllocationResponse(
        String stockBatchId,
        BigDecimal allocatedQuantityAmount,
        String allocatedQuantityUnit
) {

    public static StockBatchAllocationResponse from(StockBatchAllocation allocation) {
        return new StockBatchAllocationResponse(
                allocation.stockBatchId().value(),
                allocation.allocatedQuantity().amount(),
                allocation.allocatedQuantity().uom().name()
        );
    }
}
