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.
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.
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.
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.
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 ?listCustom 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 ?listCustomer 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 ?listCustom 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