Search in sources :

Example 1 with GroupBuilder

use of de.metas.ui.web.material.adapter.AvailableToPromiseResultForWebui.Group.GroupBuilder in project metasfresh-webui-api by metasfresh.

the class AvailableToPromiseAdapter method createClientResultGroup0.

private Group createClientResultGroup0(final ResultGroup commonsResultGroup) {
    final GroupBuilder groupBuilder = Group.builder().productId(commonsResultGroup.getProductId());
    final Quantity quantity = Quantity.of(commonsResultGroup.getQty(), retrieveStockingUOM(commonsResultGroup.getProductId()));
    groupBuilder.qty(quantity);
    final AttributesKey attributesKey = commonsResultGroup.getStorageAttributesKey();
    final Type type = extractType(attributesKey);
    groupBuilder.type(type);
    if (type == Type.ATTRIBUTE_SET) {
        final List<I_M_AttributeValue> attributevalues = extractAttributeSetFromStorageAttributesKey(attributesKey);
        groupBuilder.attributeValues(attributevalues);
    }
    return groupBuilder.build();
}
Also used : Type(de.metas.ui.web.material.adapter.AvailableToPromiseResultForWebui.Group.Type) AttributesKey(de.metas.material.event.commons.AttributesKey) GroupBuilder(de.metas.ui.web.material.adapter.AvailableToPromiseResultForWebui.Group.GroupBuilder) Quantity(de.metas.quantity.Quantity) I_M_AttributeValue(org.compiere.model.I_M_AttributeValue)

Aggregations

AttributesKey (de.metas.material.event.commons.AttributesKey)1 Quantity (de.metas.quantity.Quantity)1 GroupBuilder (de.metas.ui.web.material.adapter.AvailableToPromiseResultForWebui.Group.GroupBuilder)1 Type (de.metas.ui.web.material.adapter.AvailableToPromiseResultForWebui.Group.Type)1 I_M_AttributeValue (org.compiere.model.I_M_AttributeValue)1