private function calculateAdjustment(AdjustmentDataInterface $adjustment, $base)
    {
        if ($adjustment->getMode() === AdjustmentModes::MODE_PERCENT) {
            return Money::round($base * $adjustment->getAmount() / 100, $this->currency);
        }

        if ($adjustment->getMode() === AdjustmentModes::MODE_FLAT) {
            return $adjustment->getAmount();
        }

        throw new InvalidArgumentException("Unexpected adjustment mode.");
    }