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

Commit b64d199

Browse files
committed
feat(ClientLogging): add CreatedBy and LastModifieldBy fields
1 parent 53ac8b0 commit b64d199

File tree

25 files changed

+260
-6
lines changed

25 files changed

+260
-6
lines changed

src/Core/Model/Cart/Cart.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection;
99
use Commercetools\Core\Model\Common\Address;
1010
use Commercetools\Core\Model\Common\AddressCollection;
11+
use Commercetools\Core\Model\Common\CreatedBy;
12+
use Commercetools\Core\Model\Common\LastModifiedBy;
1113
use Commercetools\Core\Model\Common\LocaleTrait;
1214
use Commercetools\Core\Model\Common\Resource;
1315
use Commercetools\Core\Model\Common\Money;
@@ -80,6 +82,10 @@
8082
* @method Cart setShippingRateInput(ShippingRateInput $shippingRateInput = null)
8183
* @method AddressCollection getItemShippingAddresses()
8284
* @method Cart setItemShippingAddresses(AddressCollection $itemShippingAddresses = null)
85+
* @method CreatedBy getCreatedBy()
86+
* @method Cart setCreatedBy(CreatedBy $createdBy = null)
87+
* @method LastModifiedBy getLastModifiedBy()
88+
* @method Cart setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
8389
* @method CartReference getReference()
8490
*/
8591
class Cart extends Resource
@@ -139,6 +145,8 @@ public function fieldDefinitions()
139145
'taxCalculationMode' => [static::TYPE => 'string'],
140146
'shippingRateInput' => [static::TYPE => ShippingRateInput::class],
141147
'itemShippingAddresses' => [static::TYPE => AddressCollection::class],
148+
'createdBy' => [static::TYPE => CreatedBy::class],
149+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
142150
];
143151
}
144152

src/Core/Model/CartDiscount/CartDiscount.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace Commercetools\Core\Model\CartDiscount;
77

8+
use Commercetools\Core\Model\Common\CreatedBy;
9+
use Commercetools\Core\Model\Common\LastModifiedBy;
810
use Commercetools\Core\Model\Common\Resource;
911
use Commercetools\Core\Model\Common\LocalizedString;
1012
use Commercetools\Core\Model\Common\ReferenceCollection;
@@ -49,6 +51,10 @@
4951
* @method CartDiscount setStackingMode(string $stackingMode = null)
5052
* @method CustomFieldObject getCustom()
5153
* @method CartDiscount setCustom(CustomFieldObject $custom = null)
54+
* @method CreatedBy getCreatedBy()
55+
* @method CartDiscount setCreatedBy(CreatedBy $createdBy = null)
56+
* @method LastModifiedBy getLastModifiedBy()
57+
* @method CartDiscount setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
5258
* @method CartDiscountReference getReference()
5359
*/
5460
class CartDiscount extends Resource
@@ -87,7 +93,9 @@ public function fieldDefinitions()
8793
'requiresDiscountCode' => [static::TYPE => 'bool'],
8894
'references' => [static::TYPE => ReferenceCollection::class],
8995
'stackingMode' => [static::TYPE => 'string'],
90-
'custom' => [static::TYPE => CustomFieldObject::class]
96+
'custom' => [static::TYPE => CustomFieldObject::class],
97+
'createdBy' => [static::TYPE => CreatedBy::class],
98+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
9199
];
92100
}
93101
}

src/Core/Model/Category/Category.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace Commercetools\Core\Model\Category;
77

8+
use Commercetools\Core\Model\Common\CreatedBy;
9+
use Commercetools\Core\Model\Common\LastModifiedBy;
810
use Commercetools\Core\Model\Common\Resource;
911
use Commercetools\Core\Model\Common\LocalizedString;
1012
use Commercetools\Core\Model\CustomField\CustomFieldObject;
@@ -49,6 +51,10 @@
4951
* @method Category setAssets(AssetCollection $assets = null)
5052
* @method string getKey()
5153
* @method Category setKey(string $key = null)
54+
* @method CreatedBy getCreatedBy()
55+
* @method Category setCreatedBy(CreatedBy $createdBy = null)
56+
* @method LastModifiedBy getLastModifiedBy()
57+
* @method Category setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
5258
* @method CategoryReference getReference()
5359
*/
5460
class Category extends Resource
@@ -79,6 +85,8 @@ public function fieldDefinitions()
7985
'custom' => [static::TYPE => CustomFieldObject::class],
8086
'assets' => [static::TYPE => AssetCollection::class],
8187
'key' => [static::TYPE => 'string'],
88+
'createdBy' => [static::TYPE => CreatedBy::class],
89+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
8290
];
8391
}
8492
}

