public function testCreateByIdThrowsExceptionWhenInvalid() { $this->setExpectedException(InvalidArgumentException::class); InventoryTransactionType::createById(999); }
public function handle(AdjustInventoryCommand $command) { $product = $this->productService->findOneById($command->getProductId()); $this->inventoryService->adjustInventory($product, $command->getQuantity(), $command->getInventoryLocationId(), InventoryTransactionType::createById($command->getTransactionTypeId())); }