Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 6834a89

Browse files
author
Jens Schulze
authored
Support order refused gifts #510 (#519)
Support order refused gifts #510
2 parents 3b57b39 + a0e8461 commit 6834a89

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace Commercetools\Core\Model\Message;
4+
5+
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
6+
use Commercetools\Core\Model\Common\DateTimeDecorator;
7+
use DateTime;
8+
use Commercetools\Core\Model\Common\Reference;
9+
10+
/**
11+
* @package Commercetools\Core\Model\Message
12+
* @link https://docs.commercetools.com/http-api-projects-messages.html#ordercustomergroupset-message
13+
*
14+
* @method string getId()
15+
* @method OrderCustomerGroupSetMessage setId(string $id = null)
16+
* @method int getVersion()
17+
* @method OrderCustomerGroupSetMessage setVersion(int $version = null)
18+
* @method DateTimeDecorator getCreatedAt()
19+
* @method OrderCustomerGroupSetMessage setCreatedAt(DateTime $createdAt = null)
20+
* @method DateTimeDecorator getLastModifiedAt()
21+
* @method OrderCustomerGroupSetMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
22+
* @method int getSequenceNumber()
23+
* @method OrderCustomerGroupSetMessage setSequenceNumber(int $sequenceNumber = null)
24+
* @method Reference getResource()
25+
* @method OrderCustomerGroupSetMessage setResource(Reference $resource = null)
26+
* @method int getResourceVersion()
27+
* @method OrderCustomerGroupSetMessage setResourceVersion(int $resourceVersion = null)
28+
* @method string getType()
29+
* @method OrderCustomerGroupSetMessage setType(string $type = null)
30+
* @method UserProvidedIdentifiers getResourceUserProvidedIdentifiers()
31+
* phpcs:disable
32+
* @method OrderCustomerGroupSetMessage setResourceUserProvidedIdentifiers(UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null)
33+
* phpcs:enable
34+
* @method CustomerGroupReference getCustomerGroup()
35+
* @method OrderCustomerGroupSetMessage setCustomerGroup(CustomerGroupReference $customerGroup = null)
36+
* @method CustomerGroupReference getOldCustomerGroup()
37+
* @method OrderCustomerGroupSetMessage setOldCustomerGroup(CustomerGroupReference $oldCustomerGroup = null)
38+
*/
39+
class OrderCustomerGroupSetMessage extends Message
40+
{
41+
const MESSAGE_TYPE = 'OrderCustomerGroupSet';
42+
43+
public function fieldDefinitions()
44+
{
45+
$definitions = parent::fieldDefinitions();
46+
$definitions['customerGroup'] = [static::TYPE => CustomerGroupReference::class];
47+
$definitions['oldCustomerGroup'] = [static::TYPE => CustomerGroupReference::class];
48+
49+
return $definitions;
50+
}
51+
}

src/Core/Model/Order/Order.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Commercetools\Core\Model\Cart\LineItemCollection;
1010
use Commercetools\Core\Model\Cart\ShippingInfo;
1111
use Commercetools\Core\Model\Cart\ShippingRateInput;
12+
use Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection;
1213
use Commercetools\Core\Model\Common\Address;
1314
use Commercetools\Core\Model\Common\AddressCollection;
1415
use Commercetools\Core\Model\Common\CreatedBy;
@@ -109,6 +110,8 @@
109110
* @method Order setCreatedBy(CreatedBy $createdBy = null)
110111
* @method LastModifiedBy getLastModifiedBy()
111112
* @method Order setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
113+
* @method CartDiscountReferenceCollection getRefusedGifts()
114+
* @method Order setRefusedGifts(CartDiscountReferenceCollection $refusedGifts = null)
112115
* @method OrderReference getReference()
113116
*/
114117
class Order extends Resource
@@ -174,6 +177,7 @@ public function fieldDefinitions()
174177
'store' => [static::TYPE => StoreReference::class],
175178
'createdBy' => [static::TYPE => CreatedBy::class],
176179
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
180+
'refusedGifts' => [static::TYPE => CartDiscountReferenceCollection::class],
177181
];
178182
}
179183
}

src/Core/Model/OrderEdit/StagedOrder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Commercetools\Core\Model\Store\StoreReference;
2828
use Commercetools\Core\Model\Common\CreatedBy;
2929
use Commercetools\Core\Model\Common\LastModifiedBy;
30+
use Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection;
3031

3132
/**
3233
* @package Commercetools\Core\Model\OrderEdit
@@ -110,6 +111,8 @@
110111
* @method StagedOrder setCreatedBy(CreatedBy $createdBy = null)
111112
* @method LastModifiedBy getLastModifiedBy()
112113
* @method StagedOrder setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
114+
* @method CartDiscountReferenceCollection getRefusedGifts()
115+
* @method StagedOrder setRefusedGifts(CartDiscountReferenceCollection $refusedGifts = null)
113116
*/
114117
class StagedOrder extends Order
115118
{

0 commit comments

Comments
 (0)