diff --git a/lib/commercetools-api/src/Models/Customer/Customer.php b/lib/commercetools-api/src/Models/Customer/Customer.php index 0f410d15cfc..e0d926ea2b4 100644 --- a/lib/commercetools-api/src/Models/Customer/Customer.php +++ b/lib/commercetools-api/src/Models/Customer/Customer.php @@ -42,12 +42,12 @@ interface Customer extends BaseResource public const FIELD_BILLING_ADDRESS_IDS = 'billingAddressIds'; public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; + public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; public const FIELD_CUSTOM = 'custom'; public const FIELD_LOCALE = 'locale'; public const FIELD_SALUTATION = 'salutation'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; - public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; /** *

Unique identifier of the Customer.

@@ -251,6 +251,15 @@ public function getIsEmailVerified(); */ public function getCustomerGroup(); + /** + *

Customer Groups that the Customer belongs to.

+ *

Used for Line Item price selection.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments(); + /** *

Custom Fields for the Customer.

* @@ -295,14 +304,6 @@ public function getStores(); */ public function getAuthenticationMode(); - /** - *

Customer Groups that the Customer belongs to.

- * - - * @return null|CustomerGroupAssignmentCollection - */ - public function getCustomerGroupAssignments(); - /** * @param ?string $id */ @@ -428,6 +429,11 @@ public function setIsEmailVerified(?bool $isEmailVerified): void; */ public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void; + /** * @param ?CustomFields $custom */ @@ -452,9 +458,4 @@ public function setStores(?StoreKeyReferenceCollection $stores): void; * @param ?string $authenticationMode */ public function setAuthenticationMode(?string $authenticationMode): void; - - /** - * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments - */ - public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php index cebabe05190..7d158199093 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php @@ -183,6 +183,12 @@ final class CustomerBuilder implements Builder */ private $customerGroup; + /** + + * @var ?CustomerGroupAssignmentCollection + */ + private $customerGroupAssignments; + /** * @var null|CustomFields|CustomFieldsBuilder @@ -213,12 +219,6 @@ final class CustomerBuilder implements Builder */ private $authenticationMode; - /** - - * @var ?CustomerGroupAssignmentCollection - */ - private $customerGroupAssignments; - /** *

Unique identifier of the Customer.

* @@ -496,6 +496,18 @@ public function getCustomerGroup() return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; } + /** + *

Customer Groups that the Customer belongs to.

+ *

Used for Line Item price selection.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + /** *

Custom Fields for the Customer.

* @@ -555,17 +567,6 @@ public function getAuthenticationMode() return $this->authenticationMode; } - /** - *

Customer Groups that the Customer belongs to.

- * - - * @return null|CustomerGroupAssignmentCollection - */ - public function getCustomerGroupAssignments() - { - return $this->customerGroupAssignments; - } - /** * @param ?string $id * @return $this @@ -841,6 +842,17 @@ public function withCustomerGroup(?CustomerGroupReference $customerGroup) return $this; } + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + /** * @param ?CustomFields $custom * @return $this @@ -896,17 +908,6 @@ public function withAuthenticationMode(?string $authenticationMode) return $this; } - /** - * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments - * @return $this - */ - public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments) - { - $this->customerGroupAssignments = $customerGroupAssignments; - - return $this; - } - /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -979,12 +980,12 @@ public function build(): Customer $this->billingAddressIds, $this->isEmailVerified, $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->customerGroupAssignments, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->locale, $this->salutation, $this->stores, - $this->authenticationMode, - $this->customerGroupAssignments + $this->authenticationMode ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php index 024f2dcb5e6..7a4dfd7ebfa 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php @@ -41,12 +41,12 @@ interface CustomerDraft extends JsonObject public const FIELD_BILLING_ADDRESSES = 'billingAddresses'; public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; + public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; public const FIELD_CUSTOM = 'custom'; public const FIELD_LOCALE = 'locale'; public const FIELD_SALUTATION = 'salutation'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; - public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; /** *

User-defined unique identifier for the Customer. @@ -229,12 +229,22 @@ public function getIsEmailVerified(); /** *

Sets the CustomerGroup for the Customer.

+ *

For new projects, use customerGroupAssignments instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.

* * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); + /** + *

Customer Groups to assign the Customer to.

+ *

Used for Line Item price selection.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments(); + /** *

Custom Fields for the Customer.

* @@ -283,14 +293,6 @@ public function getStores(); */ public function getAuthenticationMode(); - /** - *

Customer Groups to assign the Customer to.

- * - - * @return null|CustomerGroupAssignmentDraftCollection - */ - public function getCustomerGroupAssignments(); - /** * @param ?string $key */ @@ -401,6 +403,11 @@ public function setIsEmailVerified(?bool $isEmailVerified): void; */ public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void; + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void; + /** * @param ?CustomFieldsDraft $custom */ @@ -425,9 +432,4 @@ public function setStores(?StoreResourceIdentifierCollection $stores): void; * @param ?string $authenticationMode */ public function setAuthenticationMode(?string $authenticationMode): void; - - /** - * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments - */ - public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php index 8215a95b482..79a02d06258 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php @@ -161,6 +161,12 @@ final class CustomerDraftBuilder implements Builder */ private $customerGroup; + /** + + * @var ?CustomerGroupAssignmentDraftCollection + */ + private $customerGroupAssignments; + /** * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder @@ -191,12 +197,6 @@ final class CustomerDraftBuilder implements Builder */ private $authenticationMode; - /** - - * @var ?CustomerGroupAssignmentDraftCollection - */ - private $customerGroupAssignments; - /** *

User-defined unique identifier for the Customer. * The key field is preferred over customerNumber as it is mutable and provides more flexibility.

@@ -441,6 +441,7 @@ public function getIsEmailVerified() /** *

Sets the CustomerGroup for the Customer.

+ *

For new projects, use customerGroupAssignments instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.

* * @return null|CustomerGroupResourceIdentifier @@ -450,6 +451,18 @@ public function getCustomerGroup() return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup; } + /** + *

Customer Groups to assign the Customer to.

+ *

Used for Line Item price selection.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + /** *

Custom Fields for the Customer.

* @@ -513,17 +526,6 @@ public function getAuthenticationMode() return $this->authenticationMode; } - /** - *

Customer Groups to assign the Customer to.

- * - - * @return null|CustomerGroupAssignmentDraftCollection - */ - public function getCustomerGroupAssignments() - { - return $this->customerGroupAssignments; - } - /** * @param ?string $key * @return $this @@ -766,6 +768,17 @@ public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGrou return $this; } + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + /** * @param ?CustomFieldsDraft $custom * @return $this @@ -821,17 +834,6 @@ public function withAuthenticationMode(?string $authenticationMode) return $this; } - /** - * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments - * @return $this - */ - public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments) - { - $this->customerGroupAssignments = $customerGroupAssignments; - - return $this; - } - /** * @deprecated use withAnonymousCart() instead * @return $this @@ -890,12 +892,12 @@ public function build(): CustomerDraft $this->billingAddresses, $this->isEmailVerified, $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->customerGroupAssignments, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->locale, $this->salutation, $this->stores, - $this->authenticationMode, - $this->customerGroupAssignments + $this->authenticationMode ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php index a1a5aca1c2a..9f778f346d3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php @@ -160,6 +160,12 @@ final class CustomerDraftModel extends JsonObjectModel implements CustomerDraft */ protected $customerGroup; + /** + * + * @var ?CustomerGroupAssignmentDraftCollection + */ + protected $customerGroupAssignments; + /** * * @var ?CustomFieldsDraft @@ -190,12 +196,6 @@ final class CustomerDraftModel extends JsonObjectModel implements CustomerDraft */ protected $authenticationMode; - /** - * - * @var ?CustomerGroupAssignmentDraftCollection - */ - protected $customerGroupAssignments; - /** * @psalm-suppress MissingParamType @@ -223,12 +223,12 @@ public function __construct( ?array $billingAddresses = null, ?bool $isEmailVerified = null, ?CustomerGroupResourceIdentifier $customerGroup = null, + ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments = null, ?CustomFieldsDraft $custom = null, ?string $locale = null, ?string $salutation = null, ?StoreResourceIdentifierCollection $stores = null, - ?string $authenticationMode = null, - ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments = null + ?string $authenticationMode = null ) { $this->key = $key; $this->customerNumber = $customerNumber; @@ -252,12 +252,12 @@ public function __construct( $this->billingAddresses = $billingAddresses; $this->isEmailVerified = $isEmailVerified; $this->customerGroup = $customerGroup; + $this->customerGroupAssignments = $customerGroupAssignments; $this->custom = $custom; $this->locale = $locale; $this->salutation = $salutation; $this->stores = $stores; $this->authenticationMode = $authenticationMode; - $this->customerGroupAssignments = $customerGroupAssignments; } /** @@ -698,6 +698,7 @@ public function getIsEmailVerified() /** *

Sets the CustomerGroup for the Customer.

+ *

For new projects, use customerGroupAssignments instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.

* * * @return null|CustomerGroupResourceIdentifier @@ -717,6 +718,27 @@ public function getCustomerGroup() return $this->customerGroup; } + /** + *

Customer Groups to assign the Customer to.

+ *

Used for Line Item price selection.

+ * + * + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + /** *

Custom Fields for the Customer.

* @@ -826,26 +848,6 @@ public function getAuthenticationMode() return $this->authenticationMode; } - /** - *

Customer Groups to assign the Customer to.

- * - * - * @return null|CustomerGroupAssignmentDraftCollection - */ - public function getCustomerGroupAssignments() - { - if (is_null($this->customerGroupAssignments)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); - if (is_null($data)) { - return null; - } - $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data); - } - - return $this->customerGroupAssignments; - } - /** * @param ?string $key @@ -1023,6 +1025,14 @@ public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup $this->customerGroup = $customerGroup; } + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } + /** * @param ?CustomFieldsDraft $custom */ @@ -1063,14 +1073,6 @@ public function setAuthenticationMode(?string $authenticationMode): void $this->authenticationMode = $authenticationMode; } - /** - * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments - */ - public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void - { - $this->customerGroupAssignments = $customerGroupAssignments; - } - #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerModel.php b/lib/commercetools-api/src/Models/Customer/CustomerModel.php index 4c82fc9a3ac..d3e3df0accd 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerModel.php @@ -182,6 +182,12 @@ final class CustomerModel extends JsonObjectModel implements Customer */ protected $customerGroup; + /** + * + * @var ?CustomerGroupAssignmentCollection + */ + protected $customerGroupAssignments; + /** * * @var ?CustomFields @@ -212,12 +218,6 @@ final class CustomerModel extends JsonObjectModel implements Customer */ protected $authenticationMode; - /** - * - * @var ?CustomerGroupAssignmentCollection - */ - protected $customerGroupAssignments; - /** * @psalm-suppress MissingParamType @@ -248,12 +248,12 @@ public function __construct( ?array $billingAddressIds = null, ?bool $isEmailVerified = null, ?CustomerGroupReference $customerGroup = null, + ?CustomerGroupAssignmentCollection $customerGroupAssignments = null, ?CustomFields $custom = null, ?string $locale = null, ?string $salutation = null, ?StoreKeyReferenceCollection $stores = null, - ?string $authenticationMode = null, - ?CustomerGroupAssignmentCollection $customerGroupAssignments = null + ?string $authenticationMode = null ) { $this->id = $id; $this->version = $version; @@ -280,12 +280,12 @@ public function __construct( $this->billingAddressIds = $billingAddressIds; $this->isEmailVerified = $isEmailVerified; $this->customerGroup = $customerGroup; + $this->customerGroupAssignments = $customerGroupAssignments; $this->custom = $custom; $this->locale = $locale; $this->salutation = $salutation; $this->stores = $stores; $this->authenticationMode = $authenticationMode; - $this->customerGroupAssignments = $customerGroupAssignments; } /** @@ -805,6 +805,27 @@ public function getCustomerGroup() return $this->customerGroup; } + /** + *