src/Core/Model/Channel/Channel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace Commercetools\Core\Model\Channel;
77

8+
use Commercetools\Core\Model\Common\CreatedBy;
9+
use Commercetools\Core\Model\Common\LastModifiedBy;
810
use Commercetools\Core\Model\Common\Resource;
911
use Commercetools\Core\Model\Common\LocalizedString;
1012
use Commercetools\Core\Model\Common\DateTimeDecorator;
@@ -41,6 +43,10 @@
4143
* @method Channel setAddress(Address $address = null)
4244
* @method GeoLocation getGeoLocation()
4345
* @method Channel setGeoLocation(GeoLocation $geoLocation = null)
46+
* @method CreatedBy getCreatedBy()
47+
* @method Channel setCreatedBy(CreatedBy $createdBy = null)
48+
* @method LastModifiedBy getLastModifiedBy()
49+
* @method Channel setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
4450
* @method ChannelReference getReference()
4551
*/
4652
class Channel extends Resource
@@ -66,6 +72,8 @@ public function fieldDefinitions()
6672
'custom' => [static::TYPE => CustomFieldObject::class],
6773
'address' => [static::TYPE => Address::class],
6874
'geoLocation' => [static::TYPE => GeoLocation::class],
75+
'createdBy' => [static::TYPE => CreatedBy::class],
76+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
6977
];
7078
}
7179
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
*/
4+
5+
namespace Commercetools\Core\Model\Common;
6+
7+
use Commercetools\Core\Model\Customer\CustomerReference;
8+
9+
/**
10+
* @package Commercetools\Core\Model\Common
11+
*
12+
* @method string getClientId()
13+
* @method ClientLogging setClientId(string $clientId = null)
14+
* @method string getExternalUserId()
15+
* @method ClientLogging setExternalUserId(string $externalUserId = null)
16+
* @method CustomerReference getCustomer()
17+
* @method ClientLogging setCustomer(CustomerReference $customer = null)
18+
* @method string getAnonymousId()
19+
* @method ClientLogging setAnonymousId(string $anonymousId = null)
20+
*/
21+
class ClientLogging extends JsonObject
22+
{
23+
public function fieldDefinitions()
24+
{
25+
return [
26+
'clientId' => [static::TYPE => 'string'],
27+
'externalUserId' => [static::TYPE => 'string'],
28+
'customer' => [static::TYPE => CustomerReference::class],
29+
'anonymousId' => [static::TYPE => 'string'],
30+
];
31+
}
32+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
*
4+
*/
5+
6+
namespace Commercetools\Core\Model\Common;
7+
8+
use Commercetools\Core\Model\Customer\CustomerReference;
9+
10+
/**
11+
* @package Commercetools\Core\Model\Common
12+
*
13+
* @method string getClientId()
14+
* @method CreatedBy setClientId(string $clientId = null)
15+
* @method string getExternalUserId()
16+
* @method CreatedBy setExternalUserId(string $externalUserId = null)
17+
* @method CustomerReference getCustomer()
18+
* @method CreatedBy setCustomer(CustomerReference $customer = null)
19+
* @method string getAnonymousId()
20+
* @method CreatedBy setAnonymousId(string $anonymousId = null)
21+
*/
22+
class CreatedBy extends ClientLogging
23+
{
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
*
4+
*/
5+
6+
namespace Commercetools\Core\Model\Common;
7+
8+
use Commercetools\Core\Model\Customer\CustomerReference;
9+
10+
/**
11+
* @package Commercetools\Core\Model\Common
12+
*
13+
* @method string getClientId()
14+
* @method LastModifiedBy setClientId(string $clientId = null)
15+
* @method string getExternalUserId()
16+
* @method LastModifiedBy setExternalUserId(string $externalUserId = null)
17+
* @method CustomerReference getCustomer()
18+
* @method LastModifiedBy setCustomer(CustomerReference $customer = null)
19+
* @method string getAnonymousId()
20+
* @method LastModifiedBy setAnonymousId(string $anonymousId = null)
21+
*/
22+
class LastModifiedBy extends ClientLogging
23+
{
24+
}

src/Core/Model/Customer/Customer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
use Commercetools\Core\Model\Common\Address;
99
use Commercetools\Core\Model\Common\AddressCollection;
10+
use Commercetools\Core\Model\Common\CreatedBy;
11+
use Commercetools\Core\Model\Common\LastModifiedBy;
1012
use Commercetools\Core\Model\Common\LocaleTrait;
1113
use Commercetools\Core\Model\Common\Resource;
1214
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
@@ -69,6 +71,10 @@
6971
* @method Customer setSalutation(string $salutation = null)
7072
* @method string getKey()
7173
* @method Customer setKey(string $key = null)
74+
* @method CreatedBy getCreatedBy()
75+
* @method Customer setCreatedBy(CreatedBy $createdBy = null)
76+
* @method LastModifiedBy getLastModifiedBy()
77+
* @method Customer setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
7278
* @method CustomerReference getReference()
7379
*/
7480
class Customer extends Resource
@@ -113,6 +119,8 @@ public function fieldDefinitions()
113119
'billingAddressIds' => [static::TYPE => 'array'],
114120
'salutation' => [static::TYPE => 'string'],
115121
'key' => [static::TYPE => 'string'],
122+
'createdBy' => [static::TYPE => CreatedBy::class],
123+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
116124
];
117125
}
118126

