-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on hello@bitbag.io. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator; | ||
|
||
use BitBag\SyliusProductBundlePlugin\Entity\OrderItemInterface; | ||
use BitBag\SyliusProductBundlePlugin\Entity\ProductInterface; | ||
use BitBag\SyliusProductBundlePlugin\Inventory\Checker\FeatureFlagCheckerInterface; | ||
use Doctrine\DBAL\LockMode; | ||
use Doctrine\ORM\EntityManagerInterface; | ||
use Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException; | ||
use Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException; | ||
use Sylius\Component\Core\Inventory\Operator\OrderInventoryOperatorInterface; | ||
use Sylius\Component\Core\Model\OrderInterface; | ||
use Sylius\Component\Core\Model\OrderItemInterface as BaseOrderItemInterface; | ||
use Sylius\Component\Core\Model\ProductVariantInterface; | ||
use Sylius\Component\Core\OrderPaymentStates; | ||
|
||
final class OrderInventoryOperator implements OrderInventoryOperatorInterface | ||
{ | ||
public function __construct( | ||
private readonly OrderInventoryOperatorInterface $decorated, | ||
private readonly FeatureFlagCheckerInterface $featureFlagChecker, | ||
private readonly EntityManagerInterface $productVariantManager, | ||
private readonly ProductBundleOrderInventoryOperatorInterface $productBundleOrderInventoryOperator, | ||
) { | ||
} | ||
|
||
//TODO | ||
public function cancel(OrderInterface $order): void | ||
{ | ||
$this->lockOrderProductVariants($order); | ||
|
||
if (!$this->featureFlagChecker->isEnabled()) { | ||
$this->decorated->cancel($order); | ||
} | ||
|
||
if (in_array( | ||
$order->getPaymentState(), | ||
[OrderPaymentStates::STATE_PAID, OrderPaymentStates::STATE_REFUNDED], | ||
true, | ||
)) { | ||
$this->giveBack($order); | ||
|
||
return; | ||
} | ||
|
||
$this->release($order); | ||
} | ||
|
||
public function hold(OrderInterface $order): void | ||
{ | ||
if (!$this->featureFlagChecker->isEnabled()) { | ||
$this->decorated->hold($order); | ||
} | ||
|
||
$this->lockOrderProductVariants($order); | ||
|
||
//TODO figure out how to split handling bundles and products without copy-pasted code | ||
$this->productBundleOrderInventoryOperator->hold($order); | ||
} | ||
|
||
//TODO | ||
public function sell(OrderInterface $order): void | ||
{ | ||
$this->lockOrderProductVariants($order); | ||
|
||
if (!$this->featureFlagChecker->isEnabled()) { | ||
$this->decorated->sell($order); | ||
} | ||
|
||
/** @var BaseOrderItemInterface $orderItem */ | ||
foreach ($order->getItems() as $orderItem) { | ||
$variant = $orderItem->getVariant(); | ||
|
||
if (!$variant->isTracked()) { | ||
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
|
||
continue; | ||
} | ||
|
||
if (($variant->getOnHold() - $orderItem->getQuantity()) < 0) { | ||
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
|
||
throw new NotEnoughUnitsOnHoldException($variant->getName()); | ||
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
|
||
} | ||
|
||
if (($variant->getOnHand() - $orderItem->getQuantity()) < 0) { | ||
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
|
||
throw new NotEnoughUnitsOnHandException($variant->getName()); | ||
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4
|
||
} | ||
|
||
$variant->setOnHold($variant->getOnHold() - $orderItem->getQuantity()); | ||
$variant->setOnHand($variant->getOnHand() - $orderItem->getQuantity()); | ||
} | ||
} | ||
|
||
/** | ||
* @throws \InvalidArgumentException | ||
*/ | ||
//TODO | ||
private function release(OrderInterface $order): void | ||
{ | ||
/** @var BaseOrderItemInterface $orderItem */ | ||
foreach ($order->getItems() as $orderItem) { | ||
$variant = $orderItem->getVariant(); | ||
|
||
if (!$variant->isTracked()) { | ||
continue; | ||
} | ||
|
||
if (($variant->getOnHold() - $orderItem->getQuantity()) < 0) { | ||
throw new NotEnoughUnitsOnHoldException($variant->getName()); | ||
} | ||
|
||
$variant->setOnHold($variant->getOnHold() - $orderItem->getQuantity()); | ||
} | ||
} | ||
|
||
//TODO | ||
private function giveBack(OrderInterface $order): void | ||
{ | ||
/** @var BaseOrderItemInterface $orderItem */ | ||
foreach ($order->getItems() as $orderItem) { | ||
$variant = $orderItem->getVariant(); | ||
|
||
if (!$variant->isTracked()) { | ||
continue; | ||
} | ||
|
||
$variant->setOnHand($variant->getOnHand() + $orderItem->getQuantity()); | ||
} | ||
} | ||
|
||
private function lockOrderProductVariants(OrderInterface $order): void | ||
{ | ||
/** @var OrderItemInterface $orderItem */ | ||
foreach ($order->getItems() as $orderItem) { | ||
$this->lockOrderItemProductVariants($orderItem); | ||
} | ||
} | ||
|
||
private function lockOrderItemProductVariants(OrderItemInterface $orderItem): void | ||
{ | ||
/** @var ProductInterface $product */ | ||
$product = $orderItem->getProduct(); | ||
if ($product->isBundle()) { | ||
$this->lockBundledOrderItemProductVariants($orderItem); | ||
} else { | ||
$this->lockOrderItemProductVariant($orderItem); | ||
} | ||
} | ||
|
||
private function lockOrderItemProductVariant(OrderItemInterface $orderItem): void | ||
{ | ||
$this->lockProductVariant($orderItem->getVariant()); | ||
} | ||
|
||
private function lockBundledOrderItemProductVariants(OrderItemInterface $orderItem): void | ||
{ | ||
foreach ($orderItem->getProductBundleOrderItems() as $bundleOrderItem) { | ||
$this->lockProductVariant($bundleOrderItem->getProductVariant()); | ||
} | ||
} | ||
|
||
private function lockProductVariant(ProductVariantInterface $variant): void | ||
{ | ||
if (!$variant->isTracked()) { | ||
return; | ||
} | ||
|
||
$this->productVariantManager->lock($variant, LockMode::OPTIMISTIC, $variant->getVersion()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on hello@bitbag.io. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator; | ||
|
||
use BitBag\SyliusProductBundlePlugin\Entity\OrderItemInterface; | ||
use Sylius\Component\Core\Model\OrderInterface; | ||
|
||
final class ProductBundleOrderInventoryOperator implements ProductBundleOrderInventoryOperatorInterface | ||
{ | ||
public function hold(OrderInterface $order): void | ||
{ | ||
/** @var OrderItemInterface $orderItem */ | ||
foreach ($order->getItems() as $orderItem) { | ||
$this->holdBundleOrderItems($orderItem); | ||
} | ||
} | ||
|
||
public function sell(OrderInterface $order): void | ||
{ | ||
// TODO: Implement sell() method. | ||
} | ||
|
||
private function holdBundleOrderItems(OrderItemInterface $orderItem): void | ||
{ | ||
foreach ($orderItem->getProductBundleOrderItems() as $bundleOrderItem) { | ||
$quantity = $orderItem->getQuantity() * $bundleOrderItem->getQuantity(); | ||
$variant = $bundleOrderItem->getProductVariant(); | ||
|
||
if (!$variant->isTracked()) { | ||
continue; | ||
} | ||
|
||
$variant->setOnHold((int)$variant->getOnHold() + $quantity); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on hello@bitbag.io. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator; | ||
|
||
use Sylius\Component\Core\Model\OrderInterface; | ||
|
||
interface ProductBundleOrderInventoryOperatorInterface | ||
{ | ||
public function hold(OrderInterface $order): void; | ||
|
||
public function sell(OrderInterface $order): void; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<service id="bitbag_sylius_product_bundle.operator.order_inventory_operator" | ||
class="BitBag\SyliusProductBundlePlugin\Inventory\Operator\OrderInventoryOperator" | ||
decorates="sylius.custom_inventory.order_inventory_operator"> | ||
<argument type="service" id="bitbag_sylius_product_bundle.operator.order_inventory_operator.inner"/> | ||
<argument type="service" | ||
id="bitbag_sylius_product_bundle.checker.bundled_product_inventory_management_feature_flag_checker"/> | ||
<argument type="service" id="sylius.manager.product_variant"/> | ||
<argument type="service" | ||
id="bitbag_sylius_product_bundle.operator.product_bundle_order_inventory_operator"/> | ||
</service> | ||
<service id="bitbag_sylius_product_bundle.operator.product_bundle_order_inventory_operator" | ||
class="BitBag\SyliusProductBundlePlugin\Inventory\Operator\ProductBundleOrderInventoryOperator"> | ||
</service> | ||
</services> | ||
</container> |