CouponManagementInterface.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Api;
  7. /**
  8. * Coupon management interface
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface CouponManagementInterface
  14. {
  15. /**
  16. * Generate coupon for a rule
  17. *
  18. * @param \Magento\SalesRule\Api\Data\CouponGenerationSpecInterface $couponSpec
  19. * @return string[]
  20. * @throws \Magento\Framework\Exception\LocalizedException
  21. */
  22. public function generate(\Magento\SalesRule\Api\Data\CouponGenerationSpecInterface $couponSpec);
  23. /**
  24. * Delete coupon by coupon ids.
  25. *
  26. * @param int[] $ids
  27. * @param bool $ignoreInvalidCoupons
  28. * @return \Magento\SalesRule\Api\Data\CouponMassDeleteResultInterface
  29. * @throws \Magento\Framework\Exception\NoSuchEntityException
  30. * @throws \Magento\Framework\Exception\LocalizedException
  31. */
  32. public function deleteByIds(array $ids, $ignoreInvalidCoupons = true);
  33. /**
  34. * Delete coupon by coupon codes.
  35. *
  36. * @param string[] $codes
  37. * @param bool $ignoreInvalidCoupons
  38. * @return \Magento\SalesRule\Api\Data\CouponMassDeleteResultInterface
  39. * @throws \Magento\Framework\Exception\NoSuchEntityException
  40. * @throws \Magento\Framework\Exception\LocalizedException
  41. */
  42. public function deleteByCodes(array $codes, $ignoreInvalidCoupons = true);
  43. }