Customer Groups that the Customer belongs to.

+ *

Used for Line Item price selection.

+ * + * + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + /** *

Custom Fields for the Customer.

* @@ -910,26 +931,6 @@ public function getAuthenticationMode() return $this->authenticationMode; } - /** - *

Customer Groups that the Customer belongs to.

- * - * - * @return null|CustomerGroupAssignmentCollection - */ - public function getCustomerGroupAssignments() - { - if (is_null($this->customerGroupAssignments)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); - if (is_null($data)) { - return null; - } - $this->customerGroupAssignments = CustomerGroupAssignmentCollection::fromArray($data); - } - - return $this->customerGroupAssignments; - } - /** * @param ?string $id @@ -1131,6 +1132,14 @@ public function setCustomerGroup(?CustomerGroupReference $customerGroup): void $this->customerGroup = $customerGroup; } + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } + /** * @param ?CustomFields $custom */ @@ -1171,14 +1180,6 @@ public function setAuthenticationMode(?string $authenticationMode): void $this->authenticationMode = $authenticationMode; } - /** - * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments - */ - public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void - { - $this->customerGroupAssignments = $customerGroupAssignments; - } - #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/references.txt b/references.txt index f2ace517d44..489c9782c66 100644 --- a/references.txt +++ b/references.txt @@ -432,3 +432,4 @@ f94e106041ca73ddf1379a3450017c042ea2a170 d5b618e3078640150ff78fb3f4a81e24edba2d2d 195169313ee8edc8449e7a272160ab4e28ad9fec b6f85c31ff715e0814a996a7d64089bec3c721eb +dad479066925f91fc733f038afb66c7919409a4c