public function start(?string $groupCode = null): void 	{ 		$productsCollection = collect($this->getProducts());// get all products from erp 		// $prices = collect($this->getPrices());// get price list from erp 		$stock = collect($this->getStock());// get product stock from erp from different shops 		$categories = $this->getCategories(); // get all categories from erp  		foreach ($productsCollection as $item) { 			try { 				$code = $item['ProductCode'];  				if ($product = Product::with('variants')->where('code', $code)->first()) { // find if product with this code exists in db 					$productInStock = $stock->where('ProductCode', $item['ProductCode'])->where('StoreCode', '011')->first();	// find that product in stock collection 					$productInPriceList = $productInStock; // $prices->firstWhere('ProductCode', $item['ProductCode'])  					$quantity = $productInStock['Quantity'] ?? 0;  					if (isset($productInPriceList['Price']) && $productInPriceList['Price'] > 0) { // price exists in erp, continue updating product 						$price = $productInPriceList['Price'];  						try { 							$unitOfMeasureValueObject = PriceFromPricePerMeasureUnitFactory::make($product->unit_of_measure, $price, $product->alternative_unit_of_measure, $product->conversion_to_quantity, $product->weight); 						} catch (Exception) { 							continue; 						}  						$result = $unitOfMeasureValueObject->getPrices();  						$validator = Validator::make([ 							'price' => $result->getPrice(), 							'price_per_unit_of_measure' => $result->getPricePerUnitOfMeasure(), 							'quantity' => $quantity,  						], [ 							'price' => ['required', 'numeric'], 							'price_per_unit_of_measure' => ['nullable', 'numeric'], 							'quantity' => ['required', 'numeric'],  						]);  						if ($validator->fails()) { 							$this->failedSyncItemsCount++; 							$this->failedSyncs['items'][$item['ProductCode']] = $validator->errors();  							continue; 						}  						// @var Product $product 						$product->update([ 							'price' => $result->getPrice(), 							'price_per_unit_of_measure' => $result->getPricePerUnitOfMeasure(), 							'quantity' => $product->shouldUpdateStock() ? $quantity : $product->quantity,  						]);  						foreach ($product->variants as $variant) { 							$variant->update([ 								'price' => round((float) MathMoneyOperations::calculate($variant->weight, $result->getPricePerUnitOfMeasure(), '*'), 2), 							]); 						} 					} else {	// epr does not have price for the product, so leave prices how they are and update only quantity 						$validator = Validator::make([ 							'quantity' => $quantity,  						], [ 							'quantity' => ['required', 'numeric'], 						]);  						if ($validator->fails()) { 							$this->failedSyncItemsCount++; 							$this->failedSyncs['items'][$item['ProductCode']] = $validator->errors();  							continue; 						}  						// @var Product $product 						$product->update([ 							'quantity' => $product->shouldUpdateStock() ? $quantity : $product->quantity,  						]); 					} 					$this->syncedItemsCount++; 				} else { // product with code was not found in database and it should be created and set to active=false 					$productCode = $code;  					$productInStock = $stock->where('ProductCode', $item['ProductCode'])->where('StoreCode', '011')->first(); 					$productInPriceList = $productInStock; // $prices->firstWhere('ProductCode', $productCode)  					$name = $item['ProductName']; 					$slug = Product::generateSlug($name); 					$price = $productInPriceList['Price'] ?? 0; 					$quantity = $productInStock['Quantity'] ?? 0; 					$category_id = $categories->firstWhere('group_code', $item['ProductGroupCode'])['id'] ?? null; 					$weight = $item['ProductWeight'] ?? 0; 					$type = Product::REGULAR_PRODUCT; 					$unit_of_measure = array_search($item['UnitOfMeasure'] ?? null, Product::getMeasureUnites()); 					$alternative_unit_of_measure = isset($item['AlternativeUnitOfMeasure']) ? array_search($item['AlternativeUnitOfMeasure'], Product::getAlternativeMeasureUnites()) : null; 					$conversion_to_quantity = $item['ConversionToQuantity'] ?? null;  					try { 						$unitOfMeasureValueObject = PriceFromPricePerMeasureUnitFactory::make($unit_of_measure, $price, $alternative_unit_of_measure, $conversion_to_quantity, $weight); 					} catch (Exception) { 						continue; 					}  					$result = $unitOfMeasureValueObject->getPrices();  					$validator = $this->createValidatorInstance($name, $slug, $result->getPrice(), $quantity, $category_id, $weight, $type, $unit_of_measure, $productCode, $result->getPricePerUnitOfMeasure(), $alternative_unit_of_measure, $conversion_to_quantity);  					if ($validator->fails()) { 						$this->failedImportsCount++; 						$this->failedImports['items'][$item['ProductName']] = $validator->errors();  						continue; 					}  					/** 					 * @var Product $product 					 */ 					$product = $this->updateOrCreateItem($name, $slug, $result->getPrice(), $quantity, $category_id, $weight, $type, $unit_of_measure, $productCode, $result->getPricePerUnitOfMeasure(), $alternative_unit_of_measure, $conversion_to_quantity);  					$category_id = $categories->firstWhere('group_code', $item['ProductGroupCode'] ?? null)['id'] ?? null; // check if category with erp product category code exists in db  					if ($category_id) { 						$this->updateCategoryRelation($product, $category_id); 					}  					$this->importedItemsCount++; 				} 			} catch (Throwable $e) { 				info($e->getMessage());  				continue; 			} 		} 		$this->logStatistics(); 	}