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

Commit 23d1737

Browse files
author
Jens Schulze
committed
feat: support custom field for customer groups
Closes #360
1 parent b60aab0 commit 23d1737

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/Core/Model/CustomerGroup/CustomerGroup.php

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

88
use Commercetools\Core\Model\Common\Resource;
99
use Commercetools\Core\Model\Common\DateTimeDecorator;
10+
use Commercetools\Core\Model\CustomField\CustomFieldObject;
1011
use DateTime;
1112

1213
/**
@@ -24,6 +25,8 @@
2425
* @method CustomerGroup setName(string $name = null)
2526
* @method string getKey()
2627
* @method CustomerGroup setKey(string $key = null)
28+
* @method CustomFieldObject getCustom()
29+
* @method CustomerGroup setCustom(CustomFieldObject $custom = null)
2730
* @method CustomerGroupReference getReference()
2831
*/
2932
class CustomerGroup extends Resource
@@ -43,6 +46,7 @@ public function fieldDefinitions()
4346
],
4447
'name' => [static::TYPE => 'string'],
4548
'key' => [static::TYPE => 'string'],
49+
'custom' => [static::TYPE => CustomFieldObject::class],
4650
];
4751
}
4852
}

src/Core/Model/CustomerGroup/CustomerGroupDraft.php

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

88
use Commercetools\Core\Model\Common\Context;
99
use Commercetools\Core\Model\Common\JsonObject;
10+
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
1011

1112
/**
1213
* @package Commercetools\Core\Model\CustomerGroup
1314
* @link https://dev.commercetools.com/http-api-projects-customerGroups.html#create-a-customergroup
1415
* @method string getGroupName()
1516
* @method CustomerGroupDraft setGroupName(string $groupName = null)
17+
* @method string getKey()
18+
* @method CustomerGroupDraft setKey(string $key = null)
19+
* @method CustomFieldObjectDraft getCustom()
20+
* @method CustomerGroupDraft setCustom(CustomFieldObjectDraft $custom = null)
1621
*/
1722
class CustomerGroupDraft extends JsonObject
1823
{
1924
public function fieldDefinitions()
2025
{
2126
return [
27+
'key' => [static::TYPE => 'string'],
2228
'groupName' => [static::TYPE => 'string'],
29+
'custom' => [static::TYPE => CustomFieldObjectDraft::class],
2330
];
2431
}
2532

tests/fixtures/models.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ customerGroup:
713713
- lastModifiedAt
714714
- name
715715
- key
716+
- custom
716717

717718
discountCode:
718719
domain: discountCode

0 commit comments

Comments
 (0)