src/Core/Model/CustomerGroup/CustomerGroup.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace Commercetools\Core\Model\CustomerGroup;
77

8+
use Commercetools\Core\Model\Common\CreatedBy;
9+
use Commercetools\Core\Model\Common\LastModifiedBy;
810
use Commercetools\Core\Model\Common\Resource;
911
use Commercetools\Core\Model\Common\DateTimeDecorator;
1012
use Commercetools\Core\Model\CustomField\CustomFieldObject;
@@ -27,6 +29,10 @@
2729
* @method CustomerGroup setKey(string $key = null)
2830
* @method CustomFieldObject getCustom()
2931
* @method CustomerGroup setCustom(CustomFieldObject $custom = null)
32+
* @method CreatedBy getCreatedBy()
33+
* @method CustomerGroup setCreatedBy(CreatedBy $createdBy = null)
34+
* @method LastModifiedBy getLastModifiedBy()
35+
* @method CustomerGroup setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
3036
* @method CustomerGroupReference getReference()
3137
*/
3238
class CustomerGroup extends Resource
@@ -47,6 +53,8 @@ public function fieldDefinitions()
4753
'name' => [static::TYPE => 'string'],
4854
'key' => [static::TYPE => 'string'],
4955
'custom' => [static::TYPE => CustomFieldObject::class],
56+
'createdBy' => [static::TYPE => CreatedBy::class],
57+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
5058
];
5159
}
5260
}

src/Core/Model/DiscountCode/DiscountCode.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Commercetools\Core\Model\DiscountCode;
77

88
use Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection;
9+
use Commercetools\Core\Model\Common\CreatedBy;
10+
use Commercetools\Core\Model\Common\LastModifiedBy;
911
use Commercetools\Core\Model\Common\Resource;
1012
use Commercetools\Core\Model\Common\LocalizedString;
1113
use Commercetools\Core\Model\Common\ReferenceCollection;
@@ -50,6 +52,10 @@
5052
* @method DiscountCode setValidFrom(DateTime $validFrom = null)
5153
* @method DateTimeDecorator getValidUntil()
5254
* @method DiscountCode setValidUntil(DateTime $validUntil = null)
55+
* @method CreatedBy getCreatedBy()
56+
* @method DiscountCode setCreatedBy(CreatedBy $createdBy = null)
57+
* @method LastModifiedBy getLastModifiedBy()
58+
* @method DiscountCode setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
5359
* @method DiscountCodeReference getReference()
5460
*/
5561
class DiscountCode extends Resource
@@ -88,6 +94,8 @@ public function fieldDefinitions()
8894
static::TYPE => DateTime::class,
8995
static::DECORATOR => DateTimeDecorator::class
9096
],
97+
'createdBy' => [static::TYPE => CreatedBy::class],
98+
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
9199
];
92100
}
93101
}

0 commit comments

Comments
 (0)