public function handle(CreateProductQuantityDiscountCommand $command) { $product = $this->productService->findOneById($command->getProductId()); $productQuantityDiscount = new ProductQuantityDiscount($product, $command->getProductQuantityDiscountId()); $productQuantityDiscount->setType(PromotionType::createById($command->getPromotionTypeId())); $productQuantityDiscount->setValue($command->getValue()); $productQuantityDiscount->setReducesTaxSubtotal($command->getReducesTaxSubtotal()); $productQuantityDiscount->setMaxRedemptions($command->getMaxRedemptions()); $productQuantityDiscount->setStart($command->getStartDate()); $productQuantityDiscount->setEnd($command->getEndDate()); $productQuantityDiscount->setQuantity($command->getQuantity()); $productQuantityDiscount->setFlagApplyCatalogPromotions($command->getFlagApplyCatalogPromotions()); $this->productService->createProductQuantityDiscount($productQuantityDiscount); }