public function duplicateCoupon(CouponInterface $coupon, DateTime $dateFrom = null)
    {
        /**
         * Creates a valid date interval given the referent Coupon.
         */
        if (null === $dateFrom) {
            $dateFrom = $this
                ->dateTimeFactory
                ->create();
        }

        $dateTo = null;
        if ($coupon->getValidTo() instanceof DateTime) {
            $interval = $coupon->getValidFrom()->diff($coupon->getValidTo());
            $dateTo = clone $dateFrom;
            $dateTo->add($interval);
        }

        /**
         * @var CouponInterface $couponGenerated
         */
        $couponGenerated = $this->couponFactory->create();
        $couponCode = $this
            ->couponCodeGenerator
            ->generate(10);

        $couponGenerated
            ->setCode($couponCode)
            ->setName($coupon->getName())
            ->setType($coupon->getType())
            ->setPrice($coupon->getPrice())
            ->setDiscount($coupon->getDiscount())
            ->setCount($coupon->getCount())
            ->setPriority($coupon->getPriority())
            ->setMinimumPurchase($coupon->getMinimumPurchase())
            ->setValidFrom($dateFrom)
            ->setValidTo($dateTo)
            ->setValue($coupon->getValue())
            ->setRule($coupon->getRule())
            ->setEnforcement($coupon->getEnforcement())
            ->setEnabled(true);

        return $couponGenerated;
    }