use of de.metas.inoutcandidate.api.ShipmentScheduleUserChangeRequest.ShipmentScheduleUserChangeRequestBuilder in project metasfresh-webui-api by metasfresh.
the class ShipmentCandidateRow method createShipmentScheduleUserChangeRequest.
Optional<ShipmentScheduleUserChangeRequest> createShipmentScheduleUserChangeRequest() {
final ShipmentScheduleUserChangeRequestBuilder builder = ShipmentScheduleUserChangeRequest.builder().shipmentScheduleId(shipmentScheduleId);
boolean changes = false;
if (qtyToDeliverUserEnteredInitial.compareTo(qtyToDeliverUserEntered) != 0) {
BigDecimal qtyCUsToDeliver = packingInfo.computeQtyCUsByQtyUserEntered(qtyToDeliverUserEntered);
builder.qtyToDeliverStockOverride(qtyCUsToDeliver);
changes = true;
}
if (qtyToDeliverCatchOverrideIsChanged()) {
builder.qtyToDeliverCatchOverride(qtyToDeliverCatchOverride);
changes = true;
}
final AttributeSetInstanceId asiId = asi.getIdAs(AttributeSetInstanceId::ofRepoIdOrNone);
if (!Objects.equals(asiIdInitial, asiId)) {
builder.asiId(asiId);
changes = true;
}
return changes ? Optional.of(builder.build()) : Optional.empty();
}
Aggregations