Skip to content

Commit 836bbca

Browse files
author
Prabhu Ram
committed
MC-19226: Cart Promotions :: Store promotions detail on the quote
- b2b error fix
1 parent 1c7bd5d commit 836bbca

File tree

7 files changed

+47
-7
lines changed

7 files changed

+47
-7
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\SalesRule\Api\Data;
9+
10+
interface DiscountDataInterface
11+
{
12+
/**
13+
* Get Amount
14+
*
15+
* @return float
16+
*/
17+
public function getAmount(): float;
18+
19+
/**
20+
* Get Base Amount
21+
*
22+
* @return float
23+
*/
24+
public function getBaseAmount(): float;
25+
26+
/**
27+
* Get Original Amount
28+
*
29+
* @return float
30+
*/
31+
public function getOriginalAmount(): float;
32+
33+
/**
34+
* Get Base Original Amount
35+
*
36+
* @return float
37+
*/
38+
public function getBaseOriginalAmount(): float;
39+
}

app/code/Magento/SalesRule/Model/Data/RuleDiscountInterface.php renamed to app/code/Magento/SalesRule/Api/Data/RuleDiscountInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
declare(strict_types=1);
88

9-
namespace Magento\SalesRule\Model\Data;
9+
namespace Magento\SalesRule\Api\Data;
1010

1111
/**
1212
* Rule discount Interface
@@ -16,7 +16,7 @@ interface RuleDiscountInterface
1616
/**
1717
* Get Discount Data
1818
*
19-
* @return \Magento\SalesRule\Model\Rule\Action\Discount\Data
19+
* @return \Magento\SalesRule\Api\Data\DiscountDataInterface
2020
*/
2121
public function getDiscountData();
2222

app/code/Magento/SalesRule/Model/Data/RuleDiscount.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\SalesRule\Model\Data;
99

1010
use Magento\Framework\Api\ExtensionAttributesInterface;
11+
use Magento\SalesRule\Api\Data\RuleDiscountInterface;
1112

1213
/**
1314
* Data Model for Rule Discount

app/code/Magento/SalesRule/Model/Quote/Discount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use Magento\SalesRule\Model\Rule\Action\Discount\DataFactory;
99
use Magento\Framework\App\ObjectManager;
10-
use Magento\SalesRule\Model\Data\RuleDiscountInterfaceFactory;
10+
use Magento\SalesRule\Api\Data\RuleDiscountInterfaceFactory;
1111

1212
/**
1313
* Discount totals calculation model.

app/code/Magento/SalesRule/Model/RulesApplier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\SalesRule\Model\ResourceModel\Rule\Collection;
1313
use Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory;
1414
use Magento\SalesRule\Model\Rule\Action\Discount\DataFactory;
15-
use Magento\SalesRule\Model\Data\RuleDiscountInterfaceFactory;
15+
use Magento\SalesRule\Api\Data\RuleDiscountInterfaceFactory;
1616

1717
/**
1818
* Class RulesApplier

app/code/Magento/SalesRule/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
type="Magento\SalesRule\Model\Data\CouponMassDeleteResult" />
3131
<preference for="Magento\SalesRule\Api\CouponManagementInterface"
3232
type="Magento\SalesRule\Model\Service\CouponManagementService" />
33-
<preference for="Magento\SalesRule\Model\Data\RuleDiscountInterface"
33+
<preference for="Magento\SalesRule\Api\Data\RuleDiscountInterface"
3434
type="Magento\SalesRule\Model\Data\RuleDiscount" />
3535
<type name="Magento\SalesRule\Helper\Coupon">
3636
<arguments>

app/code/Magento/SalesRule/etc/extension_attributes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
99
<extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
10-
<attribute code="discounts" type="mixed[]" />
10+
<attribute code="discounts" type="Magento\SalesRule\Api\Data\RuleDiscountInterface[]" />
1111
</extension_attributes>
1212
<extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
13-
<attribute code="discounts" type="mixed[]" />
13+
<attribute code="discounts" type="Magento\SalesRule\Api\Data\RuleDiscountInterface[]" />
1414
</extension_attributes>
1515
</config>

0 commit comments

Comments
 (0)