Skip to content

Commit 288f345

Browse files
committed
MQE-378: Create API metadata for Coupon Code
1 parent cd8dd48 commit 288f345

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
12+
<entity name="_defaultCoupon" type="coupon">
13+
<data key="rule_id">4</data>
14+
<data key="code">FREESHIPPING123</data>
15+
<data key="times_used">0</data>
16+
<data key="is_primary">false</data>
17+
</entity>
18+
</config>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
12+
<operation name="CreateCoupon" dataType="coupon" type="create" auth="/rest/V1/integration/admin/token" url="/rest/V1/coupons" method="POST">
13+
<header param="Content-Type">application/json</header>
14+
<jsonObject key="coupon" dataType="coupon">
15+
<entry key="rule_id" required="true">integer</entry>
16+
<entry key="times_used" required="true">integer</entry>
17+
<entry key="is_primary" required="true">boolean</entry>
18+
<entry key="code">string</entry>
19+
<entry key="usage_limit">integer</entry>
20+
<entry key="usage_per_customer">integer</entry>
21+
<entry key="expiration_date">string</entry>
22+
<entry key="created_at">string</entry>
23+
<entry key="type">integer</entry>
24+
<entry key="extension_attributes">empty_extension_attribute</entry>
25+
</jsonObject>
26+
</operation>
27+
28+
<operation name="DeleteCoupon" dataType="coupon" type="delete" auth="/rest/V1/integration/admin/token" url="/rest/V1/coupons" method="DELETE">
29+
<header param="Content-Type">application/json</header>
30+
<param key="couponId" type="path">{coupon_id}</param>
31+
</operation>
32+
</config>

0 commit comments

Comments
 (0)