Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions lib/commercetools-api/src/Models/Customer/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
* <p>Unique identifier of the Customer.</p>
Expand Down Expand Up @@ -251,6 +251,15 @@ public function getIsEmailVerified();
*/
public function getCustomerGroup();

/**
* <p>Customer Groups that the Customer belongs to.</p>
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
*

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

/**
* <p>Custom Fields for the Customer.</p>
*
Expand Down Expand Up @@ -295,14 +304,6 @@ public function getStores();
*/
public function getAuthenticationMode();

/**
* <p>Customer Groups that the Customer belongs to.</p>
*

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

/**
* @param ?string $id
*/
Expand Down Expand Up @@ -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
*/
Expand All @@ -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;
}
61 changes: 31 additions & 30 deletions lib/commercetools-api/src/Models/Customer/CustomerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@
*/
private $customerGroup;

/**

* @var ?CustomerGroupAssignmentCollection
*/
private $customerGroupAssignments;

/**

* @var null|CustomFields|CustomFieldsBuilder
Expand Down Expand Up @@ -213,12 +219,6 @@
*/
private $authenticationMode;

/**

* @var ?CustomerGroupAssignmentCollection
*/
private $customerGroupAssignments;

/**
* <p>Unique identifier of the Customer.</p>
*
Expand Down Expand Up @@ -496,6 +496,18 @@
return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
}

/**
* <p>Customer Groups that the Customer belongs to.</p>
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
*

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

Check warning on line 506 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L506

Added line #L506 was not covered by tests
{
return $this->customerGroupAssignments;

Check warning on line 508 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L508

Added line #L508 was not covered by tests
}

/**
* <p>Custom Fields for the Customer.</p>
*
Expand Down Expand Up @@ -555,17 +567,6 @@
return $this->authenticationMode;
}

/**
* <p>Customer Groups that the Customer belongs to.</p>
*

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

/**
* @param ?string $id
* @return $this
Expand Down Expand Up @@ -841,6 +842,17 @@
return $this;
}

/**
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
* @return $this
*/
public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)

Check warning on line 849 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L849

Added line #L849 was not covered by tests
{
$this->customerGroupAssignments = $customerGroupAssignments;

Check warning on line 851 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L851

Added line #L851 was not covered by tests

return $this;

Check warning on line 853 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L853

Added line #L853 was not covered by tests
}

/**
* @param ?CustomFields $custom
* @return $this
Expand Down Expand Up @@ -896,17 +908,6 @@
return $this;
}

/**
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
* @return $this
*/
public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
{
$this->customerGroupAssignments = $customerGroupAssignments;

return $this;
}

/**
* @deprecated use withLastModifiedBy() instead
* @return $this
Expand Down Expand Up @@ -979,12 +980,12 @@
$this->billingAddressIds,
$this->isEmailVerified,
$this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
$this->customerGroupAssignments,

Check warning on line 983 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L983

Added line #L983 was not covered by tests
$this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
$this->locale,
$this->salutation,
$this->stores,
$this->authenticationMode,
$this->customerGroupAssignments
$this->authenticationMode

Check warning on line 988 in lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php#L988

Added line #L988 was not covered by tests
);
}

Expand Down
30 changes: 16 additions & 14 deletions lib/commercetools-api/src/Models/Customer/CustomerDraft.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
* <p>User-defined unique identifier for the Customer.
Expand Down Expand Up @@ -229,12 +229,22 @@ public function getIsEmailVerified();

/**
* <p>Sets the <a href="ctp:api:type:CustomerGroup">CustomerGroup</a> for the Customer.</p>
* <p>For new projects, use <code>customerGroupAssignments</code> instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.</p>
*

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

/**
* <p>Customer Groups to assign the Customer to.</p>
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
*

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

/**
* <p>Custom Fields for the Customer.</p>
*
Expand Down Expand Up @@ -283,14 +293,6 @@ public function getStores();
*/
public function getAuthenticationMode();

/**
* <p>Customer Groups to assign the Customer to.</p>
*

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

/**
* @param ?string $key
*/
Expand Down Expand Up @@ -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
*/
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@
*/
private $customerGroup;

/**

* @var ?CustomerGroupAssignmentDraftCollection
*/
private $customerGroupAssignments;

/**

* @var null|CustomFieldsDraft|CustomFieldsDraftBuilder
Expand Down Expand Up @@ -191,12 +197,6 @@
*/
private $authenticationMode;

/**

* @var ?CustomerGroupAssignmentDraftCollection
*/
private $customerGroupAssignments;

/**
* <p>User-defined unique identifier for the Customer.
* The <code>key</code> field is preferred over <code>customerNumber</code> as it is mutable and provides more flexibility.</p>
Expand Down Expand Up @@ -441,6 +441,7 @@

/**
* <p>Sets the <a href="ctp:api:type:CustomerGroup">CustomerGroup</a> for the Customer.</p>
* <p>For new projects, use <code>customerGroupAssignments</code> instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.</p>
*

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

/**
* <p>Customer Groups to assign the Customer to.</p>
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
*

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

Check warning on line 461 in lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php#L461

Added line #L461 was not covered by tests
{
return $this->customerGroupAssignments;

Check warning on line 463 in lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php#L463

Added line #L463 was not covered by tests
}

/**
* <p>Custom Fields for the Customer.</p>
*
Expand Down Expand Up @@ -513,17 +526,6 @@
return $this->authenticationMode;
}

/**
* <p>Customer Groups to assign the Customer to.</p>
*

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

/**
* @param ?string $key
* @return $this
Expand Down Expand Up @@ -766,6 +768,17 @@
return $this;
}

/**
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
* @return $this
*/
public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)

Check warning on line 775 in lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php#L775

Added line #L775 was not covered by tests
{
$this->customerGroupAssignments = $customerGroupAssignments;

Check warning on line 777 in lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php#L777

Added line #L777 was not covered by tests

return $this;

Check warning on line 779 in lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php#L779

Added line #L779 was not covered by tests
}

/**
* @param ?CustomFieldsDraft $custom
* @return $this
Expand Down Expand Up @@ -821,17 +834,6 @@
return $this;
}

/**
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
* @return $this
*/
public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
{
$this->customerGroupAssignments = $customerGroupAssignments;

return $this;
}

/**
* @deprecated use withAnonymousCart() instead
* @return $this
Expand Down Expand Up @@ -890,12 +892,12 @@
$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
);
}

Expand Down
Loading