-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #515 from magento-fearless-kiwis/develop
[FearlessKiwis] Sprint 52: Cart Price Rule API, Coupon API, Bug fixes
- Loading branch information
Showing
62 changed files
with
6,382 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/code/Magento/SalesRule/Api/CouponManagementInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\SalesRule\Api; | ||
|
||
/** | ||
* Coupon management interface | ||
* | ||
* @api | ||
*/ | ||
interface CouponManagementInterface | ||
{ | ||
/** | ||
* Generate coupon for a rule | ||
* | ||
* @param \Magento\SalesRule\Api\Data\CouponGenerationSpecInterface $couponSpec | ||
* @return string[] | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function generate(\Magento\SalesRule\Api\Data\CouponGenerationSpecInterface $couponSpec); | ||
|
||
/** | ||
* Delete coupon by coupon ids. | ||
* | ||
* @param int[] $ids | ||
* @param bool $ignoreInvalidCoupons | ||
* @return \Magento\SalesRule\Api\Data\CouponMassDeleteResultInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function deleteByIds(array $ids, $ignoreInvalidCoupons = true); | ||
|
||
/** | ||
* Delete coupon by coupon codes. | ||
* | ||
* @param string[] $codes | ||
* @param bool $ignoreInvalidCoupons | ||
* @return \Magento\SalesRule\Api\Data\CouponMassDeleteResultInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function deleteByCodes(array $codes, $ignoreInvalidCoupons = true); | ||
} |
54 changes: 54 additions & 0 deletions
54
app/code/Magento/SalesRule/Api/CouponRepositoryInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\SalesRule\Api; | ||
|
||
/** | ||
* Coupon CRUD interface | ||
* | ||
* @api | ||
*/ | ||
interface CouponRepositoryInterface | ||
{ | ||
/** | ||
* Save coupon. | ||
* | ||
* @param \Magento\SalesRule\Api\Data\CouponInterface $coupon | ||
* @return \Magento\SalesRule\Api\Data\CouponInterface | ||
* @throws \Magento\Framework\Exception\InputException If there is a problem with the input | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException If a coupon ID is sent but the coupon does not exist | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function save(\Magento\SalesRule\Api\Data\CouponInterface $coupon); | ||
|
||
/** | ||
* Get coupon by coupon id. | ||
* | ||
* @param int $couponId | ||
* @return \Magento\SalesRule\Api\Data\CouponInterface | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException If $couponId is not found | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function getById($couponId); | ||
|
||
/** | ||
* Retrieve coupon. | ||
* | ||
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria | ||
* @return \Magento\SalesRule\Api\Data\CouponSearchResultInterface | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); | ||
|
||
/** | ||
* Delete coupon by coupon id. | ||
* | ||
* @param int $couponId | ||
* @return bool true on success | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function deleteById($couponId); | ||
} |
123 changes: 123 additions & 0 deletions
123
app/code/Magento/SalesRule/Api/Data/ConditionInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\SalesRule\Api\Data; | ||
|
||
/** | ||
* Interface ConditionInterface | ||
* | ||
* @api | ||
*/ | ||
interface ConditionInterface extends \Magento\Framework\Api\ExtensibleDataInterface | ||
{ | ||
const AGGREGATOR_TYPE_ALL = 'all'; | ||
const AGGREGATOR_TYPE_ANY = 'any'; | ||
|
||
/** | ||
* Get condition type | ||
* | ||
* @return string | ||
*/ | ||
public function getConditionType(); | ||
|
||
/** | ||
* @param string $conditionType | ||
* @return $this | ||
*/ | ||
public function setConditionType($conditionType); | ||
|
||
|
||
/** | ||
* Return list of conditions | ||
* | ||
* @return \Magento\SalesRule\Api\Data\ConditionInterface[]|null | ||
*/ | ||
public function getConditions(); | ||
|
||
/** | ||
* Set conditions | ||
* | ||
* @param \Magento\SalesRule\Api\Data\ConditionInterface[]|null $conditions | ||
* @return $this | ||
*/ | ||
public function setConditions(array $conditions = null); | ||
|
||
/** | ||
* Return the aggregator type | ||
* | ||
* @return string|null | ||
*/ | ||
public function getAggregatorType(); | ||
|
||
/** | ||
* Set the aggregator type | ||
* | ||
* @param string $aggregatorType | ||
* @return $this | ||
*/ | ||
public function setAggregatorType($aggregatorType); | ||
|
||
/** | ||
* Return the operator of the condition | ||
* | ||
* @return string | ||
*/ | ||
public function getOperator(); | ||
|
||
/** | ||
* Set the operator of the condition | ||
* | ||
* @param string $operator | ||
* @return $this | ||
*/ | ||
public function setOperator($operator); | ||
|
||
/** | ||
* Return the attribute name of the condition | ||
* | ||
* @return string|null | ||
*/ | ||
public function getAttributeName(); | ||
|
||
/** | ||
* Set the attribute name of the condition | ||
* | ||
* @param string $attributeName | ||
* @return $this | ||
*/ | ||
public function setAttributeName($attributeName); | ||
|
||
/** | ||
* Return the value of the condition | ||
* | ||
* @return mixed | ||
*/ | ||
public function getValue(); | ||
|
||
/** | ||
* Return the value of the condition | ||
* | ||
* @param mixed $value | ||
* @return $this | ||
*/ | ||
public function setValue($value); | ||
|
||
/** | ||
* Retrieve existing extension attributes object or create a new one. | ||
* | ||
* @return \Magento\SalesRule\Api\Data\ConditionExtensionInterface|null | ||
*/ | ||
public function getExtensionAttributes(); | ||
|
||
/** | ||
* Set an extension attributes object. | ||
* | ||
* @param \Magento\SalesRule\Api\Data\ConditionExtensionInterface $extensionAttributes | ||
* @return $this | ||
*/ | ||
public function setExtensionAttributes( | ||
\Magento\SalesRule\Api\Data\ConditionExtensionInterface $extensionAttributes | ||
); | ||
} |
Oops, something went wrong.