From 51dfd04baf1d834449bf1cafb75874d5d9950ae1 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 13 Feb 2023 16:06:16 +0000 Subject: [PATCH 1/7] TASK: Updating SDK --- .../Cart/CartAddItemShippingAddressAction.php | 4 +++ ...artAddItemShippingAddressActionBuilder.php | 4 +++ .../CartAddItemShippingAddressActionModel.php | 4 +++ .../CartUpdateItemShippingAddressAction.php | 4 +++ ...UpdateItemShippingAddressActionBuilder.php | 4 +++ ...rtUpdateItemShippingAddressActionModel.php | 4 +++ .../src/Models/Common/Address.php | 13 ---------- .../src/Models/Common/AddressBuilder.php | 6 +++-- .../src/Models/Common/AddressDraft.php | 26 ------------------- .../src/Models/Common/AddressDraftBuilder.php | 8 +++--- .../src/Models/Common/AddressDraftModel.php | 8 +++--- .../src/Models/Common/AddressModel.php | 6 +++-- .../src/Models/Common/BaseAddress.php | 6 +++-- .../src/Models/Common/BaseAddressBuilder.php | 6 +++-- .../src/Models/Common/BaseAddressModel.php | 6 +++-- .../Me/MyCartAddItemShippingAddressAction.php | 4 +++ ...artAddItemShippingAddressActionBuilder.php | 4 +++ ...yCartAddItemShippingAddressActionModel.php | 4 +++ .../Me/MyCartSetBillingAddressAction.php | 4 +++ .../MyCartSetBillingAddressActionBuilder.php | 4 +++ .../Me/MyCartSetBillingAddressActionModel.php | 4 +++ .../Me/MyCartSetShippingAddressAction.php | 4 +++ .../MyCartSetShippingAddressActionBuilder.php | 4 +++ .../MyCartSetShippingAddressActionModel.php | 4 +++ .../MyCartUpdateItemShippingAddressAction.php | 4 +++ ...UpdateItemShippingAddressActionBuilder.php | 4 +++ ...rtUpdateItemShippingAddressActionModel.php | 4 +++ .../Models/Order/OrderAddDeliveryAction.php | 4 +++ .../Order/OrderAddDeliveryActionBuilder.php | 4 +++ .../Order/OrderAddDeliveryActionModel.php | 4 +++ .../OrderAddItemShippingAddressAction.php | 4 +++ ...derAddItemShippingAddressActionBuilder.php | 4 +++ ...OrderAddItemShippingAddressActionModel.php | 4 +++ .../Order/OrderSetBillingAddressAction.php | 4 +++ .../OrderSetBillingAddressActionBuilder.php | 4 +++ .../OrderSetBillingAddressActionModel.php | 4 +++ .../Order/OrderSetDeliveryAddressAction.php | 4 +++ .../OrderSetDeliveryAddressActionBuilder.php | 4 +++ .../OrderSetDeliveryAddressActionModel.php | 4 +++ .../Order/OrderSetShippingAddressAction.php | 4 +++ .../OrderSetShippingAddressActionBuilder.php | 4 +++ .../OrderSetShippingAddressActionModel.php | 4 +++ .../OrderUpdateItemShippingAddressAction.php | 4 +++ ...UpdateItemShippingAddressActionBuilder.php | 4 +++ ...erUpdateItemShippingAddressActionModel.php | 4 +++ .../StagedOrderAddDeliveryAction.php | 4 +++ .../StagedOrderAddDeliveryActionBuilder.php | 4 +++ .../StagedOrderAddDeliveryActionModel.php | 4 +++ ...tagedOrderAddItemShippingAddressAction.php | 4 +++ ...derAddItemShippingAddressActionBuilder.php | 4 +++ ...OrderAddItemShippingAddressActionModel.php | 4 +++ .../StagedOrderSetBillingAddressAction.php | 4 +++ ...gedOrderSetBillingAddressActionBuilder.php | 4 +++ ...tagedOrderSetBillingAddressActionModel.php | 4 +++ .../StagedOrderSetDeliveryAddressAction.php | 4 +++ ...edOrderSetDeliveryAddressActionBuilder.php | 4 +++ ...agedOrderSetDeliveryAddressActionModel.php | 4 +++ .../StagedOrderSetShippingAddressAction.php | 4 +++ ...edOrderSetShippingAddressActionBuilder.php | 4 +++ ...agedOrderSetShippingAddressActionModel.php | 4 +++ ...ngAddressAndCustomShippingMethodAction.php | 4 +++ ...ssAndCustomShippingMethodActionBuilder.php | 4 +++ ...ressAndCustomShippingMethodActionModel.php | 4 +++ ...ShippingAddressAndShippingMethodAction.php | 4 +++ ...gAddressAndShippingMethodActionBuilder.php | 4 +++ ...ingAddressAndShippingMethodActionModel.php | 4 +++ ...edOrderUpdateItemShippingAddressAction.php | 4 +++ ...UpdateItemShippingAddressActionBuilder.php | 4 +++ ...erUpdateItemShippingAddressActionModel.php | 4 +++ reference.txt | 1 + 70 files changed, 271 insertions(+), 55 deletions(-) create mode 100644 reference.txt diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php index f24fdaea316..255267a80d1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface CartAddItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php index 3cd5db82e77..a29e43b6805 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class CartAddItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php index d8710d64573..5da4d080430 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php index b91cc283e9d..932450074f4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface CartUpdateItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php index 690cbdbfe97..764b961c26d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class CartUpdateItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php index 6ca1057249e..34561186426 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Common/Address.php b/lib/commercetools-api/src/Models/Common/Address.php index a502faf569c..ae31d7fee0c 100644 --- a/lib/commercetools-api/src/Models/Common/Address.php +++ b/lib/commercetools-api/src/Models/Common/Address.php @@ -16,14 +16,6 @@ interface Address extends BaseAddress { public const FIELD_CUSTOM = 'custom'; - /** - *

Unique identifier of the Address.

- * - - * @return null|string - */ - public function getId(); - /** *

Custom Fields defined for the Address.

* @@ -32,11 +24,6 @@ public function getId(); */ public function getCustom(); - /** - * @param ?string $id - */ - public function setId(?string $id): void; - /** * @param ?CustomFields $custom */ diff --git a/lib/commercetools-api/src/Models/Common/AddressBuilder.php b/lib/commercetools-api/src/Models/Common/AddressBuilder.php index 58a04e6c16e..48bd68072d5 100644 --- a/lib/commercetools-api/src/Models/Common/AddressBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AddressBuilder.php @@ -180,6 +180,8 @@ final class AddressBuilder implements Builder /** *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * @return null|string @@ -190,7 +192,7 @@ public function getId() } /** - *

User-defined unique identifier of the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * @return null|string @@ -201,7 +203,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AddressDraft.php b/lib/commercetools-api/src/Models/Common/AddressDraft.php index 66130f5dfe4..35df97b2660 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraft.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraft.php @@ -24,34 +24,8 @@ interface AddressDraft extends BaseAddress */ public function getCustom(); - /** - *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

- * - - * @return null|string - */ - public function getId(); - - /** - *

User-defined unique identifier for the Address.

- * - - * @return null|string - */ - public function getKey(); - /** * @param ?CustomFieldsDraft $custom */ public function setCustom(?CustomFieldsDraft $custom): void; - - /** - * @param ?string $id - */ - public function setId(?string $id): void; - - /** - * @param ?string $key - */ - public function setKey(?string $key): void; } diff --git a/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php b/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php index 32e8e639b20..6efd0ef0617 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php @@ -179,7 +179,9 @@ final class AddressDraftBuilder implements Builder private $custom; /** - *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

+ *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * @return null|string @@ -190,7 +192,7 @@ public function getId() } /** - *

User-defined unique identifier for the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * @return null|string @@ -201,7 +203,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AddressDraftModel.php b/lib/commercetools-api/src/Models/Common/AddressDraftModel.php index 85477532c1f..004b30f41b9 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraftModel.php @@ -238,7 +238,9 @@ public function __construct( } /** - *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

+ *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * * @return null|string @@ -258,7 +260,7 @@ public function getId() } /** - *

User-defined unique identifier for the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * * @return null|string @@ -278,7 +280,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AddressModel.php b/lib/commercetools-api/src/Models/Common/AddressModel.php index a610fd877f9..ad2ddfbdf00 100644 --- a/lib/commercetools-api/src/Models/Common/AddressModel.php +++ b/lib/commercetools-api/src/Models/Common/AddressModel.php @@ -239,6 +239,8 @@ public function __construct( /** *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * * @return null|string @@ -258,7 +260,7 @@ public function getId() } /** - *

User-defined unique identifier of the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * * @return null|string @@ -278,7 +280,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/BaseAddress.php b/lib/commercetools-api/src/Models/Common/BaseAddress.php index b2e1bde3eb2..5a58403ce6b 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddress.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddress.php @@ -41,6 +41,8 @@ interface BaseAddress extends JsonObject /** *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * @return null|string @@ -48,7 +50,7 @@ interface BaseAddress extends JsonObject public function getId(); /** - *

User-defined unique identifier of the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * @return null|string @@ -56,7 +58,7 @@ public function getId(); public function getKey(); /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php b/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php index b4819928343..52901f0dd78 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php @@ -172,6 +172,8 @@ final class BaseAddressBuilder implements Builder /** *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * @return null|string @@ -182,7 +184,7 @@ public function getId() } /** - *

User-defined unique identifier of the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * @return null|string @@ -193,7 +195,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/BaseAddressModel.php b/lib/commercetools-api/src/Models/Common/BaseAddressModel.php index 3f81e2082d2..65d243dacf9 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddressModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddressModel.php @@ -229,6 +229,8 @@ public function __construct( /** *

Unique identifier of the Address.

+ *

It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. + * Use key instead and omit this field from the request to let the API generate the ID for the Address.

* * * @return null|string @@ -248,7 +250,7 @@ public function getId() } /** - *

User-defined unique identifier of the Address.

+ *

User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

* * * @return null|string @@ -268,7 +270,7 @@ public function getKey() } /** - *

Two-digit country code as per ISO 3166-1 alpha-2.

+ *

Name of the country.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php index 662844964a4..1cf31e327c1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface MyCartAddItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php index 8accc65d2ba..9164839b65e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class MyCartAddItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php index 111f9edfa1a..445a46f601e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php index 82e6ddb1b51..a3c6a69ce0f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php @@ -17,6 +17,10 @@ interface MyCartSetBillingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php index d1b2d7768be..49aafe4ffbb 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class MyCartSetBillingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php index 50d510ee3f9..691dbd6151e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php index fc10f4ec40a..38bab918d1a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php @@ -17,6 +17,10 @@ interface MyCartSetShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php index ffe1ac59781..034865bf26b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class MyCartSetShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php index 28d22c8845e..e3498ea8a4b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php index cba027812e8..e69f84d21e4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface MyCartUpdateItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php index fe378251dc4..a64242ce94f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class MyCartUpdateItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php index cc0855d394e..d2e76b4971b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php index 48befa9f6a2..997387d23a7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php @@ -36,6 +36,10 @@ public function getItems(); public function getShippingKey(); /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php index da7f1cf9160..9798834eb29 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php @@ -75,6 +75,10 @@ public function getShippingKey() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php index 263345326b6..cbe8a2ef551 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php @@ -137,6 +137,10 @@ public function getShippingKey() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php index fd1b33e690f..7f7d67059bd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface OrderAddItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php index a6061a1ee45..06f282b8b46 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class OrderAddItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php index 09e812a4f72..92f4c219ee0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php index efd35e7c0b6..bc94493608a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php @@ -17,6 +17,10 @@ interface OrderSetBillingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php index 936fa7779f4..c019967778c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class OrderSetBillingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php index 5ea3f2789a6..1a5b0b17b06 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php index 63827404ec7..d1b645d6edc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php @@ -24,6 +24,10 @@ interface OrderSetDeliveryAddressAction extends OrderUpdateAction public function getDeliveryId(); /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php index 2618b40021d..e43a6ec9571 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php @@ -44,6 +44,10 @@ public function getDeliveryId() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php index c6208bd350d..059063951b6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php @@ -91,6 +91,10 @@ public function getDeliveryId() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php index a1460cb7c4b..7972cb35a0e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php @@ -17,6 +17,10 @@ interface OrderSetShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php index 51453bcdd15..10107a9f5b2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class OrderSetShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php index db9d0519b03..c26bb94ebcb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php index 87ab6841bd0..d6f9264a917 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php @@ -17,6 +17,10 @@ interface OrderUpdateItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php index d0428caa7a0..2c3af8537d1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php @@ -29,6 +29,10 @@ final class OrderUpdateItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php index 6e5b838c41f..2f4f092559b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php index 3ffd52dd926..1533ed836ae 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php @@ -30,6 +30,10 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction public function getItems(); /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php index c4699da39c0..cd533bc954d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php @@ -62,6 +62,10 @@ public function getItems() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php index d4f8734e981..9ac8dfc3d62 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php @@ -113,6 +113,10 @@ public function getItems() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php index af5bedb4829..b13489f8f0d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php @@ -18,6 +18,10 @@ interface StagedOrderAddItemShippingAddressAction extends StagedOrderUpdateActio public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php index b5af2f4ae99..10480817cee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php @@ -31,6 +31,10 @@ final class StagedOrderAddItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php index 12613bcc461..9ad5432b75d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php @@ -67,6 +67,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php index a9682d33aff..278ec8be282 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php @@ -18,6 +18,10 @@ interface StagedOrderSetBillingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php index 59d60d935ee..813cdeea9cd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php @@ -31,6 +31,10 @@ final class StagedOrderSetBillingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php index 0e35ceb9f51..29b4b9df4b1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php @@ -67,6 +67,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php index d31ac0ec842..eb140268a3e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php @@ -25,6 +25,10 @@ interface StagedOrderSetDeliveryAddressAction extends StagedOrderUpdateAction public function getDeliveryId(); /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php index 02eeeabf133..402c60c9816 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php @@ -46,6 +46,10 @@ public function getDeliveryId() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php index 1d541eca1c3..ab544c3d1ff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php @@ -93,6 +93,10 @@ public function getDeliveryId() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php index cc94d1e31ad..710f148ce16 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php @@ -18,6 +18,10 @@ interface StagedOrderSetShippingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php index 6a9aa00b2a4..526c670424c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php @@ -31,6 +31,10 @@ final class StagedOrderSetShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php index 9a0a5f8de95..e2be7a9c8d4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php @@ -67,6 +67,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php index b72cba4a626..e3f9c17d9dc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php @@ -25,6 +25,10 @@ interface StagedOrderSetShippingAddressAndCustomShippingMethodAction extends Sta public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php index ed5a3956fac..dd123818407 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php @@ -61,6 +61,10 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder im private $externalTaxRate; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php index faf1ea62214..bf6384dbbf3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php @@ -105,6 +105,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php index db11c4cf6cf..8095ac422d4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php @@ -22,6 +22,10 @@ interface StagedOrderSetShippingAddressAndShippingMethodAction extends StagedOrd public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php index 547c89f12ea..b9530a731a9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php @@ -47,6 +47,10 @@ final class StagedOrderSetShippingAddressAndShippingMethodActionBuilder implemen private $externalTaxRate; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php index 79d7f1dad42..de596d779b2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php @@ -87,6 +87,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php index f9d6e9a4642..e5bc8635692 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php @@ -18,6 +18,10 @@ interface StagedOrderUpdateItemShippingAddressAction extends StagedOrderUpdateAc public const FIELD_ADDRESS = 'address'; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php index 5bdaa79b265..e5b73d8eff5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php @@ -31,6 +31,10 @@ final class StagedOrderUpdateItemShippingAddressActionBuilder implements Builder private $address; /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php index c9946468d8a..bc65df9a36e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php @@ -67,6 +67,10 @@ public function getAction() } /** + *

Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either Address or AddressDraft that + * only differ in the data type for the optional custom field.

+ * * * @return null|BaseAddress */ diff --git a/reference.txt b/reference.txt new file mode 100644 index 00000000000..d7e8758b32e --- /dev/null +++ b/reference.txt @@ -0,0 +1 @@ +63fa4bf822237cbb485fd54cb6cd85d5d3e15dec From 56579d259d82f3e2cb556697c55953e2f6fc95c3 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 16 Feb 2023 14:08:47 +0000 Subject: [PATCH 2/7] TASK: Updating SDK --- changes.md | 199 +----------------- ...ctKeyProductSelectionsByIDProductsTest.php | 13 ++ ...yProductSelectionsKeyByKeyProductsTest.php | 13 ++ ...ectKeyProductSelectionsByIDProductsGet.php | 12 +- ...eyProductSelectionsKeyByKeyProductsGet.php | 12 +- 5 files changed, 51 insertions(+), 198 deletions(-) diff --git a/changes.md b/changes.md index 45e86995974..10b971493ef 100644 --- a/changes.md +++ b/changes.md @@ -1,202 +1,9 @@ **Api changes**
-Added Resource(s) +Added QueryParameter(s) -- added resource `/{projectKey}/shipping-methods/matching-cart-location` -
- - -
-Added Enum(s) - -- added enum `Frozen` to type `CartState` -
- - -
-Changed Property(s) - -- :warning: changed property `stores` of type `BusinessUnitDraft` from type `StoreKeyReference[]` to `StoreResourceIdentifier[]` -- :warning: changed property `stores` of type `CompanyDraft` from type `StoreKeyReference[]` to `StoreResourceIdentifier[]` -- :warning: changed property `stores` of type `DivisionDraft` from type `StoreKeyReference[]` to `StoreResourceIdentifier[]` -- :warning: changed property `amount` of type `Transaction` from type `TypedMoney` to `CentPrecisionMoney` -- :warning: changed property `assets` of type `ProductAddVariantAction` from type `Asset[]` to `AssetDraft[]` -
- - -
-Required Property(s) - -- changed property `discounted` of type `StagedStandalonePrice` to be optional -
- - -
-Added Property(s) - -- added property `defaultShippingAddressId` to type `BusinessUnit` -- added property `defaultShippingAddress` to type `BusinessUnitDraft` -- added property `defaultShippingAddressId` to type `Company` -- added property `defaultShippingAddress` to type `CompanyDraft` -- added property `defaultShippingAddressId` to type `Division` -- added property `defaultShippingAddress` to type `DivisionDraft` -- added property `conflictingPrice` to type `DuplicatePriceScopeError` -- added property `defaultShippingAddress` to type `MyBusinessUnitDraft` -- added property `defaultShippingAddress` to type `MyCompanyDraft` -- added property `defaultShippingAddress` to type `MyDivisionDraft` -- added property `cartId` to type `MyQuoteRequestDraft` -- added property `cartVersion` to type `MyQuoteRequestDraft` -- added property `oldValue` to type `StandalonePriceValueChangedMessage` -- added property `oldValue` to type `StandalonePriceValueChangedMessagePayload` -- added property `purchaseOrderNumber` to type `StagedOrder` -- added property `purchaseOrderNumber` to type `Order` -- added property `purchaseOrderNumber` to type `OrderFromCartDraft` -- added property `createdAt` to type `AssignedProductSelection` -- added property `purchaseOrderNumber` to type `QuoteRequest` -- added property `purchaseOrderNumber` to type `QuoteRequestDraft` -- added property `quoteState` to type `Quote` -- added property `purchaseOrderNumber` to type `Quote` -- added property `purchaseOrderNumber` to type `StagedQuote` -
- - -
-Removed Property(s) - -- :warning: removed property `defaultShipingAddressId` from type `BusinessUnit` -- :warning: removed property `defaultShipingAddress` from type `BusinessUnitDraft` -- :warning: removed property `defaultShipingAddressId` from type `Company` -- :warning: removed property `defaultShipingAddress` from type `CompanyDraft` -- :warning: removed property `defaultShipingAddressId` from type `Division` -- :warning: removed property `defaultShipingAddress` from type `DivisionDraft` -- :warning: removed property `conflictingPrices` from type `DuplicatePriceScopeError` -- :warning: removed property `defaultShipingAddress` from type `MyBusinessUnitDraft` -- :warning: removed property `defaultShipingAddress` from type `MyCompanyDraft` -- :warning: removed property `defaultShipingAddress` from type `MyDivisionDraft` -- :warning: removed property `cart` from type `MyQuoteRequestDraft` -- :warning: removed property `version` from type `MyQuoteRequestDraft` -
- - -
-Deprecated Type(s) - -- type `IronMqDestination` is removed -
- - -
-Added Type(s) - -- added type `CartFreezeCartAction` -- added type `CartUnfreezeCartAction` -- added type `DuplicatePriceKeyError` -- added type `OrderPurchaseOrderNumberSetMessage` -- added type `ProductPriceAddedMessage` -- added type `ProductPriceChangedMessage` -- added type `ProductPriceKeySetMessage` -- added type `ProductPriceModeSetMessage` -- added type `ProductPriceRemovedMessage` -- added type `ProductPricesSetMessage` -- added type `StandalonePriceKeySetMessage` -- added type `OrderPurchaseOrderNumberSetMessagePayload` -- added type `ProductPriceAddedMessagePayload` -- added type `ProductPriceChangedMessagePayload` -- added type `ProductPriceKeySetMessagePayload` -- added type `ProductPriceModeSetMessagePayload` -- added type `ProductPriceRemovedMessagePayload` -- added type `ProductPricesSetMessagePayload` -- added type `StandalonePriceKeySetMessagePayload` -- added type `StagedOrderSetPurchaseOrderNumberAction` -- added type `OrderSetPurchaseOrderNumberAction` -- added type `ProductSetPriceKeyAction` -- added type `StandalonePriceSetKeyAction` -
- - -
-Added Method(s) - -- added method `$apiRoot->withProjectKey()->shippingMethods()->matchingCartLocation()->get()` -
- -**ML changes** - -
-Deprecated Type(s) - -- type `AttributeCount` is removed -- type `AttributeCoverage` is removed -- type `MissingAttributesDetails` is removed -- type `MissingAttributes` is removed -- type `MissingAttributesMeta` is removed -- type `MissingAttributesSearchRequest` is removed -- type `MissingAttributesPagedQueryResult` is removed -- type `MissingDataTaskStatus` is removed -- type `MissingImages` is removed -- type `MissingImagesCount` is removed -- type `MissingImagesProductLevel` is removed -- type `MissingImagesVariantLevel` is removed -- type `MissingImagesMeta` is removed -- type `MissingImagesSearchRequest` is removed -- type `MissingImagesPagedQueryResult` is removed -- type `MissingImagesTaskStatus` is removed -- type `MissingPrices` is removed -- type `MissingPricesProductCount` is removed -- type `MissingPricesProductLevel` is removed -- type `MissingPricesVariantLevel` is removed -- type `MissingPricesMeta` is removed -- type `MissingPricesSearchRequest` is removed -- type `MissingPricesPagedQueryResult` is removed -- type `MissingPricesTaskStatus` is removed -
- - -
-Deprecated Resource(s) - -- resource `/{projectKey}/missing-data` is removed -- resource `/{projectKey}/missing-data/attributes` is removed -- resource `/{projectKey}/missing-data/images` is removed -- resource `/{projectKey}/missing-data/prices` is removed -- resource `/{projectKey}/missing-data/attributes/status` is removed -- resource `/{projectKey}/missing-data/attributes/status/{taskId}` is removed -- resource `/{projectKey}/missing-data/images/status` is removed -- resource `/{projectKey}/missing-data/images/status/{taskId}` is removed -- resource `/{projectKey}/missing-data/prices/status` is removed -- resource `/{projectKey}/missing-data/prices/status/{taskId}` is removed -
- - -
-Deprecated Method(s) - -- method `post /{projectKey}/missing-data/attributes` is removed -- method `post /{projectKey}/missing-data/images` is removed -- method `post /{projectKey}/missing-data/prices` is removed -- method `get /{projectKey}/missing-data/attributes/status/{taskId}` is removed -- method `get /{projectKey}/missing-data/images/status/{taskId}` is removed -- method `get /{projectKey}/missing-data/prices/status/{taskId}` is removed -
- - -
-Deprecated Property(s) - -- property `MissingAttributes::attributeCount` is removed -- property `MissingAttributes::attributeCoverage` is removed -- property `MissingAttributesMeta::productLevel` is removed -- property `MissingAttributesMeta::variantLevel` is removed -- property `MissingAttributesPagedQueryResult::meta` is removed -- property `MissingDataTaskStatus::result` is removed -- property `MissingImagesMeta::productLevel` is removed -- property `MissingImagesMeta::variantLevel` is removed -- property `MissingImagesPagedQueryResult::meta` is removed -- property `MissingImagesTaskStatus::result` is removed -- property `MissingPricesMeta::productLevel` is removed -- property `MissingPricesMeta::variantLevel` is removed -- property `MissingPricesPagedQueryResult::meta` is removed -- property `MissingPricesTaskStatus::result` is removed +- added query parameter `sort` to method `get /{projectKey}/product-selections/key={key}/products` +- added query parameter `sort` to method `get /{projectKey}/product-selections/{ID}/products`
diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsByIDProductsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsByIDProductsTest.php index b7d48378a65..482d629c83a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsByIDProductsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsByIDProductsTest.php @@ -142,6 +142,19 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-selections/test_ID/products?withTotal=withTotal', ], + 'ByProjectKeyProductSelectionsByIDProductsGet_withSort' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productSelections() + ->withId('test_ID') + ->products() + ->get() + ->withSort('sort'); + }, + 'get', + 'test_projectKey/product-selections/test_ID/products?sort=sort', + ], 'ByProjectKeyProductSelectionsByIDProductsGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsKeyByKeyProductsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsKeyByKeyProductsTest.php index 579dede2d89..437e23d4f0a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsKeyByKeyProductsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductSelectionsKeyByKeyProductsTest.php @@ -142,6 +142,19 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-selections/key=test_key/products?withTotal=withTotal', ], + 'ByProjectKeyProductSelectionsKeyByKeyProductsGet_withSort' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productSelections() + ->withKey('test_key') + ->products() + ->get() + ->withSort('sort'); + }, + 'get', + 'test_projectKey/product-selections/key=test_key/products?sort=sort', + ], 'ByProjectKeyProductSelectionsKeyByKeyProductsGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php index 93bc34125d4..6ed040f941f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php @@ -32,10 +32,11 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Paging + * @template-implements Sortable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductSelectionsByIDProductsGet extends ApiRequest implements Expandable, Paging, Errorable, Deprecatable200 +class ByProjectKeyProductSelectionsByIDProductsGet extends ApiRequest implements Expandable, Paging, Sortable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -180,4 +181,13 @@ public function withWithTotal($withTotal): ByProjectKeyProductSelectionsByIDProd { return $this->withQueryParam('withTotal', $withTotal); } + + /** + * + * @psalm-param scalar|scalar[] $sort + */ + public function withSort($sort): ByProjectKeyProductSelectionsByIDProductsGet + { + return $this->withQueryParam('sort', $sort); + } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php index 035747cdf6e..6204d0d2472 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php @@ -32,10 +32,11 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Paging + * @template-implements Sortable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductSelectionsKeyByKeyProductsGet extends ApiRequest implements Expandable, Paging, Errorable, Deprecatable200 +class ByProjectKeyProductSelectionsKeyByKeyProductsGet extends ApiRequest implements Expandable, Paging, Sortable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -180,4 +181,13 @@ public function withWithTotal($withTotal): ByProjectKeyProductSelectionsKeyByKey { return $this->withQueryParam('withTotal', $withTotal); } + + /** + * + * @psalm-param scalar|scalar[] $sort + */ + public function withSort($sort): ByProjectKeyProductSelectionsKeyByKeyProductsGet + { + return $this->withQueryParam('sort', $sort); + } } From 345875f73dd073dfbfb2165ab843c7944b73bc53 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 17 Feb 2023 08:17:28 +0000 Subject: [PATCH 3/7] TASK: Updating SDK --- changes.md | 7 ++ .../Extension/ExtensionDestinationModel.php | 1 + .../GoogleCloudFunctionDestination.php | 30 ++++++ .../GoogleCloudFunctionDestinationBuilder.php | 63 +++++++++++++ ...ogleCloudFunctionDestinationCollection.php | 56 +++++++++++ .../GoogleCloudFunctionDestinationModel.php | 93 +++++++++++++++++++ 6 files changed, 250 insertions(+) create mode 100644 lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestination.php create mode 100644 lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationBuilder.php create mode 100644 lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationCollection.php create mode 100644 lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationModel.php diff --git a/changes.md b/changes.md index 10b971493ef..e6b80734abe 100644 --- a/changes.md +++ b/changes.md @@ -7,3 +7,10 @@ - added query parameter `sort` to method `get /{projectKey}/product-selections/{ID}/products` + +
+Added Type(s) + +- added type `GoogleCloudFunctionDestination` +
+ diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php index f966d24934d..a1883f3d37c 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php @@ -32,6 +32,7 @@ final class ExtensionDestinationModel extends JsonObjectModel implements Extensi */ private static $discriminatorClasses = [ 'AWSLambda' => AWSLambdaDestinationModel::class, + 'GoogleCloudFunction' => GoogleCloudFunctionDestinationModel::class, 'HTTP' => HttpDestinationModel::class, ]; diff --git a/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestination.php b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestination.php new file mode 100644 index 00000000000..6c4e0090ea4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestination.php @@ -0,0 +1,30 @@ +URL to the target function.

+ * + + * @return null|string + */ + public function getUrl(); + + /** + * @param ?string $url + */ + public function setUrl(?string $url): void; +} diff --git a/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationBuilder.php b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationBuilder.php new file mode 100644 index 00000000000..ba5fcd5d77e --- /dev/null +++ b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationBuilder.php @@ -0,0 +1,63 @@ + + */ +final class GoogleCloudFunctionDestinationBuilder implements Builder +{ + /** + + * @var ?string + */ + private $url; + + /** + *

URL to the target function.

+ * + + * @return null|string + */ + public function getUrl() + { + return $this->url; + } + + /** + * @param ?string $url + * @return $this + */ + public function withUrl(?string $url) + { + $this->url = $url; + + return $this; + } + + + public function build(): GoogleCloudFunctionDestination + { + return new GoogleCloudFunctionDestinationModel( + $this->url + ); + } + + public static function of(): GoogleCloudFunctionDestinationBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationCollection.php b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationCollection.php new file mode 100644 index 00000000000..4198a0dd3bb --- /dev/null +++ b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationCollection.php @@ -0,0 +1,56 @@ + + * @method GoogleCloudFunctionDestination current() + * @method GoogleCloudFunctionDestination end() + * @method GoogleCloudFunctionDestination at($offset) + */ +class GoogleCloudFunctionDestinationCollection extends ExtensionDestinationCollection +{ + /** + * @psalm-assert GoogleCloudFunctionDestination $value + * @psalm-param GoogleCloudFunctionDestination|stdClass $value + * @throws InvalidArgumentException + * + * @return GoogleCloudFunctionDestinationCollection + */ + public function add($value) + { + if (!$value instanceof GoogleCloudFunctionDestination) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GoogleCloudFunctionDestination + */ + protected function mapper() + { + return function (?int $index): ?GoogleCloudFunctionDestination { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GoogleCloudFunctionDestination $data */ + $data = GoogleCloudFunctionDestinationModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationModel.php b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationModel.php new file mode 100644 index 00000000000..fdc9408bd67 --- /dev/null +++ b/lib/commercetools-api/src/Models/Extension/GoogleCloudFunctionDestinationModel.php @@ -0,0 +1,93 @@ +url = $url; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

URL to the target function.

+ * + * + * @return null|string + */ + public function getUrl() + { + if (is_null($this->url)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_URL); + if (is_null($data)) { + return null; + } + $this->url = (string) $data; + } + + return $this->url; + } + + + /** + * @param ?string $url + */ + public function setUrl(?string $url): void + { + $this->url = $url; + } +} From 3e034f9bef93cb8d77735c3cb21226adf6d5037d Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 28 Feb 2023 10:19:14 +0000 Subject: [PATCH 4/7] TASK: Updating SDK --- changes.md | 10 +++++----- .../src/Models/ShoppingList/ShoppingListLineItem.php | 10 ++++------ .../ShoppingList/ShoppingListLineItemBuilder.php | 10 ++++------ .../Models/ShoppingList/ShoppingListLineItemModel.php | 10 ++++------ lib/commercetools-import/docs/RequestBuilder.md | 2 +- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/changes.md b/changes.md index e6b80734abe..71395c4008c 100644 --- a/changes.md +++ b/changes.md @@ -1,16 +1,16 @@ **Api changes**
-Added QueryParameter(s) +Added Type(s) -- added query parameter `sort` to method `get /{projectKey}/product-selections/key={key}/products` -- added query parameter `sort` to method `get /{projectKey}/product-selections/{ID}/products` +- added type `GoogleCloudFunctionDestination`
-Added Type(s) +Added QueryParameter(s) -- added type `GoogleCloudFunctionDestination` +- added query parameter `sort` to method `get /{projectKey}/product-selections/key={key}/products` +- added query parameter `sort` to method `get /{projectKey}/product-selections/{ID}/products`
diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php index 57fcef37d2e..75873d5fccf 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php @@ -105,9 +105,8 @@ public function getQuantity(); public function getVariantId(); /** - *

Data of the ProductVariant. - * Returned when expanded using expand=lineItems[*].variant.

- *

Limitation: expand=lineItems[0].variant is not supported.

+ *

Data of the ProductVariant.

+ *

Returned when expanded using expand=lineItems[*].variant. You cannot expand only a single element of the array.

* * @return null|ProductVariant @@ -115,9 +114,8 @@ public function getVariantId(); public function getVariant(); /** - *

Slug of the current ProductData. - * Only returned when expanded using expand=lineItems[*].productSlug.

- *

Limitation: expand=lineItems[0].productSlug is not supported.

+ *

Slug of the current ProductData.

+ *

Returned when expanded using expand=lineItems[*].productSlug. You cannot expand only a single element of the array.

* * @return null|LocalizedString diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php index ae79cb5a126..bb56c87384b 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php @@ -197,9 +197,8 @@ public function getVariantId() } /** - *

Data of the ProductVariant. - * Returned when expanded using expand=lineItems[*].variant.

- *

Limitation: expand=lineItems[0].variant is not supported.

+ *

Data of the ProductVariant.

+ *

Returned when expanded using expand=lineItems[*].variant. You cannot expand only a single element of the array.

* * @return null|ProductVariant @@ -210,9 +209,8 @@ public function getVariant() } /** - *

Slug of the current ProductData. - * Only returned when expanded using expand=lineItems[*].productSlug.

- *

Limitation: expand=lineItems[0].productSlug is not supported.

+ *

Slug of the current ProductData.

+ *

Returned when expanded using expand=lineItems[*].productSlug. You cannot expand only a single element of the array.

* * @return null|LocalizedString diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php index 143a76b0b7f..a33dd44f8a1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php @@ -318,9 +318,8 @@ public function getVariantId() } /** - *

Data of the ProductVariant. - * Returned when expanded using expand=lineItems[*].variant.

- *

Limitation: expand=lineItems[0].variant is not supported.

+ *

Data of the ProductVariant.

+ *

Returned when expanded using expand=lineItems[*].variant. You cannot expand only a single element of the array.

* * * @return null|ProductVariant @@ -341,9 +340,8 @@ public function getVariant() } /** - *

Slug of the current ProductData. - * Only returned when expanded using expand=lineItems[*].productSlug.

- *

Limitation: expand=lineItems[0].productSlug is not supported.

+ *

Slug of the current ProductData.

+ *

Returned when expanded using expand=lineItems[*].productSlug. You cannot expand only a single element of the array.

* * * @return null|LocalizedString diff --git a/lib/commercetools-import/docs/RequestBuilder.md b/lib/commercetools-import/docs/RequestBuilder.md index 2d01cc8502c..0a2ffb82bdd 100644 --- a/lib/commercetools-import/docs/RequestBuilder.md +++ b/lib/commercetools-import/docs/RequestBuilder.md @@ -197,7 +197,7 @@ $request = $builder ``` ## `withProjectKeyValue("projectKey")->orders()->importContainers()->withImportContainerKeyValue("importContainerKey")->post(null)` -Creates a request for creating new Orders or updating existing ones. +Creates a request for creating new Orders. ### Example ```php From 6cfebe4f2b0066c91e880d3575bbe4ad4b40e807 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 28 Feb 2023 14:50:06 +0000 Subject: [PATCH 5/7] TASK: Updating SDK --- changes.md | 99 +++ ...eyInStoreKeyByStoreKeyMeActiveCartTest.php | 13 + ...ResourceByProjectKeyMeOrdersQuotesTest.php | 157 ++++ .../ResourceByProjectKeyMeOrdersTest.php | 13 + lib/commercetools-api/docs/RequestBuilder.md | 142 ++-- ...KeyInStoreKeyByStoreKeyMeActiveCartGet.php | 12 +- .../ByProjectKeyMeOrdersQuotesPost.php | 118 +++ .../Resource/ResourceByProjectKeyMeOrders.php | 8 + .../ResourceByProjectKeyMeOrdersQuotes.php | 39 + .../src/Models/Cart/Cart.php | 378 +++++---- .../Cart/CartAddCustomLineItemAction.php | 50 +- .../CartAddCustomLineItemActionBuilder.php | 104 ++- .../Cart/CartAddCustomLineItemActionModel.php | 103 ++- .../CartAddCustomShippingMethodAction.php | 37 +- ...rtAddCustomShippingMethodActionBuilder.php | 74 +- ...CartAddCustomShippingMethodActionModel.php | 62 +- .../Models/Cart/CartAddDiscountCodeAction.php | 2 + .../Cart/CartAddDiscountCodeActionBuilder.php | 2 + .../Cart/CartAddDiscountCodeActionModel.php | 2 + .../Cart/CartAddItemShippingAddressAction.php | 5 +- ...artAddItemShippingAddressActionBuilder.php | 5 +- .../CartAddItemShippingAddressActionModel.php | 5 +- .../src/Models/Cart/CartAddLineItemAction.php | 94 ++- .../Cart/CartAddLineItemActionBuilder.php | 194 +++-- .../Cart/CartAddLineItemActionModel.php | 230 +++--- .../src/Models/Cart/CartAddPaymentAction.php | 3 + .../Cart/CartAddPaymentActionBuilder.php | 3 + .../Models/Cart/CartAddPaymentActionModel.php | 3 + .../Cart/CartAddShippingMethodAction.php | 49 +- .../CartAddShippingMethodActionBuilder.php | 96 ++- .../Cart/CartAddShippingMethodActionModel.php | 82 +- .../Models/Cart/CartAddShoppingListAction.php | 22 +- .../Cart/CartAddShoppingListActionBuilder.php | 48 +- .../Cart/CartAddShoppingListActionModel.php | 48 +- ...omLineItemShippingDetailsTargetsAction.php | 4 + ...temShippingDetailsTargetsActionBuilder.php | 4 + ...eItemShippingDetailsTargetsActionModel.php | 4 + ...ToLineItemShippingDetailsTargetsAction.php | 4 + ...temShippingDetailsTargetsActionBuilder.php | 4 + ...eItemShippingDetailsTargetsActionModel.php | 4 + .../src/Models/Cart/CartBuilder.php | 602 +++++++------- .../CartChangeCustomLineItemMoneyAction.php | 5 +- ...ChangeCustomLineItemMoneyActionBuilder.php | 5 +- ...rtChangeCustomLineItemMoneyActionModel.php | 5 +- ...artChangeCustomLineItemPriceModeAction.php | 4 +- ...geCustomLineItemPriceModeActionBuilder.php | 4 +- ...angeCustomLineItemPriceModeActionModel.php | 4 +- ...CartChangeCustomLineItemQuantityAction.php | 5 + ...ngeCustomLineItemQuantityActionBuilder.php | 5 + ...hangeCustomLineItemQuantityActionModel.php | 5 + .../Cart/CartChangeLineItemQuantityAction.php | 11 +- ...artChangeLineItemQuantityActionBuilder.php | 11 +- .../CartChangeLineItemQuantityActionModel.php | 11 +- .../CartChangeTaxCalculationModeAction.php | 2 + ...tChangeTaxCalculationModeActionBuilder.php | 2 + ...artChangeTaxCalculationModeActionModel.php | 2 + .../Models/Cart/CartChangeTaxModeAction.php | 2 + .../Cart/CartChangeTaxModeActionBuilder.php | 2 + .../Cart/CartChangeTaxModeActionModel.php | 2 + .../Cart/CartChangeTaxRoundingModeAction.php | 2 + ...CartChangeTaxRoundingModeActionBuilder.php | 2 + .../CartChangeTaxRoundingModeActionModel.php | 2 + .../src/Models/Cart/CartDraft.php | 248 +++--- .../src/Models/Cart/CartDraftBuilder.php | 430 +++++----- .../src/Models/Cart/CartDraftModel.php | 556 +++++++------ .../src/Models/Cart/CartModel.php | 780 +++++++++--------- .../Models/Cart/CartPagedQueryResponse.php | 30 +- .../Cart/CartPagedQueryResponseBuilder.php | 50 +- .../Cart/CartPagedQueryResponseModel.php | 68 +- .../src/Models/Cart/CartRecalculateAction.php | 7 +- .../Cart/CartRecalculateActionBuilder.php | 7 +- .../Cart/CartRecalculateActionModel.php | 7 +- .../Cart/CartRemoveCustomLineItemAction.php | 2 + .../CartRemoveCustomLineItemActionBuilder.php | 2 + .../CartRemoveCustomLineItemActionModel.php | 2 + .../Cart/CartRemoveDiscountCodeAction.php | 2 +- .../CartRemoveDiscountCodeActionBuilder.php | 2 +- .../CartRemoveDiscountCodeActionModel.php | 2 +- .../CartRemoveItemShippingAddressAction.php | 2 + ...RemoveItemShippingAddressActionBuilder.php | 2 + ...rtRemoveItemShippingAddressActionModel.php | 2 + .../Models/Cart/CartRemoveLineItemAction.php | 12 +- .../Cart/CartRemoveLineItemActionBuilder.php | 12 +- .../Cart/CartRemoveLineItemActionModel.php | 12 +- .../Models/Cart/CartRemovePaymentAction.php | 2 + .../Cart/CartRemovePaymentActionBuilder.php | 2 + .../Cart/CartRemovePaymentActionModel.php | 2 + .../Cart/CartRemoveShippingMethodAction.php | 2 +- .../CartRemoveShippingMethodActionBuilder.php | 2 +- .../CartRemoveShippingMethodActionModel.php | 2 +- .../Models/Cart/CartSetAnonymousIdAction.php | 3 +- .../Cart/CartSetAnonymousIdActionBuilder.php | 3 +- .../Cart/CartSetAnonymousIdActionModel.php | 3 +- .../Cart/CartSetBillingAddressAction.php | 3 + .../CartSetBillingAddressActionBuilder.php | 3 + .../Cart/CartSetBillingAddressActionModel.php | 3 + .../Models/Cart/CartSetBusinessUnitAction.php | 31 + .../Cart/CartSetBusinessUnitActionBuilder.php | 75 ++ .../CartSetBusinessUnitActionCollection.php | 56 ++ .../Cart/CartSetBusinessUnitActionModel.php | 96 +++ .../Models/Cart/CartSetCartTotalTaxAction.php | 4 +- .../Cart/CartSetCartTotalTaxActionBuilder.php | 4 +- .../Cart/CartSetCartTotalTaxActionModel.php | 4 +- .../src/Models/Cart/CartSetCountryAction.php | 5 +- .../Cart/CartSetCountryActionBuilder.php | 5 +- .../Models/Cart/CartSetCountryActionModel.php | 5 +- ...CartSetCustomLineItemCustomFieldAction.php | 2 + ...CustomLineItemCustomFieldActionBuilder.php | 2 + ...etCustomLineItemCustomFieldActionModel.php | 2 + .../CartSetCustomLineItemCustomTypeAction.php | 2 + ...tCustomLineItemCustomTypeActionBuilder.php | 2 + ...SetCustomLineItemCustomTypeActionModel.php | 2 + ...SetCustomLineItemShippingDetailsAction.php | 5 + ...omLineItemShippingDetailsActionBuilder.php | 5 + ...stomLineItemShippingDetailsActionModel.php | 5 + .../CartSetCustomLineItemTaxAmountAction.php | 5 + ...etCustomLineItemTaxAmountActionBuilder.php | 5 + ...tSetCustomLineItemTaxAmountActionModel.php | 5 + .../CartSetCustomLineItemTaxRateAction.php | 5 + ...tSetCustomLineItemTaxRateActionBuilder.php | 5 + ...artSetCustomLineItemTaxRateActionModel.php | 5 + .../CartSetCustomShippingMethodAction.php | 8 +- ...rtSetCustomShippingMethodActionBuilder.php | 8 +- ...CartSetCustomShippingMethodActionModel.php | 8 +- .../Cart/CartSetCustomerEmailAction.php | 3 + .../CartSetCustomerEmailActionBuilder.php | 3 + .../Cart/CartSetCustomerEmailActionModel.php | 3 + .../Cart/CartSetCustomerGroupAction.php | 3 +- .../CartSetCustomerGroupActionBuilder.php | 3 +- .../Cart/CartSetCustomerGroupActionModel.php | 3 +- .../Models/Cart/CartSetCustomerIdAction.php | 2 +- .../Cart/CartSetCustomerIdActionBuilder.php | 2 +- .../Cart/CartSetCustomerIdActionModel.php | 2 +- ...tDeleteDaysAfterLastModificationAction.php | 3 + ...DaysAfterLastModificationActionBuilder.php | 3 + ...teDaysAfterLastModificationActionModel.php | 3 + ...artSetDeliveryAddressCustomFieldAction.php | 2 + ...eliveryAddressCustomFieldActionBuilder.php | 2 + ...tDeliveryAddressCustomFieldActionModel.php | 2 + ...CartSetDeliveryAddressCustomTypeAction.php | 8 +- ...DeliveryAddressCustomTypeActionBuilder.php | 8 +- ...etDeliveryAddressCustomTypeActionModel.php | 8 +- .../Cart/CartSetDirectDiscountsAction.php | 6 + .../CartSetDirectDiscountsActionBuilder.php | 6 + .../CartSetDirectDiscountsActionModel.php | 6 + ...etItemShippingAddressCustomFieldAction.php | 2 + ...hippingAddressCustomFieldActionBuilder.php | 2 + ...mShippingAddressCustomFieldActionModel.php | 2 + ...SetItemShippingAddressCustomTypeAction.php | 2 + ...ShippingAddressCustomTypeActionBuilder.php | 2 + ...emShippingAddressCustomTypeActionModel.php | 2 + .../src/Models/Cart/CartSetKeyAction.php | 3 + .../Models/Cart/CartSetKeyActionBuilder.php | 3 + .../src/Models/Cart/CartSetKeyActionModel.php | 3 + .../Cart/CartSetLineItemCustomFieldAction.php | 2 + ...artSetLineItemCustomFieldActionBuilder.php | 2 + .../CartSetLineItemCustomFieldActionModel.php | 2 + .../Cart/CartSetLineItemCustomTypeAction.php | 8 +- ...CartSetLineItemCustomTypeActionBuilder.php | 8 +- .../CartSetLineItemCustomTypeActionModel.php | 8 +- ...rtSetLineItemDistributionChannelAction.php | 8 +- ...neItemDistributionChannelActionBuilder.php | 8 +- ...LineItemDistributionChannelActionModel.php | 8 +- .../Cart/CartSetLineItemPriceAction.php | 6 +- .../CartSetLineItemPriceActionBuilder.php | 6 +- .../Cart/CartSetLineItemPriceActionModel.php | 6 +- .../CartSetLineItemShippingDetailsAction.php | 5 + ...etLineItemShippingDetailsActionBuilder.php | 5 + ...tSetLineItemShippingDetailsActionModel.php | 5 + .../CartSetLineItemSupplyChannelAction.php | 8 +- ...tSetLineItemSupplyChannelActionBuilder.php | 8 +- ...artSetLineItemSupplyChannelActionModel.php | 8 +- .../Cart/CartSetLineItemTaxAmountAction.php | 7 +- .../CartSetLineItemTaxAmountActionBuilder.php | 7 +- .../CartSetLineItemTaxAmountActionModel.php | 7 +- .../Cart/CartSetLineItemTaxRateAction.php | 7 +- .../CartSetLineItemTaxRateActionBuilder.php | 7 +- .../CartSetLineItemTaxRateActionModel.php | 7 +- .../Cart/CartSetLineItemTotalPriceAction.php | 5 + ...CartSetLineItemTotalPriceActionBuilder.php | 5 + .../CartSetLineItemTotalPriceActionModel.php | 5 + .../src/Models/Cart/CartSetLocaleAction.php | 4 + .../Cart/CartSetLocaleActionBuilder.php | 4 + .../Models/Cart/CartSetLocaleActionModel.php | 4 + .../Cart/CartSetShippingAddressAction.php | 3 + .../CartSetShippingAddressActionBuilder.php | 3 + .../CartSetShippingAddressActionModel.php | 3 + .../Cart/CartSetShippingCustomFieldAction.php | 4 +- ...artSetShippingCustomFieldActionBuilder.php | 4 +- .../CartSetShippingCustomFieldActionModel.php | 4 +- .../Cart/CartSetShippingCustomTypeAction.php | 10 +- ...CartSetShippingCustomTypeActionBuilder.php | 10 +- .../CartSetShippingCustomTypeActionModel.php | 10 +- .../Cart/CartSetShippingMethodAction.php | 6 +- .../CartSetShippingMethodActionBuilder.php | 6 +- .../Cart/CartSetShippingMethodActionModel.php | 6 +- .../CartSetShippingMethodTaxAmountAction.php | 3 + ...etShippingMethodTaxAmountActionBuilder.php | 3 + ...tSetShippingMethodTaxAmountActionModel.php | 3 + .../CartSetShippingMethodTaxRateAction.php | 3 + ...tSetShippingMethodTaxRateActionBuilder.php | 3 + ...artSetShippingMethodTaxRateActionModel.php | 3 + .../Cart/CartSetShippingRateInputAction.php | 10 +- .../CartSetShippingRateInputActionBuilder.php | 10 +- .../CartSetShippingRateInputActionModel.php | 10 +- .../src/Models/Cart/CartUpdate.php | 5 + .../src/Models/Cart/CartUpdateActionModel.php | 1 + .../src/Models/Cart/CartUpdateBuilder.php | 5 + .../CartUpdateItemShippingAddressAction.php | 4 +- ...UpdateItemShippingAddressActionBuilder.php | 4 +- ...rtUpdateItemShippingAddressActionModel.php | 4 +- .../src/Models/Cart/CartUpdateModel.php | 5 + .../Cart/ClassificationShippingRateInput.php | 4 +- ...ClassificationShippingRateInputBuilder.php | 4 +- .../ClassificationShippingRateInputDraft.php | 2 + ...ificationShippingRateInputDraftBuilder.php | 2 + ...ssificationShippingRateInputDraftModel.php | 2 + .../ClassificationShippingRateInputModel.php | 4 +- .../src/Models/Cart/CustomLineItem.php | 50 +- .../src/Models/Cart/CustomLineItemBuilder.php | 59 +- .../src/Models/Cart/CustomLineItemDraft.php | 20 +- .../Cart/CustomLineItemDraftBuilder.php | 20 +- .../Models/Cart/CustomLineItemDraftModel.php | 20 +- .../src/Models/Cart/CustomLineItemModel.php | 57 +- .../src/Models/Cart/CustomShippingDraft.php | 37 +- .../Cart/CustomShippingDraftBuilder.php | 74 +- .../Models/Cart/CustomShippingDraftModel.php | 62 +- .../src/Models/Cart/DirectDiscount.php | 7 +- .../src/Models/Cart/DirectDiscountBuilder.php | 7 +- .../src/Models/Cart/DirectDiscountDraft.php | 5 +- .../Cart/DirectDiscountDraftBuilder.php | 5 +- .../Models/Cart/DirectDiscountDraftModel.php | 5 +- .../src/Models/Cart/DirectDiscountModel.php | 7 +- .../src/Models/Cart/DiscountCodeInfo.php | 4 + .../Models/Cart/DiscountCodeInfoBuilder.php | 4 + .../src/Models/Cart/DiscountCodeInfoModel.php | 4 + .../Models/Cart/DiscountedLineItemPortion.php | 4 + .../Cart/DiscountedLineItemPortionBuilder.php | 4 + .../Cart/DiscountedLineItemPortionModel.php | 4 + .../Models/Cart/DiscountedLineItemPrice.php | 4 + .../Cart/DiscountedLineItemPriceBuilder.php | 4 + .../DiscountedLineItemPriceForQuantity.php | 4 + ...countedLineItemPriceForQuantityBuilder.php | 4 + ...iscountedLineItemPriceForQuantityModel.php | 4 + .../Cart/DiscountedLineItemPriceModel.php | 4 + .../Cart/ExternalLineItemTotalPrice.php | 5 + .../ExternalLineItemTotalPriceBuilder.php | 5 + .../Cart/ExternalLineItemTotalPriceModel.php | 5 + .../Models/Cart/ExternalTaxAmountDraft.php | 4 +- .../Cart/ExternalTaxAmountDraftBuilder.php | 4 +- .../Cart/ExternalTaxAmountDraftModel.php | 4 +- .../src/Models/Cart/ExternalTaxRateDraft.php | 50 +- .../Cart/ExternalTaxRateDraftBuilder.php | 82 +- .../Models/Cart/ExternalTaxRateDraftModel.php | 96 +-- .../src/Models/Cart/ItemShippingDetails.php | 10 +- .../Cart/ItemShippingDetailsBuilder.php | 10 +- .../Models/Cart/ItemShippingDetailsDraft.php | 6 +- .../Cart/ItemShippingDetailsDraftBuilder.php | 6 +- .../Cart/ItemShippingDetailsDraftModel.php | 6 +- .../Models/Cart/ItemShippingDetailsModel.php | 10 +- .../src/Models/Cart/ItemShippingTarget.php | 8 +- .../Models/Cart/ItemShippingTargetBuilder.php | 8 +- .../Models/Cart/ItemShippingTargetModel.php | 8 +- .../src/Models/Cart/LineItem.php | 176 ++-- .../src/Models/Cart/LineItemBuilder.php | 290 +++---- .../src/Models/Cart/LineItemDraft.php | 67 +- .../src/Models/Cart/LineItemDraftBuilder.php | 121 +-- .../src/Models/Cart/LineItemDraftModel.php | 115 +-- .../src/Models/Cart/LineItemModel.php | 364 ++++---- .../src/Models/Cart/ReplicaCartDraft.php | 4 +- .../Models/Cart/ReplicaCartDraftBuilder.php | 4 +- .../src/Models/Cart/ReplicaCartDraftModel.php | 8 +- .../Models/Cart/ScoreShippingRateInput.php | 2 + .../Cart/ScoreShippingRateInputBuilder.php | 2 + .../Cart/ScoreShippingRateInputDraft.php | 2 + .../ScoreShippingRateInputDraftBuilder.php | 2 + .../Cart/ScoreShippingRateInputDraftModel.php | 2 + .../Cart/ScoreShippingRateInputModel.php | 2 + .../src/Models/Cart/Shipping.php | 12 +- .../src/Models/Cart/ShippingBuilder.php | 12 +- .../src/Models/Cart/ShippingDraft.php | 34 +- .../src/Models/Cart/ShippingDraftBuilder.php | 71 +- .../src/Models/Cart/ShippingDraftModel.php | 59 +- .../src/Models/Cart/ShippingInfo.php | 30 +- .../src/Models/Cart/ShippingInfoBuilder.php | 40 +- .../src/Models/Cart/ShippingInfoModel.php | 38 +- .../src/Models/Cart/ShippingModel.php | 12 +- .../src/Models/Cart/TaxPortion.php | 14 +- .../src/Models/Cart/TaxPortionBuilder.php | 24 +- .../src/Models/Cart/TaxPortionDraft.php | 7 +- .../Models/Cart/TaxPortionDraftBuilder.php | 7 +- .../src/Models/Cart/TaxPortionDraftModel.php | 7 +- .../src/Models/Cart/TaxPortionModel.php | 22 +- .../src/Models/Cart/TaxedItemPrice.php | 27 +- .../src/Models/Cart/TaxedItemPriceBuilder.php | 53 +- .../src/Models/Cart/TaxedItemPriceModel.php | 47 +- .../src/Models/Cart/TaxedPrice.php | 30 +- .../src/Models/Cart/TaxedPriceBuilder.php | 56 +- .../src/Models/Cart/TaxedPriceDraft.php | 9 +- .../Models/Cart/TaxedPriceDraftBuilder.php | 9 +- .../src/Models/Cart/TaxedPriceDraftModel.php | 9 +- .../src/Models/Cart/TaxedPriceModel.php | 50 +- .../src/Models/Common/ClientLogging.php | 2 +- .../Models/Common/ClientLoggingBuilder.php | 2 +- .../src/Models/Common/ClientLoggingModel.php | 2 +- .../src/Models/Common/CreatedBy.php | 2 +- .../src/Models/Common/CreatedByBuilder.php | 2 +- .../src/Models/Common/CreatedByModel.php | 2 +- .../src/Models/Common/LastModifiedBy.php | 2 +- .../Models/Common/LastModifiedByBuilder.php | 2 +- .../src/Models/Common/LastModifiedByModel.php | 2 +- .../src/Models/Common/Price.php | 4 +- .../src/Models/Common/PriceBuilder.php | 4 +- .../src/Models/Common/PriceModel.php | 4 +- .../src/Models/Common/ScopedPrice.php | 2 +- .../src/Models/Common/ScopedPriceBuilder.php | 2 +- .../src/Models/Common/ScopedPriceModel.php | 2 +- ...p => CountryNotConfiguredInStoreError.php} | 2 +- ...untryNotConfiguredInStoreErrorBuilder.php} | 10 +- ...ryNotConfiguredInStoreErrorCollection.php} | 26 +- ...CountryNotConfiguredInStoreErrorModel.php} | 2 +- .../src/Models/Error/ErrorObjectModel.php | 2 +- .../Models/Me/MyCartAddDiscountCodeAction.php | 2 + .../Me/MyCartAddDiscountCodeActionBuilder.php | 2 + .../Me/MyCartAddDiscountCodeActionModel.php | 2 + .../Me/MyCartAddItemShippingAddressAction.php | 5 +- ...artAddItemShippingAddressActionBuilder.php | 5 +- ...yCartAddItemShippingAddressActionModel.php | 5 +- .../src/Models/Me/MyCartAddLineItemAction.php | 100 ++- .../Me/MyCartAddLineItemActionBuilder.php | 206 +++-- .../Me/MyCartAddLineItemActionModel.php | 234 +++--- .../src/Models/Me/MyCartAddPaymentAction.php | 3 +- .../Me/MyCartAddPaymentActionBuilder.php | 3 +- .../Models/Me/MyCartAddPaymentActionModel.php | 3 +- ...ToLineItemShippingDetailsTargetsAction.php | 4 + ...temShippingDetailsTargetsActionBuilder.php | 4 + ...eItemShippingDetailsTargetsActionModel.php | 4 + .../Me/MyCartChangeLineItemQuantityAction.php | 11 +- ...artChangeLineItemQuantityActionBuilder.php | 11 +- ...yCartChangeLineItemQuantityActionModel.php | 11 +- .../Models/Me/MyCartChangeTaxModeAction.php | 2 + .../Me/MyCartChangeTaxModeActionBuilder.php | 2 + .../Me/MyCartChangeTaxModeActionModel.php | 2 + .../src/Models/Me/MyCartDraft.php | 166 ++-- .../src/Models/Me/MyCartDraftBuilder.php | 310 +++---- .../src/Models/Me/MyCartDraftModel.php | 400 ++++----- .../src/Models/Me/MyCartRecalculateAction.php | 5 + .../Me/MyCartRecalculateActionBuilder.php | 5 + .../Me/MyCartRecalculateActionModel.php | 5 + .../Me/MyCartRemoveDiscountCodeAction.php | 2 +- .../MyCartRemoveDiscountCodeActionBuilder.php | 2 +- .../MyCartRemoveDiscountCodeActionModel.php | 2 +- .../MyCartRemoveItemShippingAddressAction.php | 2 + ...RemoveItemShippingAddressActionBuilder.php | 2 + ...rtRemoveItemShippingAddressActionModel.php | 2 + .../Models/Me/MyCartRemoveLineItemAction.php | 12 +- .../Me/MyCartRemoveLineItemActionBuilder.php | 12 +- .../Me/MyCartRemoveLineItemActionModel.php | 12 +- .../Models/Me/MyCartRemovePaymentAction.php | 2 +- .../Me/MyCartRemovePaymentActionBuilder.php | 2 +- .../Me/MyCartRemovePaymentActionModel.php | 2 +- .../Me/MyCartSetBillingAddressAction.php | 5 +- .../MyCartSetBillingAddressActionBuilder.php | 5 +- .../Me/MyCartSetBillingAddressActionModel.php | 5 +- .../Models/Me/MyCartSetBusinessUnitAction.php | 32 + .../Me/MyCartSetBusinessUnitActionBuilder.php | 76 ++ .../MyCartSetBusinessUnitActionCollection.php | 56 ++ .../Me/MyCartSetBusinessUnitActionModel.php | 97 +++ .../src/Models/Me/MyCartSetCountryAction.php | 5 +- .../Me/MyCartSetCountryActionBuilder.php | 5 +- .../Models/Me/MyCartSetCountryActionModel.php | 5 +- .../Models/Me/MyCartSetCustomTypeAction.php | 6 +- .../Me/MyCartSetCustomTypeActionBuilder.php | 6 +- .../Me/MyCartSetCustomTypeActionModel.php | 6 +- .../Me/MyCartSetCustomerEmailAction.php | 3 + .../MyCartSetCustomerEmailActionBuilder.php | 3 + .../Me/MyCartSetCustomerEmailActionModel.php | 3 + ...tDeleteDaysAfterLastModificationAction.php | 3 + ...DaysAfterLastModificationActionBuilder.php | 3 + ...teDaysAfterLastModificationActionModel.php | 3 + .../Me/MyCartSetLineItemCustomFieldAction.php | 2 + ...artSetLineItemCustomFieldActionBuilder.php | 2 + ...yCartSetLineItemCustomFieldActionModel.php | 2 + .../Me/MyCartSetLineItemCustomTypeAction.php | 6 +- ...CartSetLineItemCustomTypeActionBuilder.php | 6 +- ...MyCartSetLineItemCustomTypeActionModel.php | 6 +- ...rtSetLineItemDistributionChannelAction.php | 8 +- ...neItemDistributionChannelActionBuilder.php | 8 +- ...LineItemDistributionChannelActionModel.php | 8 +- ...MyCartSetLineItemShippingDetailsAction.php | 5 + ...etLineItemShippingDetailsActionBuilder.php | 5 + ...tSetLineItemShippingDetailsActionModel.php | 5 + .../MyCartSetLineItemSupplyChannelAction.php | 8 +- ...tSetLineItemSupplyChannelActionBuilder.php | 8 +- ...artSetLineItemSupplyChannelActionModel.php | 8 +- .../src/Models/Me/MyCartSetLocaleAction.php | 4 + .../Me/MyCartSetLocaleActionBuilder.php | 4 + .../Models/Me/MyCartSetLocaleActionModel.php | 4 + .../Me/MyCartSetShippingAddressAction.php | 5 +- .../MyCartSetShippingAddressActionBuilder.php | 5 +- .../MyCartSetShippingAddressActionModel.php | 5 +- .../Me/MyCartSetShippingMethodAction.php | 6 +- .../MyCartSetShippingMethodActionBuilder.php | 6 +- .../Me/MyCartSetShippingMethodActionModel.php | 6 +- .../src/Models/Me/MyCartUpdate.php | 5 + .../src/Models/Me/MyCartUpdateActionModel.php | 1 + .../src/Models/Me/MyCartUpdateBuilder.php | 5 + .../MyCartUpdateItemShippingAddressAction.php | 4 +- ...UpdateItemShippingAddressActionBuilder.php | 4 +- ...rtUpdateItemShippingAddressActionModel.php | 4 +- .../src/Models/Me/MyCartUpdateModel.php | 5 + .../src/Models/Me/MyLineItemDraft.php | 65 +- .../src/Models/Me/MyLineItemDraftBuilder.php | 115 +-- .../src/Models/Me/MyLineItemDraftModel.php | 129 +-- .../src/Models/Me/MyOrderFromQuoteDraft.php | 58 ++ .../Me/MyOrderFromQuoteDraftBuilder.php | 121 +++ .../Me/MyOrderFromQuoteDraftCollection.php | 56 ++ .../Models/Me/MyOrderFromQuoteDraftModel.php | 138 ++++ .../src/Models/Me/MyPayment.php | 2 +- .../src/Models/Me/MyPaymentBuilder.php | 2 +- .../src/Models/Me/MyPaymentModel.php | 2 +- .../src/Models/Me/ReplicaMyCartDraft.php | 2 + .../Models/Me/ReplicaMyCartDraftBuilder.php | 2 + .../src/Models/Me/ReplicaMyCartDraftModel.php | 6 + .../src/Models/Order/Order.php | 8 +- .../src/Models/Order/OrderBuilder.php | 8 +- .../src/Models/Order/OrderModel.php | 8 +- ...SetCustomLineItemShippingDetailsAction.php | 2 + ...omLineItemShippingDetailsActionBuilder.php | 2 + ...stomLineItemShippingDetailsActionModel.php | 2 + .../OrderSetLineItemShippingDetailsAction.php | 2 + ...etLineItemShippingDetailsActionBuilder.php | 2 + ...rSetLineItemShippingDetailsActionModel.php | 2 + .../StagedOrderAddCustomLineItemAction.php | 2 + ...gedOrderAddCustomLineItemActionBuilder.php | 2 + ...tagedOrderAddCustomLineItemActionModel.php | 2 + .../StagedOrderAddLineItemAction.php | 4 + .../StagedOrderAddLineItemActionBuilder.php | 4 + .../StagedOrderAddLineItemActionModel.php | 4 + .../Models/OrderEdit/StagedOrderBuilder.php | 8 +- ...gedOrderChangeTaxCalculationModeAction.php | 2 + ...rChangeTaxCalculationModeActionBuilder.php | 2 + ...derChangeTaxCalculationModeActionModel.php | 2 + .../StagedOrderChangeTaxModeAction.php | 2 + .../StagedOrderChangeTaxModeActionBuilder.php | 2 + .../StagedOrderChangeTaxModeActionModel.php | 2 + ...StagedOrderChangeTaxRoundingModeAction.php | 2 + ...rderChangeTaxRoundingModeActionBuilder.php | 2 + ...dOrderChangeTaxRoundingModeActionModel.php | 2 + .../src/Models/OrderEdit/StagedOrderModel.php | 8 +- .../StagedOrderRemoveLineItemAction.php | 2 + ...StagedOrderRemoveLineItemActionBuilder.php | 2 + .../StagedOrderRemoveLineItemActionModel.php | 2 + ...SetCustomLineItemShippingDetailsAction.php | 2 + ...omLineItemShippingDetailsActionBuilder.php | 2 + ...stomLineItemShippingDetailsActionModel.php | 2 + ...dOrderSetCustomLineItemTaxAmountAction.php | 7 + ...etCustomLineItemTaxAmountActionBuilder.php | 7 + ...rSetCustomLineItemTaxAmountActionModel.php | 7 + ...gedOrderSetCustomLineItemTaxRateAction.php | 2 + ...rSetCustomLineItemTaxRateActionBuilder.php | 2 + ...derSetCustomLineItemTaxRateActionModel.php | 2 + ...agedOrderSetCustomShippingMethodAction.php | 2 + ...erSetCustomShippingMethodActionBuilder.php | 2 + ...rderSetCustomShippingMethodActionModel.php | 2 + ...dOrderSetLineItemShippingDetailsAction.php | 2 + ...etLineItemShippingDetailsActionBuilder.php | 2 + ...rSetLineItemShippingDetailsActionModel.php | 2 + .../StagedOrderSetLineItemTaxAmountAction.php | 7 + ...OrderSetLineItemTaxAmountActionBuilder.php | 7 + ...edOrderSetLineItemTaxAmountActionModel.php | 7 + .../StagedOrderSetLineItemTaxRateAction.php | 2 + ...edOrderSetLineItemTaxRateActionBuilder.php | 2 + ...agedOrderSetLineItemTaxRateActionModel.php | 2 + ...ngAddressAndCustomShippingMethodAction.php | 2 + ...ssAndCustomShippingMethodActionBuilder.php | 2 + ...ressAndCustomShippingMethodActionModel.php | 2 + ...ShippingAddressAndShippingMethodAction.php | 2 + ...gAddressAndShippingMethodActionBuilder.php | 2 + ...ingAddressAndShippingMethodActionModel.php | 2 + .../StagedOrderSetShippingMethodAction.php | 2 + ...gedOrderSetShippingMethodActionBuilder.php | 2 + ...tagedOrderSetShippingMethodActionModel.php | 2 + ...dOrderSetShippingMethodTaxAmountAction.php | 7 + ...etShippingMethodTaxAmountActionBuilder.php | 7 + ...rSetShippingMethodTaxAmountActionModel.php | 7 + ...gedOrderSetShippingMethodTaxRateAction.php | 2 + ...rSetShippingMethodTaxRateActionBuilder.php | 2 + ...derSetShippingMethodTaxRateActionModel.php | 2 + .../StagedOrderSetShippingRateInputAction.php | 2 + ...OrderSetShippingRateInputActionBuilder.php | 2 + ...edOrderSetShippingRateInputActionModel.php | 2 + .../src/Models/Payment/Payment.php | 2 +- .../src/Models/Payment/PaymentBuilder.php | 2 +- .../src/Models/Payment/PaymentDraft.php | 2 +- .../Models/Payment/PaymentDraftBuilder.php | 2 +- .../src/Models/Payment/PaymentDraftModel.php | 2 +- .../src/Models/Payment/PaymentModel.php | 2 +- .../src/Models/Project/CartsConfiguration.php | 4 +- .../Project/CartsConfigurationBuilder.php | 4 +- .../Project/CartsConfigurationModel.php | 4 +- .../src/Models/ShoppingList/ShoppingList.php | 2 +- .../ShoppingList/ShoppingListBuilder.php | 2 +- .../Models/ShoppingList/ShoppingListDraft.php | 2 +- .../ShoppingList/ShoppingListDraftBuilder.php | 2 +- .../ShoppingList/ShoppingListDraftModel.php | 2 +- .../Models/ShoppingList/ShoppingListModel.php | 2 +- .../StandalonePrice/StandalonePrice.php | 2 +- .../StandalonePriceBuilder.php | 2 +- .../StandalonePrice/StandalonePriceModel.php | 2 +- 510 files changed, 7538 insertions(+), 4299 deletions(-) create mode 100644 lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php create mode 100644 lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrdersQuotes.php create mode 100644 lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitAction.php create mode 100644 lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionCollection.php create mode 100644 lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionModel.php rename lib/commercetools-api/src/Models/Error/{CountryNotConfiguredInStore.php => CountryNotConfiguredInStoreError.php} (95%) rename lib/commercetools-api/src/Models/Error/{CountryNotConfiguredInStoreBuilder.php => CountryNotConfiguredInStoreErrorBuilder.php} (85%) rename lib/commercetools-api/src/Models/Error/{CountryNotConfiguredInStoreCollection.php => CountryNotConfiguredInStoreErrorCollection.php} (50%) rename lib/commercetools-api/src/Models/Error/{CountryNotConfiguredInStoreModel.php => CountryNotConfiguredInStoreErrorModel.php} (96%) create mode 100644 lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitAction.php create mode 100644 lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionCollection.php create mode 100644 lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionModel.php create mode 100644 lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php create mode 100644 lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php create mode 100644 lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftCollection.php create mode 100644 lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php diff --git a/changes.md b/changes.md index 71395c4008c..e0b1f49abf0 100644 --- a/changes.md +++ b/changes.md @@ -1,9 +1,100 @@ **Api changes** +
+Added Resource(s) + +- added resource `/{projectKey}/me/orders/quotes` +
+ + +
+Added Method(s) + +- added method `$apiRoot->withProjectKey()->me()->orders()->quotes()->post()` +
+ + +
+Changed Property(s) + +- :warning: changed property `totalPrice` of type `Cart` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `locale` of type `Cart` from type `string` to `Locale` +- :warning: changed property `country` of type `CartDraft` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `CartDraft` from type `string` to `Locale` +- :warning: changed property `totalPrice` of type `CustomLineItem` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `externalTaxRate` of type `CustomShippingDraft` from type `string` to `ExternalTaxRateDraft` +- :warning: changed property `deliveries` of type `CustomShippingDraft` from type `Delivery[]` to `DeliveryDraft[]` +- :warning: changed property `custom` of type `CustomShippingDraft` from type `string` to `CustomFieldsDraft` +- :warning: changed property `country` of type `ExternalTaxRateDraft` from type `string` to `CountryCode` +- :warning: changed property `totalPrice` of type `LineItem` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `externalTaxRate` of type `ShippingDraft` from type `string` to `ExternalTaxRateDraft` +- :warning: changed property `deliveries` of type `ShippingDraft` from type `Delivery[]` to `DeliveryDraft[]` +- :warning: changed property `custom` of type `ShippingDraft` from type `string` to `CustomFieldsDraft` +- :warning: changed property `price` of type `ShippingInfo` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `amount` of type `TaxPortion` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalNet` of type `TaxedItemPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedItemPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalTax` of type `TaxedItemPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalNet` of type `TaxedPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `totalTax` of type `TaxedPrice` from type `TypedMoney` to `CentPrecisionMoney` +- :warning: changed property `externalTaxRate` of type `CartAddCustomShippingMethodAction` from type `string` to `ExternalTaxRateDraft` +- :warning: changed property `deliveries` of type `CartAddCustomShippingMethodAction` from type `Delivery[]` to `DeliveryDraft[]` +- :warning: changed property `custom` of type `CartAddCustomShippingMethodAction` from type `string` to `CustomFieldsDraft` +- :warning: changed property `shippingMethod` of type `CartAddShippingMethodAction` from type `ShippingMethodReference` to `ShippingMethodResourceIdentifier` +- :warning: changed property `externalTaxRate` of type `CartAddShippingMethodAction` from type `string` to `ExternalTaxRateDraft` +- :warning: changed property `deliveries` of type `CartAddShippingMethodAction` from type `Delivery[]` to `DeliveryDraft[]` +- :warning: changed property `custom` of type `CartAddShippingMethodAction` from type `string` to `CustomFieldsDraft` +- :warning: changed property `locale` of type `CartSetLocaleAction` from type `string` to `Locale` +- :warning: changed property `businessUnit` of type `MyCartDraft` from type `BusinessUnitKeyReference` to `BusinessUnitResourceIdentifier` +- :warning: changed property `store` of type `MyCartDraft` from type `StoreKeyReference` to `StoreResourceIdentifier` +- :warning: changed property `country` of type `MyCartDraft` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `MyCartDraft` from type `string` to `Locale` +- :warning: changed property `locale` of type `MyCartSetLocaleAction` from type `string` to `Locale` +
+ + +
+Required Property(s) + +- :warning: changed property `inventoryMode` of type `Cart` to be required +- :warning: changed property `itemShippingAddresses` of type `Cart` to be required +- :warning: changed property `discountCodes` of type `Cart` to be required +- :warning: changed property `directDiscounts` of type `Cart` to be required +- :warning: changed property `shippingAddress` of type `ShippingDraft` to be required +- changed property `quantity` of type `CustomLineItemDraft` to be optional +- changed property `deliveries` of type `CustomShippingDraft` to be optional +- changed property `deliveries` of type `ShippingDraft` to be optional +- changed property `quantity` of type `CartAddCustomLineItemAction` to be optional +- changed property `deliveries` of type `CartAddCustomShippingMethodAction` to be optional +- changed property `deliveries` of type `CartAddShippingMethodAction` to be optional +- changed property `email` of type `CartSetCustomerEmailAction` to be optional +- changed property `quantity` of type `MyLineItemDraft` to be optional +
+ + +
+Added Property(s) + +- added property `shippingDetails` to type `CartAddCustomLineItemAction` +
+ + +
+Removed Type(s) + +- :warning: removed type `CountryNotConfiguredInStore` +
+ +
Added Type(s) +- added type `CartSetBusinessUnitAction` +- added type `CountryNotConfiguredInStoreError` - added type `GoogleCloudFunctionDestination` +- added type `MyOrderFromQuoteDraft` +- added type `MyCartSetBusinessUnitAction`
@@ -12,5 +103,13 @@ - added query parameter `sort` to method `get /{projectKey}/product-selections/key={key}/products` - added query parameter `sort` to method `get /{projectKey}/product-selections/{ID}/products` +- added query parameter `expand` to method `get /{projectKey}/in-store/key={storeKey}/me/active-cart` + + + +
+Added Enum(s) + +- added enum `shipping` to type `ResourceTypeId`
diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeActiveCartTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeActiveCartTest.php index 26202252888..ecbde0cf080 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeActiveCartTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeActiveCartTest.php @@ -90,6 +90,19 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->me() + ->activeCart() + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/me/active-cart?expand=expand', + ], 'ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php new file mode 100644 index 00000000000..dbd8e00fb07 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php @@ -0,0 +1,157 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeOrdersQuotesPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->orders() + ->quotes() + ->post(null); + }, + 'post', + 'test_projectKey/me/orders/quotes', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeOrdersQuotesPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->quotes() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeOrdersQuotesPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->quotes() + ->post(null); + }, + 201 + ], + 'ByProjectKeyMeOrdersQuotesPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->quotes() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php index 3f0307bebb1..466011e94ef 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php @@ -10,6 +10,7 @@ use Commercetools\Api\Client\ApiRequestBuilder; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeOrdersByID; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeOrdersQuotes; use Commercetools\Base\JsonObject; use Commercetools\Client\ApiRequest; use Commercetools\Exception\ApiClientException; @@ -236,6 +237,18 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeOrdersByID { ResourceByProjectKeyMeOrdersByID::class, ['projectKey' => 'test_projectKey', 'ID' => 'test_ID'], '/{projectKey}/me/orders/{ID}' + ], + 'ResourceByProjectKeyMeOrdersQuotes' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeOrdersQuotes { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->orders() + ->quotes(); + }, + ResourceByProjectKeyMeOrdersQuotes::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/me/orders/quotes' ] ]; } diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 1ad8248da8a..ae439728003 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -462,8 +462,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->post(null)` -Creating a cart can fail with an InvalidOperation if the referenced shipping method in the -CartDraft has a predicate which does not match the cart. +Creating a Cart fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) error if the +[ShippingMethod](ctp:api:type:ShippingMethod) referenced in the CartDraft +has a `predicate` that does not match the Cart. ### Example @@ -478,8 +479,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->withId("ID")->get()` -The cart may not contain up-to-date prices, discounts etc. -If you want to ensure they're up-to-date, send an Update request with the Recalculate update action instead. +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -525,11 +525,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->withCustomerId("customerId")->get()` -Retrieves the active cart of the customer that has been modified most recently. -It does not consider carts with CartOrigin Merchant. If no active cart exists, a 404 Not Found error is returned. +Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. -The cart may not contain up-to-date prices, discounts etc. If you want to ensure they're up-to-date, -send an Update request with the Recalculate update action instead. +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -545,8 +543,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->withKey("key")->get()` -The cart may not contain up-to-date prices, discounts etc. -If you want to ensure they're up-to-date, send an Update request with the Recalculate update action instead. +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -592,7 +589,12 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->replicate()->post(null)` -null +Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order. + +The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). + +The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. + ### Example ```php @@ -1460,7 +1462,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->get()` -Queries carts in a specific Store. +null ### Example ```php @@ -1475,9 +1477,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->post(null)` -Creates a [Cart](ctp:api:type:Cart) in the Store specified by `storeKey`. -When using this endpoint the Cart's `store` field is always set to the store specified in the path parameter. -If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. + +Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) ### Example @@ -1493,11 +1495,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->get()` -Returns a cart by its ID from a specific Store. -If the cart exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. -The cart may not contain up-to-date prices, discounts etc. -If you want to ensure they're up-to-date, send an Update request with the Recalculate update action instead. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -1532,7 +1532,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->delete()` -null +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1548,13 +1549,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withCustomerId("customerId")->get()` -Retrieves the active cart of the customer that has been modified most recently in a specific Store. +Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. -If the cart exists in the project but does not have the store field, or the store field -references a different store, this method returns a ResourceNotFound error. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. -The cart may not contain up-to-date prices, discounts etc. If you want to ensure they're up-to-date, -send an Update request with the Recalculate update action instead. +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -1571,11 +1570,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->get()` -Returns a cart by its key from a specific Store. -If the cart exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. -The cart may not contain up-to-date prices, discounts etc. -If you want to ensure they're up-to-date, send an Update request with the Recalculate update action instead. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + +To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. ### Example @@ -1592,9 +1589,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->post(null)` -Updates a [Cart](ctp:api:type:Cart) in the Store specified by `storeKey`. -If the Cart exists in the Project but does not have the store field, -or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFound) error. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1611,7 +1606,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->delete()` -null +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1627,7 +1623,12 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->replicate()->post(null)` -null +Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order. + +The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). + +The new Cart does not contain payments or deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. + ### Example ```php @@ -1972,7 +1973,12 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->activeCart()->get()` -null +Retrieves the Customer's most recently modified active Cart in the Store specified by the `storeKey` path parameter. + +Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. + +If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + ### Example ```php @@ -2004,7 +2010,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->post(null)` -null +The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. + +Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) + ### Example ```php @@ -2037,7 +2046,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->withId("ID")->post(null)` -null +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -2093,7 +2103,7 @@ Retrieves the authenticated Customer (that matches the given email/password pair - If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). -If a Cart is returned as part of [CustomerSignInResult](ctp:api:type:CustomerSignInResult), it has been [recalculated](/../api/projects/carts#recalculate) with up-to-date prices, taxes, discounts, and invalid line items removed. +If a Cart is returned as part of [CustomerSignInResult](ctp:api:type:CustomerSignInResult), it has been [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. @@ -2399,7 +2409,7 @@ $request = $builder Returns an order by its ID from a specific Store. If the order exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. +or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2418,7 +2428,7 @@ $request = $builder Updates an order in the store specified by {storeKey}. If the order exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. +or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2454,7 +2464,7 @@ $request = $builder Returns an order by its order number from a specific Store. If the order exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. +or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, it should be provided in URL-encoded format. @@ -2475,7 +2485,7 @@ $request = $builder Updates an order in the store specified by {storeKey}. If the order exists in the project but does not have the store field, -or the store field references a different store, this method returns a ResourceNotFound error. +or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, it should be provided in URL-encoded format. @@ -2912,7 +2922,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->activeCart()->get()` -null +Retrieves the Customer's most recently modified active Cart. +Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. + +If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + ### Example ```php @@ -2942,7 +2956,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->businessUnits()->post(null)` -null +Automatically assigns the authenticated user to the Business Unit in the [Associate Roles](ctp:api:type:AssociateRole) of `Admin` as well as `Buyer`. + ### Example ```php @@ -3179,7 +3194,18 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->carts()->replicate()->post(null)` -null +Creates a new Cart by replicating an existing Cart or Order of the authenticated Customer. +This can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order. + +The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. +If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. +If the Customer switches to another Customer Group, the new Cart is updated with the new value. +It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). + +The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. + +In case the Cart or Order to be replicated does not belong to the authenticaed Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error + ### Example ```php @@ -3213,12 +3239,12 @@ $request = $builder Retrieves the authenticated customer (that matches the given email/password pair). -If used with [an access token for an anonymous session](/../api/authorization#tokens-for-anonymous-sessions), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. +If used with [an access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. - If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). -A Cart returned as part of the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) is [recalculated](ctp:api:type:Recalculate) with up-to-date prices, taxes, discounts, and invalid line items removed. +A Cart returned as part of the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) is [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. @@ -3280,6 +3306,22 @@ $request = $builder ->withId("ID") ->get(); ``` +## `withProjectKey("projectKey")->me()->orders()->quotes()->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->quotes() + ->post(null); +``` ## `withProjectKey("projectKey")->me()->password()->post(null)` Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. @@ -3781,7 +3823,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->signup()->post(null)` -If used with an [access token for an anonymous session](/../api/authorization#tokens-for-anonymous-sessions), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. +If used with an [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php index 9d3f97e72f5..31dc15f4d1a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php @@ -30,10 +30,11 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet extends ApiRequest implements Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -142,4 +143,13 @@ function (RequestException $e) use ($resultType) { } ); } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet + { + return $this->withQueryParam('expand', $expand); + } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php new file mode 100644 index 00000000000..3c9255781ef --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php @@ -0,0 +1,118 @@ + $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/me/orders/quotes'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return JsonObject|Order|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = OrderModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|JsonObject|Order + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php index 943d1eb1402..97aa45fcd30 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php @@ -37,6 +37,14 @@ public function withId(string $ID = null): ResourceByProjectKeyMeOrdersByID return new ResourceByProjectKeyMeOrdersByID($args, $this->getClient()); } + /** + */ + public function quotes(): ResourceByProjectKeyMeOrdersQuotes + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyMeOrdersQuotes($args, $this->getClient()); + } /** * @psalm-param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrdersQuotes.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrdersQuotes.php new file mode 100644 index 00000000000..a06dcc57403 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrdersQuotes.php @@ -0,0 +1,39 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/orders/quotes', $args, $client); + } + + /** + * @psalm-param ?MyOrderFromQuoteDraft $body + * @psalm-param array $headers + */ + public function post(?MyOrderFromQuoteDraft $body = null, array $headers = []): ByProjectKeyMeOrdersQuotesPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeOrdersQuotesPost($args['projectKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/Cart.php b/lib/commercetools-api/src/Models/Cart/Cart.php index 9f95abd4e32..601c679d07e 100644 --- a/lib/commercetools-api/src/Models/Cart/Cart.php +++ b/lib/commercetools-api/src/Models/Cart/Cart.php @@ -13,9 +13,9 @@ use Commercetools\Api\Models\Common\Address; use Commercetools\Api\Models\Common\AddressCollection; use Commercetools\Api\Models\Common\BaseResource; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\LastModifiedBy; -use Commercetools\Api\Models\Common\TypedMoney; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference; use Commercetools\Api\Models\Order\PaymentInfo; use Commercetools\Api\Models\Store\StoreKeyReference; @@ -27,41 +27,41 @@ interface Cart extends BaseResource { public const FIELD_KEY = 'key'; - public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; - public const FIELD_CREATED_BY = 'createdBy'; public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; + public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; + public const FIELD_TOTAL_LINE_ITEM_QUANTITY = 'totalLineItemQuantity'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; public const FIELD_TAXED_SHIPPING_PRICE = 'taxedShippingPrice'; - public const FIELD_CART_STATE = 'cartState'; - public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; - public const FIELD_BILLING_ADDRESS = 'billingAddress'; - public const FIELD_SHIPPING_MODE = 'shippingMode'; - public const FIELD_SHIPPING = 'shipping'; - public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_TAX_MODE = 'taxMode'; public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; - public const FIELD_CUSTOMER_GROUP = 'customerGroup'; - public const FIELD_COUNTRY = 'country'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; + public const FIELD_CART_STATE = 'cartState'; + public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_SHIPPING_MODE = 'shippingMode'; public const FIELD_SHIPPING_INFO = 'shippingInfo'; + public const FIELD_SHIPPING = 'shipping'; + public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; + public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_DISCOUNT_CODES = 'discountCodes'; public const FIELD_DIRECT_DISCOUNTS = 'directDiscounts'; - public const FIELD_CUSTOM = 'custom'; + public const FIELD_REFUSED_GIFTS = 'refusedGifts'; public const FIELD_PAYMENT_INFO = 'paymentInfo'; + public const FIELD_COUNTRY = 'country'; public const FIELD_LOCALE = 'locale'; - public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; - public const FIELD_REFUSED_GIFTS = 'refusedGifts'; public const FIELD_ORIGIN = 'origin'; - public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; - public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; - public const FIELD_TOTAL_LINE_ITEM_QUANTITY = 'totalLineItemQuantity'; + public const FIELD_CUSTOM = 'custom'; + public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; + public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; + public const FIELD_CREATED_BY = 'createdBy'; /** *

Unique identifier of the Cart.

@@ -72,15 +72,7 @@ interface Cart extends BaseResource public function getId(); /** - *

User-defined unique identifier of the Cart.

- * - - * @return null|string - */ - public function getKey(); - - /** - *

The current version of the cart.

+ *

Current version of the Cart.

* * @return null|int @@ -88,47 +80,39 @@ public function getKey(); public function getVersion(); /** - - * @return null|DateTimeImmutable - */ - public function getCreatedAt(); - - /** - - * @return null|DateTimeImmutable - */ - public function getLastModifiedAt(); - - /** - *

Present on resources updated after 1 February 2019 except for events not tracked.

+ *

User-defined unique identifier of the Cart.

* - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy(); + public function getKey(); /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

id of the Customer that the Cart belongs to.

* - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy(); + public function getCustomerId(); /** + *

Email address of the Customer that the Cart belongs to.

+ * * @return null|string */ - public function getCustomerId(); + public function getCustomerEmail(); /** + *

Reference to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

+ * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail(); + public function getCustomerGroup(); /** - *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

+ *

Anonymous session associated with the Cart.

* * @return null|string @@ -136,7 +120,7 @@ public function getCustomerEmail(); public function getAnonymousId(); /** - *

The Business Unit the Cart belongs to.

+ *

Reference to a Business Unit the Cart belongs to.

* * @return null|BusinessUnitKeyReference @@ -144,36 +128,51 @@ public function getAnonymousId(); public function getBusinessUnit(); /** + *

Reference to a Store the Cart belongs to.

+ * * @return null|StoreKeyReference */ public function getStore(); /** + *

Line Items added to the Cart.

+ * * @return null|LineItemCollection */ public function getLineItems(); /** + *

Custom Line Items added to the Cart.

+ * * @return null|CustomLineItemCollection */ public function getCustomLineItems(); /** - *

The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

+ *

Sum of all LineItem quantities, excluding CustomLineItems. Only present when the Cart has at least one LineItem.

* - * @return null|TypedMoney + * @return null|int + */ + public function getTotalLineItemQuantity(); + + /** + *

Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo.

+ *

Taxes are included if TaxRate includedInPrice is true for each price.

+ * + + * @return null|CentPrecisionMoney */ public function getTotalPrice(); /** - *

Not set until the shipping address is set. - * Will be set automatically in the Platform TaxMode. - * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

+ *
    + *
  • For a Cart with Platform TaxMode, it is automatically set when a shipping address is set.
  • + *
  • For a Cart with External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
  • + *
* * @return null|TaxedPrice @@ -181,8 +180,7 @@ public function getTotalPrice(); public function getTaxedPrice(); /** - *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ *

Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

* * @return null|TaxedPrice @@ -190,214 +188,226 @@ public function getTaxedPrice(); public function getTaxedShippingPrice(); /** + *

Indicates how Tax Rates are set.

+ * * @return null|string */ - public function getCartState(); + public function getTaxMode(); /** - *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

+ *

Indicates how monetary values are rounded when calculating taxes for taxedPrice.

* - * @return null|Address + * @return null|string */ - public function getShippingAddress(); + public function getTaxRoundingMode(); /** + *

Indicates how taxes are calculated when calculating taxes for taxedPrice.

+ * - * @return null|Address + * @return null|string */ - public function getBillingAddress(); + public function getTaxCalculationMode(); /** - *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ *

Indicates how stock quantities are tracked for Line Items in the Cart.

* * @return null|string */ - public function getShippingMode(); + public function getInventoryMode(); /** - *

Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

- *

It is automatically updated after the Shipping Method is added.

+ *

Current status of the Cart.

* - * @return null|ShippingCollection + * @return null|string */ - public function getShipping(); + public function getCartState(); /** + *

Billing address associated with the Cart.

+ * - * @return null|string + * @return null|Address */ - public function getInventoryMode(); + public function getBillingAddress(); /** + *

Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

+ * - * @return null|string + * @return null|Address */ - public function getTaxMode(); + public function getShippingAddress(); /** - *

When calculating taxes for taxedPrice, the selected mode is used for rounding.

+ *

Indicates whether the Cart has one or multiple Shipping Methods.

* * @return null|string */ - public function getTaxRoundingMode(); + public function getShippingMode(); /** - *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

+ *

Shipping-related information of a Cart with Single ShippingMode. Automatically set when a Shipping Method is set.

* - * @return null|string + * @return null|ShippingInfo */ - public function getTaxCalculationMode(); + public function getShippingInfo(); /** - *

Set automatically when the customer is set and the customer is a member of a customer group. - * Used for product variant - * price selection.

+ *

Shipping-related information of a Cart with Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

* - * @return null|CustomerGroupReference + * @return null|ShippingCollection */ - public function getCustomerGroup(); + public function getShipping(); /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry(); + public function getShippingRateInput(); /** - *

Shipping-related information of a Cart with Single ShippingMode. - * Set automatically once the ShippingMethod is set.

+ *

Additional shipping addresses of the Cart as specified by LineItems using the shippingDetails field.

+ *

Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

* - * @return null|ShippingInfo + * @return null|AddressCollection */ - public function getShippingInfo(); + public function getItemShippingAddresses(); /** + *

Discount Codes applied to the Cart. A Cart that has directDiscounts cannot have discountCodes.

+ * * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes(); /** + *

Direct Discounts added to the Cart. A Cart that has discountCodes cannot have directDiscounts.

+ * * @return null|DirectDiscountCollection */ public function getDirectDiscounts(); /** + *

Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Cart.

+ * - * @return null|CustomFields + * @return null|CartDiscountReferenceCollection */ - public function getCustom(); + public function getRefusedGifts(); /** + *

Payment information related to the Cart.

+ * * @return null|PaymentInfo */ public function getPaymentInfo(); /** + *

Used for LineItem Price selection.

+ * * @return null|string */ - public function getLocale(); + public function getCountry(); /** - *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

+ *

Languages of the Cart. Can only contain languages supported by the Project.

* - * @return null|int + * @return null|string */ - public function getDeleteDaysAfterLastModification(); + public function getLocale(); /** - *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

+ *

Indicates how the Cart was created.

* - * @return null|CartDiscountReferenceCollection + * @return null|string */ - public function getRefusedGifts(); + public function getOrigin(); /** - *

The origin field indicates how this cart was created. - * The value Customer indicates, that the cart was created by the customer.

+ *

Custom Fields of the Cart.

* - * @return null|string + * @return null|CustomFields */ - public function getOrigin(); + public function getCustom(); /** - *

The shippingRateInput is used as an input to select a ShippingRatePriceTier.

+ *

Number of days after which an active Cart is deleted since its last modification. Configured in Project settings.

* - * @return null|ShippingRateInput + * @return null|int */ - public function getShippingRateInput(); + public function getDeleteDaysAfterLastModification(); /** - *

Contains addresses for carts with multiple shipping addresses. - * Line items reference these addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

+ *

Date and time (UTC) the Cart was initially created.

* - * @return null|AddressCollection + * @return null|DateTimeImmutable */ - public function getItemShippingAddresses(); + public function getCreatedAt(); /** - *

The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

+ *

Date and time (UTC) the Cart was last updated.

* - * @return null|int + * @return null|DateTimeImmutable */ - public function getTotalLineItemQuantity(); + public function getLastModifiedAt(); /** - * @param ?string $id - */ - public function setId(?string $id): void; + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * - /** - * @param ?string $key + * @return null|LastModifiedBy */ - public function setKey(?string $key): void; + public function getLastModifiedBy(); /** - * @param ?int $version - */ - public function setVersion(?int $version): void; + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * - /** - * @param ?DateTimeImmutable $createdAt + * @return null|CreatedBy */ - public function setCreatedAt(?DateTimeImmutable $createdAt): void; + public function getCreatedBy(); /** - * @param ?DateTimeImmutable $lastModifiedAt + * @param ?string $id */ - public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; + public function setId(?string $id): void; /** - * @param ?LastModifiedBy $lastModifiedBy + * @param ?int $version */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; + public function setVersion(?int $version): void; /** - * @param ?CreatedBy $createdBy + * @param ?string $key */ - public function setCreatedBy(?CreatedBy $createdBy): void; + public function setKey(?string $key): void; /** * @param ?string $customerId @@ -409,6 +419,11 @@ public function setCustomerId(?string $customerId): void; */ public function setCustomerEmail(?string $customerEmail): void; + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; + /** * @param ?string $anonymousId */ @@ -435,9 +450,14 @@ public function setLineItems(?LineItemCollection $lineItems): void; public function setCustomLineItems(?CustomLineItemCollection $customLineItems): void; /** - * @param ?TypedMoney $totalPrice + * @param ?int $totalLineItemQuantity + */ + public function setTotalLineItemQuantity(?int $totalLineItemQuantity): void; + + /** + * @param ?CentPrecisionMoney $totalPrice */ - public function setTotalPrice(?TypedMoney $totalPrice): void; + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void; /** * @param ?TaxedPrice $taxedPrice @@ -450,64 +470,64 @@ public function setTaxedPrice(?TaxedPrice $taxedPrice): void; public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void; /** - * @param ?string $cartState + * @param ?string $taxMode */ - public function setCartState(?string $cartState): void; + public function setTaxMode(?string $taxMode): void; /** - * @param ?Address $shippingAddress + * @param ?string $taxRoundingMode */ - public function setShippingAddress(?Address $shippingAddress): void; + public function setTaxRoundingMode(?string $taxRoundingMode): void; /** - * @param ?Address $billingAddress + * @param ?string $taxCalculationMode */ - public function setBillingAddress(?Address $billingAddress): void; + public function setTaxCalculationMode(?string $taxCalculationMode): void; /** - * @param ?string $shippingMode + * @param ?string $inventoryMode */ - public function setShippingMode(?string $shippingMode): void; + public function setInventoryMode(?string $inventoryMode): void; /** - * @param ?ShippingCollection $shipping + * @param ?string $cartState */ - public function setShipping(?ShippingCollection $shipping): void; + public function setCartState(?string $cartState): void; /** - * @param ?string $inventoryMode + * @param ?Address $billingAddress */ - public function setInventoryMode(?string $inventoryMode): void; + public function setBillingAddress(?Address $billingAddress): void; /** - * @param ?string $taxMode + * @param ?Address $shippingAddress */ - public function setTaxMode(?string $taxMode): void; + public function setShippingAddress(?Address $shippingAddress): void; /** - * @param ?string $taxRoundingMode + * @param ?string $shippingMode */ - public function setTaxRoundingMode(?string $taxRoundingMode): void; + public function setShippingMode(?string $shippingMode): void; /** - * @param ?string $taxCalculationMode + * @param ?ShippingInfo $shippingInfo */ - public function setTaxCalculationMode(?string $taxCalculationMode): void; + public function setShippingInfo(?ShippingInfo $shippingInfo): void; /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingCollection $shipping */ - public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; + public function setShipping(?ShippingCollection $shipping): void; /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput */ - public function setCountry(?string $country): void; + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void; /** - * @param ?ShippingInfo $shippingInfo + * @param ?AddressCollection $itemShippingAddresses */ - public function setShippingInfo(?ShippingInfo $shippingInfo): void; + public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void; /** * @param ?DiscountCodeInfoCollection $discountCodes @@ -520,47 +540,57 @@ public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): vo public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): void; /** - * @param ?CustomFields $custom + * @param ?CartDiscountReferenceCollection $refusedGifts */ - public function setCustom(?CustomFields $custom): void; + public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void; /** * @param ?PaymentInfo $paymentInfo */ public function setPaymentInfo(?PaymentInfo $paymentInfo): void; + /** + * @param ?string $country + */ + public function setCountry(?string $country): void; + /** * @param ?string $locale */ public function setLocale(?string $locale): void; /** - * @param ?int $deleteDaysAfterLastModification + * @param ?string $origin */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; + public function setOrigin(?string $origin): void; /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?CustomFields $custom */ - public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void; + public function setCustom(?CustomFields $custom): void; /** - * @param ?string $origin + * @param ?int $deleteDaysAfterLastModification */ - public function setOrigin(?string $origin): void; + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?DateTimeImmutable $createdAt */ - public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void; + public function setCreatedAt(?DateTimeImmutable $createdAt): void; /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?DateTimeImmutable $lastModifiedAt */ - public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void; + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; /** - * @param ?int $totalLineItemQuantity + * @param ?LastModifiedBy $lastModifiedBy */ - public function setTotalLineItemQuantity(?int $totalLineItemQuantity): void; + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php index b9202e287f5..d1075a09630 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php @@ -22,13 +22,14 @@ interface CartAddCustomLineItemAction extends CartUpdateAction public const FIELD_QUANTITY = 'quantity'; public const FIELD_SLUG = 'slug'; public const FIELD_TAX_CATEGORY = 'taxCategory'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; public const FIELD_PRICE_MODE = 'priceMode'; /** - *

Draft type that stores amounts in cent precision for the specified currency.

- *

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

+ *

Money value of the Custom Line Item. + * The value can be negative.

* * @return null|Money @@ -36,7 +37,7 @@ interface CartAddCustomLineItemAction extends CartUpdateAction public function getMoney(); /** - *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

+ *

Name of the Custom Line Item.

* * @return null|LocalizedString @@ -44,19 +45,25 @@ public function getMoney(); public function getName(); /** + *

Number of Custom Line Items to add to the Cart.

+ * * @return null|int */ public function getQuantity(); /** + *

User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

+ * * @return null|string */ public function getSlug(); /** - *

ResourceIdentifier to a TaxCategory.

+ *

Used to select a Tax Rate when a Cart has the Platform TaxMode.

+ *

If TaxMode is Platform, this field must not be empty.

* * @return null|TaxCategoryResourceIdentifier @@ -64,18 +71,28 @@ public function getSlug(); public function getTaxCategory(); /** - *

The representation used when creating or updating a customizable data type with Custom Fields.

+ *

An external Tax Rate can be set if the Cart has External TaxMode.

* - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom(); + public function getExternalTaxRate(); /** + *

Container for Custom Line Item-specific addresses.

+ * - * @return null|ExternalTaxRateDraft + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate(); + public function getShippingDetails(); + + /** + *

Custom Fields for the Custom Line Item.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); /** *
    @@ -115,14 +132,19 @@ public function setSlug(?string $slug): void; public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; /** * @param ?string $priceMode diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php index 4238203a842..b397ff6797d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php @@ -60,15 +60,21 @@ final class CartAddCustomLineItemActionBuilder implements Builder /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ - private $custom; + private $externalTaxRate; /** - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ - private $externalTaxRate; + private $shippingDetails; + + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; /** @@ -77,8 +83,8 @@ final class CartAddCustomLineItemActionBuilder implements Builder private $priceMode; /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Money value of the Custom Line Item. + * The value can be negative.

    * * @return null|Money @@ -89,7 +95,7 @@ public function getMoney() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Custom Line Item.

    * * @return null|LocalizedString @@ -100,6 +106,8 @@ public function getName() } /** + *

    Number of Custom Line Items to add to the Cart.

    + * * @return null|int */ @@ -109,6 +117,9 @@ public function getQuantity() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * @return null|string */ @@ -118,7 +129,8 @@ public function getSlug() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + *

    If TaxMode is Platform, this field must not be empty.

    * * @return null|TaxCategoryResourceIdentifier @@ -129,23 +141,36 @@ public function getTaxCategory() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    An external Tax Rate can be set if the Cart has External TaxMode.

    * - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom() + public function getExternalTaxRate() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** + *

    Container for Custom Line Item-specific addresses.

    + * - * @return null|ExternalTaxRateDraft + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate() + public function getShippingDetails() { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; + } + + /** + *

    Custom Fields for the Custom Line Item.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -219,23 +244,34 @@ public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) } /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; return $this; } @@ -285,23 +321,34 @@ public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $ta } /** - * @deprecated use withCustom() instead + * @deprecated use withExternalTaxRate() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @deprecated use withExternalTaxRate() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; return $this; } @@ -314,8 +361,9 @@ public function build(): CartAddCustomLineItemAction $this->quantity, $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php index 33dc3769be7..ac8b5f3ed93 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php @@ -66,15 +66,21 @@ final class CartAddCustomLineItemActionModel extends JsonObjectModel implements /** * - * @var ?CustomFieldsDraft + * @var ?ExternalTaxRateDraft */ - protected $custom; + protected $externalTaxRate; /** * - * @var ?ExternalTaxRateDraft + * @var ?ItemShippingDetailsDraft */ - protected $externalTaxRate; + protected $shippingDetails; + + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; /** * @@ -92,8 +98,9 @@ public function __construct( ?int $quantity = null, ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?CustomFieldsDraft $custom = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?ItemShippingDetailsDraft $shippingDetails = null, + ?CustomFieldsDraft $custom = null, ?string $priceMode = null, ?string $action = null ) { @@ -102,8 +109,9 @@ public function __construct( $this->quantity = $quantity; $this->slug = $slug; $this->taxCategory = $taxCategory; - $this->custom = $custom; $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; + $this->custom = $custom; $this->priceMode = $priceMode; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -127,8 +135,8 @@ public function getAction() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Money value of the Custom Line Item. + * The value can be negative.

    * * * @return null|Money @@ -149,7 +157,7 @@ public function getMoney() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Custom Line Item.

    * * * @return null|LocalizedString @@ -170,6 +178,8 @@ public function getName() } /** + *

    Number of Custom Line Items to add to the Cart.

    + * * * @return null|int */ @@ -188,6 +198,9 @@ public function getQuantity() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * * @return null|string */ @@ -206,7 +219,8 @@ public function getSlug() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + *

    If TaxMode is Platform, this field must not be empty.

    * * * @return null|TaxCategoryResourceIdentifier @@ -227,43 +241,66 @@ public function getTaxCategory() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    An external Tax Rate can be set if the Cart has External TaxMode.

    * * - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom() + public function getExternalTaxRate() { - if (is_null($this->custom)) { + if (is_null($this->externalTaxRate)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->custom = CustomFieldsDraftModel::of($data); + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } - return $this->custom; + return $this->externalTaxRate; } /** + *

    Container for Custom Line Item-specific addresses.

    * - * @return null|ExternalTaxRateDraft + * + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate() + public function getShippingDetails() { - if (is_null($this->externalTaxRate)) { + if (is_null($this->shippingDetails)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + $data = $this->raw(self::FIELD_SHIPPING_DETAILS); if (is_null($data)) { return null; } - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + $this->shippingDetails = ItemShippingDetailsDraftModel::of($data); } - return $this->externalTaxRate; + return $this->shippingDetails; + } + + /** + *

    Custom Fields for the Custom Line Item.

    + * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; } /** @@ -332,19 +369,27 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi } /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; } /** diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php index 4f879f1a049..80a8a489f8b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php @@ -9,9 +9,10 @@ namespace Commercetools\Api\Models\Cart; use Commercetools\Api\Models\Common\BaseAddress; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,7 +29,7 @@ interface CartAddCustomShippingMethodAction extends CartUpdateAction public const FIELD_CUSTOM = 'custom'; /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the custom Shipping Method that must be unique across the Cart with Multiple ShippingMode.

    * * @return null|string @@ -60,12 +61,13 @@ public function getShippingAddress(); public function getShippingRate(); /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -73,7 +75,7 @@ public function getShippingRate(); public function getShippingRateInput(); /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -84,16 +86,15 @@ public function getTaxCategory(); *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries(); @@ -101,7 +102,7 @@ public function getDeliveries(); *

    Custom Fields for the custom Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -136,17 +137,17 @@ public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput) public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void; + public function setDeliveries(?DeliveryDraftCollection $deliveries): void; /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php index 8e8103d9760..240e527cce3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php @@ -10,11 +10,13 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -65,24 +67,24 @@ final class CartAddCustomShippingMethodActionBuilder implements Builder /** - * @var ?string + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ private $deliveries; /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the custom Shipping Method that must be unique across the Cart with Multiple ShippingMode.

    * * @return null|string @@ -126,12 +128,13 @@ public function getShippingRate() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -142,7 +145,7 @@ public function getShippingRateInput() } /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -156,19 +159,18 @@ public function getTaxCategory() *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { - return $this->externalTaxRate; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -179,11 +181,11 @@ public function getDeliveries() *

    Custom Fields for the custom Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { - return $this->custom; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -253,10 +255,10 @@ public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withExternalTaxRate(?string $externalTaxRate) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { $this->externalTaxRate = $externalTaxRate; @@ -264,10 +266,10 @@ public function withExternalTaxRate(?string $externalTaxRate) } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries * @return $this */ - public function withDeliveries(?DeliveryCollection $deliveries) + public function withDeliveries(?DeliveryDraftCollection $deliveries) { $this->deliveries = $deliveries; @@ -275,10 +277,10 @@ public function withDeliveries(?DeliveryCollection $deliveries) } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withCustom(?string $custom) + public function withCustom(?CustomFieldsDraft $custom) { $this->custom = $custom; @@ -329,6 +331,28 @@ public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $ta return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): CartAddCustomShippingMethodAction { return new CartAddCustomShippingMethodActionModel( @@ -338,9 +362,9 @@ public function build(): CartAddCustomShippingMethodAction $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->externalTaxRate, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->deliveries, - $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php index c7f2ae3a16b..283af3cca95 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php @@ -10,11 +10,13 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressModel; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -71,19 +73,19 @@ final class CartAddCustomShippingMethodActionModel extends JsonObjectModel imple /** * - * @var ?string + * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** * - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ protected $deliveries; /** * - * @var ?string + * @var ?CustomFieldsDraft */ protected $custom; @@ -98,9 +100,9 @@ public function __construct( ?ShippingRateDraft $shippingRate = null, ?ShippingRateInputDraft $shippingRateInput = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?string $externalTaxRate = null, - ?DeliveryCollection $deliveries = null, - ?string $custom = null, + ?ExternalTaxRateDraft $externalTaxRate = null, + ?DeliveryDraftCollection $deliveries = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->shippingKey = $shippingKey; @@ -134,7 +136,7 @@ public function getAction() } /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the custom Shipping Method that must be unique across the Cart with Multiple ShippingMode.

    * * * @return null|string @@ -216,12 +218,13 @@ public function getShippingRate() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * * @return null|ShippingRateInputDraft @@ -242,7 +245,7 @@ public function getShippingRateInput() } /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * * @return null|TaxCategoryResourceIdentifier @@ -266,28 +269,28 @@ public function getTaxCategory() *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { if (is_null($this->externalTaxRate)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->externalTaxRate = (string) $data; + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } return $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -297,7 +300,7 @@ public function getDeliveries() if (is_null($data)) { return null; } - $this->deliveries = DeliveryCollection::fromArray($data); + $this->deliveries = DeliveryDraftCollection::fromArray($data); } return $this->deliveries; @@ -307,17 +310,18 @@ public function getDeliveries() *

    Custom Fields for the custom Shipping Method.

    * * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { if (is_null($this->custom)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->custom = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } return $this->custom; @@ -373,25 +377,25 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void + public function setDeliveries(?DeliveryDraftCollection $deliveries): void { $this->deliveries = $deliveries; } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void + public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php index 0fb1f2ea446..ada0b6edbbf 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php @@ -16,6 +16,8 @@ interface CartAddDiscountCodeAction extends CartUpdateAction public const FIELD_CODE = 'code'; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php index e3976fdcf61..3b3f8ee2eb1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php @@ -27,6 +27,8 @@ final class CartAddDiscountCodeActionBuilder implements Builder private $code; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php index c199d1c6d64..737c419e5ac 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    code of a DiscountCode.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php index 255267a80d1..d1f41efbfc3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php @@ -17,9 +17,8 @@ interface CartAddItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new Address must have a key that is unique accross this Cart.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php index a29e43b6805..a66cc33dd79 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class CartAddItemShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new Address must have a key that is unique accross this Cart.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php index 5da4d080430..2ebfe7ce313 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new Address must have a key that is unique accross this Cart.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php index 04f9ba32876..f8c69475833 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php @@ -16,66 +16,67 @@ interface CartAddLineItemAction extends CartUpdateAction { - public const FIELD_CUSTOM = 'custom'; - public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; + public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; + public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom(); - - /** - *

    ResourceIdentifier to a Channel.

    + *

    ID of an existing Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel(); - - /** - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate(); - - /** - * @return null|string */ public function getProductId(); /** + *

    ID of an existing ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ public function getVariantId(); /** + *

    SKU of an existing ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ public function getSku(); /** + *

    Number of Line Items to add to the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel(); + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -83,8 +84,7 @@ public function getQuantity(); public function getSupplyChannel(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -92,31 +92,36 @@ public function getSupplyChannel(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * - * @return null|ItemShippingDetailsDraft + * @return null|ExternalTaxRateDraft */ - public function getShippingDetails(); + public function getExternalTaxRate(); /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void; + *

    Container for Line Item-specific addresses.

    + * - /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @return null|ItemShippingDetailsDraft */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + public function getShippingDetails(); /** - * @param ?ExternalTaxRateDraft $externalTaxRate + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function getCustom(); /** * @param ?string $productId @@ -138,6 +143,11 @@ public function setSku(?string $sku): void; */ public function setQuantity(?int $quantity): void; + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -153,8 +163,18 @@ public function setExternalPrice(?Money $externalPrice): void; */ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php index fe51e76ce6a..f154d980916 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php @@ -26,24 +26,6 @@ */ final class CartAddLineItemActionBuilder implements Builder { - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder - */ - private $custom; - - /** - - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder - */ - private $distributionChannel; - - /** - - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder - */ - private $externalTaxRate; - /** * @var ?string @@ -68,6 +50,12 @@ final class CartAddLineItemActionBuilder implements Builder */ private $quantity; + /** + + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + */ + private $distributionChannel; + /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder @@ -88,42 +76,26 @@ final class CartAddLineItemActionBuilder implements Builder /** - * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder - */ - private $shippingDetails; - - /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - - * @return null|CustomFieldsDraft + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ - public function getCustom() - { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; - } + private $externalTaxRate; /** - *

    ResourceIdentifier to a Channel.

    - * - * @return null|ChannelResourceIdentifier + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ - public function getDistributionChannel() - { - return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; - } + private $shippingDetails; /** - * @return null|ExternalTaxRateDraft + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - public function getExternalTaxRate() - { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; - } + private $custom; /** + *

    ID of an existing Product.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ @@ -133,6 +105,10 @@ public function getProductId() } /** + *

    ID of an existing ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ @@ -142,6 +118,9 @@ public function getVariantId() } /** + *

    SKU of an existing ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ @@ -151,6 +130,8 @@ public function getSku() } /** + *

    Number of Line Items to add to the Cart.

    + * * @return null|int */ @@ -160,7 +141,21 @@ public function getQuantity() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -171,8 +166,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -183,6 +177,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -192,45 +188,36 @@ public function getExternalTotalPrice() } /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * - * @return null|ItemShippingDetailsDraft + * @return null|ExternalTaxRateDraft */ - public function getShippingDetails() + public function getExternalTaxRate() { - return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - * @param ?CustomFieldsDraft $custom - * @return $this - */ - public function withCustom(?CustomFieldsDraft $custom) - { - $this->custom = $custom; - - return $this; - } + *

    Container for Line Item-specific addresses.

    + * - /** - * @param ?ChannelResourceIdentifier $distributionChannel - * @return $this + * @return null|ItemShippingDetailsDraft */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + public function getShippingDetails() { - $this->distributionChannel = $distributionChannel; - - return $this; + return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate - * @return $this + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function getCustom() { - $this->externalTaxRate = $externalTaxRate; - - return $this; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -277,6 +264,17 @@ public function withQuantity(?int $quantity) return $this; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + * @return $this + */ + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + { + $this->distributionChannel = $distributionChannel; + + return $this; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel * @return $this @@ -311,45 +309,45 @@ public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTota } /** - * @param ?ItemShippingDetailsDraft $shippingDetails + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { - $this->shippingDetails = $shippingDetails; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @deprecated use withCustom() instead + * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withDistributionChannel() instead + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) + public function withCustom(?CustomFieldsDraft $custom) { - $this->distributionChannel = $distributionChannel; + $this->custom = $custom; return $this; } /** - * @deprecated use withExternalTaxRate() instead + * @deprecated use withDistributionChannel() instead * @return $this */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) { - $this->externalTaxRate = $externalTaxRate; + $this->distributionChannel = $distributionChannel; return $this; } @@ -387,6 +385,17 @@ public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @deprecated use withShippingDetails() instead * @return $this @@ -398,20 +407,31 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): CartAddLineItemAction { return new CartAddLineItemActionModel( - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->productId, $this->variantId, $this->sku, $this->quantity, + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php index 33fe66b2bc1..9181ca98fa9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php @@ -32,24 +32,6 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd */ protected $action; - /** - * - * @var ?CustomFieldsDraft - */ - protected $custom; - - /** - * - * @var ?ChannelResourceIdentifier - */ - protected $distributionChannel; - - /** - * - * @var ?ExternalTaxRateDraft - */ - protected $externalTaxRate; - /** * * @var ?string @@ -74,6 +56,12 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd */ protected $quantity; + /** + * + * @var ?ChannelResourceIdentifier + */ + protected $distributionChannel; + /** * * @var ?ChannelResourceIdentifier @@ -92,41 +80,53 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd */ protected $externalTotalPrice; + /** + * + * @var ?ExternalTaxRateDraft + */ + protected $externalTaxRate; + /** * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFieldsDraft $custom = null, - ?ChannelResourceIdentifier $distributionChannel = null, - ?ExternalTaxRateDraft $externalTaxRate = null, ?string $productId = null, ?int $variantId = null, ?string $sku = null, ?int $quantity = null, + ?ChannelResourceIdentifier $distributionChannel = null, ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?ExternalTaxRateDraft $externalTaxRate = null, ?ItemShippingDetailsDraft $shippingDetails = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { - $this->custom = $custom; - $this->distributionChannel = $distributionChannel; - $this->externalTaxRate = $externalTaxRate; $this->productId = $productId; $this->variantId = $variantId; $this->sku = $sku; $this->quantity = $quantity; + $this->distributionChannel = $distributionChannel; $this->supplyChannel = $supplyChannel; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; + $this->externalTaxRate = $externalTaxRate; $this->shippingDetails = $shippingDetails; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -149,67 +149,9 @@ public function getAction() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); - if (is_null($data)) { - return null; - } - - $this->custom = CustomFieldsDraftModel::of($data); - } - - return $this->custom; - } - - /** - *

    ResourceIdentifier to a Channel.

    - * + *

    ID of an existing Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel() - { - if (is_null($this->distributionChannel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); - if (is_null($data)) { - return null; - } - - $this->distributionChannel = ChannelResourceIdentifierModel::of($data); - } - - return $this->distributionChannel; - } - - /** - * - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - if (is_null($this->externalTaxRate)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); - if (is_null($data)) { - return null; - } - - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); - } - - return $this->externalTaxRate; - } - - /** * * @return null|string */ @@ -228,6 +170,10 @@ public function getProductId() } /** + *

    ID of an existing ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|int */ @@ -246,6 +192,9 @@ public function getVariantId() } /** + *

    SKU of an existing ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|string */ @@ -264,6 +213,8 @@ public function getSku() } /** + *

    Number of Line Items to add to the Cart.

    + * * * @return null|int */ @@ -282,7 +233,31 @@ public function getQuantity() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + * + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + if (is_null($this->distributionChannel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); + if (is_null($data)) { + return null; + } + + $this->distributionChannel = ChannelResourceIdentifierModel::of($data); + } + + return $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier @@ -303,8 +278,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -325,6 +299,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -344,6 +320,29 @@ public function getExternalTotalPrice() } /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * + * + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + } + + return $this->externalTaxRate; + } + + /** + *

    Container for Line Item-specific addresses.

    + * * * @return null|ItemShippingDetailsDraft */ @@ -362,31 +361,28 @@ public function getShippingDetails() return $this->shippingDetails; } - /** - * @param ?CustomFieldsDraft $custom + *

    Custom Fields for the Line Item.

    + * + * + * @return null|CustomFieldsDraft */ - public function setCustom(?CustomFieldsDraft $custom): void + public function getCustom() { - $this->custom = $custom; - } + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } - /** - * @param ?ChannelResourceIdentifier $distributionChannel - */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void - { - $this->distributionChannel = $distributionChannel; - } + $this->custom = CustomFieldsDraftModel::of($data); + } - /** - * @param ?ExternalTaxRateDraft $externalTaxRate - */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void - { - $this->externalTaxRate = $externalTaxRate; + return $this->custom; } + /** * @param ?string $productId */ @@ -419,6 +415,14 @@ public function setQuantity(?int $quantity): void $this->quantity = $quantity; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + { + $this->distributionChannel = $distributionChannel; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -443,6 +447,14 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal $this->externalTotalPrice = $externalTotalPrice; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -450,4 +462,12 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php index 38a0ef030fc..9c18f0bd7e5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php @@ -17,6 +17,9 @@ interface CartAddPaymentAction extends CartUpdateAction public const FIELD_PAYMENT = 'payment'; /** + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    + * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php index 538454ac1a4..5250991d348 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php @@ -29,6 +29,9 @@ final class CartAddPaymentActionBuilder implements Builder private $payment; /** + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    + * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php index 5c9ba435dde..7c523ad00bc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    + * * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php index 987bf8f7970..20724498b8b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php @@ -9,8 +9,9 @@ namespace Commercetools\Api\Models\Cart; use Commercetools\Api\Models\Common\BaseAddress; -use Commercetools\Api\Models\Order\DeliveryCollection; -use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; +use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -25,7 +26,7 @@ interface CartAddShippingMethodAction extends CartUpdateAction public const FIELD_CUSTOM = 'custom'; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the Shipping that must be unique across the Cart with Multiple ShippingMode.

    * * @return null|string @@ -33,11 +34,11 @@ interface CartAddShippingMethodAction extends CartUpdateAction public function getShippingKey(); /** - *

    Value to set. - * If empty, any existing value is removed.

    + *

    RecourceIdentifier to a ShippingMethod to add to the Cart with Multiple ShippingMode. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * - * @return null|ShippingMethodReference + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); @@ -50,12 +51,13 @@ public function getShippingMethod(); public function getShippingAddress(); /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -63,19 +65,18 @@ public function getShippingAddress(); public function getShippingRateInput(); /** - *

    Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

    + *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the referenced Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries(); @@ -83,7 +84,7 @@ public function getDeliveries(); *

    Custom Fields for the Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -93,9 +94,9 @@ public function getCustom(); public function setShippingKey(?string $shippingKey): void; /** - * @param ?ShippingMethodReference $shippingMethod + * @param ?ShippingMethodResourceIdentifier $shippingMethod */ - public function setShippingMethod(?ShippingMethodReference $shippingMethod): void; + public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void; /** * @param ?BaseAddress $shippingAddress @@ -108,17 +109,17 @@ public function setShippingAddress(?BaseAddress $shippingAddress): void; public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void; + public function setDeliveries(?DeliveryDraftCollection $deliveries): void; /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php index a9cdb9898a2..f68bcd006c2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php @@ -10,9 +10,11 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; -use Commercetools\Api\Models\Order\DeliveryCollection; -use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; -use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; +use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; +use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -33,7 +35,7 @@ final class CartAddShippingMethodActionBuilder implements Builder /** - * @var null|ShippingMethodReference|ShippingMethodReferenceBuilder + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; @@ -51,24 +53,24 @@ final class CartAddShippingMethodActionBuilder implements Builder /** - * @var ?string + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ private $deliveries; /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the Shipping that must be unique across the Cart with Multiple ShippingMode.

    * * @return null|string @@ -79,15 +81,15 @@ public function getShippingKey() } /** - *

    Value to set. - * If empty, any existing value is removed.

    + *

    RecourceIdentifier to a ShippingMethod to add to the Cart with Multiple ShippingMode. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * - * @return null|ShippingMethodReference + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() { - return $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod; + return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod; } /** @@ -102,12 +104,13 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -118,22 +121,21 @@ public function getShippingRateInput() } /** - *

    Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

    + *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { - return $this->externalTaxRate; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the referenced Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -144,11 +146,11 @@ public function getDeliveries() *

    Custom Fields for the Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { - return $this->custom; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -163,10 +165,10 @@ public function withShippingKey(?string $shippingKey) } /** - * @param ?ShippingMethodReference $shippingMethod + * @param ?ShippingMethodResourceIdentifier $shippingMethod * @return $this */ - public function withShippingMethod(?ShippingMethodReference $shippingMethod) + public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod) { $this->shippingMethod = $shippingMethod; @@ -196,10 +198,10 @@ public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withExternalTaxRate(?string $externalTaxRate) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { $this->externalTaxRate = $externalTaxRate; @@ -207,10 +209,10 @@ public function withExternalTaxRate(?string $externalTaxRate) } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries * @return $this */ - public function withDeliveries(?DeliveryCollection $deliveries) + public function withDeliveries(?DeliveryDraftCollection $deliveries) { $this->deliveries = $deliveries; @@ -218,10 +220,10 @@ public function withDeliveries(?DeliveryCollection $deliveries) } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withCustom(?string $custom) + public function withCustom(?CustomFieldsDraft $custom) { $this->custom = $custom; @@ -232,7 +234,7 @@ public function withCustom(?string $custom) * @deprecated use withShippingMethod() instead * @return $this */ - public function withShippingMethodBuilder(?ShippingMethodReferenceBuilder $shippingMethod) + public function withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod) { $this->shippingMethod = $shippingMethod; @@ -261,16 +263,38 @@ public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shi return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): CartAddShippingMethodAction { return new CartAddShippingMethodActionModel( $this->shippingKey, - $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod, + $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod, $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, - $this->externalTaxRate, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->deliveries, - $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php index 82d1a611430..80dcc678cac 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php @@ -10,9 +10,11 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressModel; -use Commercetools\Api\Models\Order\DeliveryCollection; -use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; -use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceModel; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; +use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; +use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -39,7 +41,7 @@ final class CartAddShippingMethodActionModel extends JsonObjectModel implements /** * - * @var ?ShippingMethodReference + * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; @@ -57,19 +59,19 @@ final class CartAddShippingMethodActionModel extends JsonObjectModel implements /** * - * @var ?string + * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** * - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ protected $deliveries; /** * - * @var ?string + * @var ?CustomFieldsDraft */ protected $custom; @@ -79,12 +81,12 @@ final class CartAddShippingMethodActionModel extends JsonObjectModel implements */ public function __construct( ?string $shippingKey = null, - ?ShippingMethodReference $shippingMethod = null, + ?ShippingMethodResourceIdentifier $shippingMethod = null, ?BaseAddress $shippingAddress = null, ?ShippingRateInputDraft $shippingRateInput = null, - ?string $externalTaxRate = null, - ?DeliveryCollection $deliveries = null, - ?string $custom = null, + ?ExternalTaxRateDraft $externalTaxRate = null, + ?DeliveryDraftCollection $deliveries = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->shippingKey = $shippingKey; @@ -116,7 +118,7 @@ public function getAction() } /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined identifier for the Shipping that must be unique across the Cart with Multiple ShippingMode.

    * * * @return null|string @@ -136,11 +138,11 @@ public function getShippingKey() } /** - *

    Value to set. - * If empty, any existing value is removed.

    + *

    RecourceIdentifier to a ShippingMethod to add to the Cart with Multiple ShippingMode. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * - * @return null|ShippingMethodReference + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() { @@ -151,7 +153,7 @@ public function getShippingMethod() return null; } - $this->shippingMethod = ShippingMethodReferenceModel::of($data); + $this->shippingMethod = ShippingMethodResourceIdentifierModel::of($data); } return $this->shippingMethod; @@ -179,12 +181,13 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * * @return null|ShippingRateInputDraft @@ -205,31 +208,31 @@ public function getShippingRateInput() } /** - *

    Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

    + *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { if (is_null($this->externalTaxRate)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->externalTaxRate = (string) $data; + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } return $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the referenced Shipping Method.

    * * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -239,7 +242,7 @@ public function getDeliveries() if (is_null($data)) { return null; } - $this->deliveries = DeliveryCollection::fromArray($data); + $this->deliveries = DeliveryDraftCollection::fromArray($data); } return $this->deliveries; @@ -249,17 +252,18 @@ public function getDeliveries() *

    Custom Fields for the Shipping Method.

    * * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { if (is_null($this->custom)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->custom = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } return $this->custom; @@ -275,9 +279,9 @@ public function setShippingKey(?string $shippingKey): void } /** - * @param ?ShippingMethodReference $shippingMethod + * @param ?ShippingMethodResourceIdentifier $shippingMethod */ - public function setShippingMethod(?ShippingMethodReference $shippingMethod): void + public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void { $this->shippingMethod = $shippingMethod; } @@ -299,25 +303,25 @@ public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput) } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void + public function setDeliveries(?DeliveryDraftCollection $deliveries): void { $this->deliveries = $deliveries; } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void + public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php index a22820ac0e6..76ec319c9b3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php @@ -16,11 +16,11 @@ interface CartAddShoppingListAction extends CartUpdateAction { public const FIELD_SHOPPING_LIST = 'shoppingList'; - public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; + public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * @return null|ShoppingListResourceIdentifier @@ -28,20 +28,22 @@ interface CartAddShoppingListAction extends CartUpdateAction public function getShoppingList(); /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel(); + public function getDistributionChannel(); /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel(); + public function getSupplyChannel(); /** * @param ?ShoppingListResourceIdentifier $shoppingList @@ -49,12 +51,12 @@ public function getDistributionChannel(); public function setShoppingList(?ShoppingListResourceIdentifier $shoppingList): void; /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php index 823c4f6db11..0e8be56cd1f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php @@ -34,16 +34,16 @@ final class CartAddShoppingListActionBuilder implements Builder * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $supplyChannel; + private $distributionChannel; /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $distributionChannel; + private $supplyChannel; /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * @return null|ShoppingListResourceIdentifier @@ -54,25 +54,27 @@ public function getShoppingList() } /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel() + public function getDistributionChannel() { - return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; + return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; } /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel() + public function getSupplyChannel() { - return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; + return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; } /** @@ -87,23 +89,23 @@ public function withShoppingList(?ShoppingListResourceIdentifier $shoppingList) } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel * @return $this */ - public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; return $this; } /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel * @return $this */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; return $this; } @@ -120,23 +122,23 @@ public function withShoppingListBuilder(?ShoppingListResourceIdentifierBuilder $ } /** - * @deprecated use withSupplyChannel() instead + * @deprecated use withDistributionChannel() instead * @return $this */ - public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) + public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; return $this; } /** - * @deprecated use withDistributionChannel() instead + * @deprecated use withSupplyChannel() instead * @return $this */ - public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) + public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; return $this; } @@ -145,8 +147,8 @@ public function build(): CartAddShoppingListAction { return new CartAddShoppingListActionModel( $this->shoppingList instanceof ShoppingListResourceIdentifierBuilder ? $this->shoppingList->build() : $this->shoppingList, - $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, + $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php index 21a3c4185b9..5d82d7b68e1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php @@ -40,13 +40,13 @@ final class CartAddShoppingListActionModel extends JsonObjectModel implements Ca * * @var ?ChannelResourceIdentifier */ - protected $supplyChannel; + protected $distributionChannel; /** * * @var ?ChannelResourceIdentifier */ - protected $distributionChannel; + protected $supplyChannel; /** @@ -54,13 +54,13 @@ final class CartAddShoppingListActionModel extends JsonObjectModel implements Ca */ public function __construct( ?ShoppingListResourceIdentifier $shoppingList = null, - ?ChannelResourceIdentifier $supplyChannel = null, ?ChannelResourceIdentifier $distributionChannel = null, + ?ChannelResourceIdentifier $supplyChannel = null, ?string $action = null ) { $this->shoppingList = $shoppingList; - $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -83,7 +83,7 @@ public function getAction() } /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * * @return null|ShoppingListResourceIdentifier @@ -104,45 +104,47 @@ public function getShoppingList() } /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel() + public function getDistributionChannel() { - if (is_null($this->supplyChannel)) { + if (is_null($this->distributionChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); + $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); if (is_null($data)) { return null; } - $this->supplyChannel = ChannelResourceIdentifierModel::of($data); + $this->distributionChannel = ChannelResourceIdentifierModel::of($data); } - return $this->supplyChannel; + return $this->distributionChannel; } /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel() + public function getSupplyChannel() { - if (is_null($this->distributionChannel)) { + if (is_null($this->supplyChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); + $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); if (is_null($data)) { return null; } - $this->distributionChannel = ChannelResourceIdentifierModel::of($data); + $this->supplyChannel = ChannelResourceIdentifierModel::of($data); } - return $this->distributionChannel; + return $this->supplyChannel; } @@ -155,18 +157,18 @@ public function setShoppingList(?ShoppingListResourceIdentifier $shoppingList): } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; } /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; } } diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php index 6ae65ddee5b..c94d22005da 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php @@ -17,12 +17,16 @@ interface CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction extends Car public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php index c50c07c2548..84c742d5a32 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php @@ -33,6 +33,8 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder im private $targetsDelta; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -42,6 +44,8 @@ public function getCustomLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php index fc1497ac6eb..e98e62e768e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,8 @@ public function getCustomLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php index 006b341c17e..e4393dda8d3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php @@ -17,12 +17,16 @@ interface CartApplyDeltaToLineItemShippingDetailsTargetsAction extends CartUpdat public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php index b392e7fc3c2..8092ffe1a52 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php @@ -33,6 +33,8 @@ final class CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder implemen private $targetsDelta; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -42,6 +44,8 @@ public function getLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php index 7f3b8e1afb0..6c07ee18ea8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,8 @@ public function getLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartBuilder.php b/lib/commercetools-api/src/Models/Cart/CartBuilder.php index 3c27052ee4e..25a5949dd33 100644 --- a/lib/commercetools-api/src/Models/Cart/CartBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartBuilder.php @@ -16,12 +16,12 @@ use Commercetools\Api\Models\Common\AddressCollection; use Commercetools\Api\Models\Common\BaseResource; use Commercetools\Api\Models\Common\BaseResourceBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\CreatedByBuilder; use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LastModifiedByBuilder; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceBuilder; use Commercetools\Api\Models\Order\PaymentInfo; @@ -75,27 +75,21 @@ final class CartBuilder implements Builder /** - * @var null|LastModifiedBy|LastModifiedByBuilder - */ - private $lastModifiedBy; - - /** - - * @var null|CreatedBy|CreatedByBuilder + * @var ?string */ - private $createdBy; + private $customerId; /** * @var ?string */ - private $customerId; + private $customerEmail; /** - * @var ?string + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ - private $customerEmail; + private $customerGroup; /** @@ -129,7 +123,13 @@ final class CartBuilder implements Builder /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var ?int + */ + private $totalLineItemQuantity; + + /** + + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalPrice; @@ -149,73 +149,73 @@ final class CartBuilder implements Builder * @var ?string */ - private $cartState; + private $taxMode; /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $shippingAddress; + private $taxRoundingMode; /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $billingAddress; + private $taxCalculationMode; /** * @var ?string */ - private $shippingMode; + private $inventoryMode; /** - * @var ?ShippingCollection + * @var ?string */ - private $shipping; + private $cartState; /** - * @var ?string + * @var null|Address|AddressBuilder */ - private $inventoryMode; + private $billingAddress; /** - * @var ?string + * @var null|Address|AddressBuilder */ - private $taxMode; + private $shippingAddress; /** * @var ?string */ - private $taxRoundingMode; + private $shippingMode; /** - * @var ?string + * @var null|ShippingInfo|ShippingInfoBuilder */ - private $taxCalculationMode; + private $shippingInfo; /** - * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder + * @var ?ShippingCollection */ - private $customerGroup; + private $shipping; /** - * @var ?string + * @var null|ShippingRateInput|ShippingRateInputBuilder */ - private $country; + private $shippingRateInput; /** - * @var null|ShippingInfo|ShippingInfoBuilder + * @var ?AddressCollection */ - private $shippingInfo; + private $itemShippingAddresses; /** @@ -231,9 +231,9 @@ final class CartBuilder implements Builder /** - * @var null|CustomFields|CustomFieldsBuilder + * @var ?CartDiscountReferenceCollection */ - private $custom; + private $refusedGifts; /** @@ -245,43 +245,43 @@ final class CartBuilder implements Builder * @var ?string */ - private $locale; + private $country; /** - * @var ?int + * @var ?string */ - private $deleteDaysAfterLastModification; + private $locale; /** - * @var ?CartDiscountReferenceCollection + * @var ?string */ - private $refusedGifts; + private $origin; /** - * @var ?string + * @var null|CustomFields|CustomFieldsBuilder */ - private $origin; + private $custom; /** - * @var null|ShippingRateInput|ShippingRateInputBuilder + * @var ?int */ - private $shippingRateInput; + private $deleteDaysAfterLastModification; /** - * @var ?AddressCollection + * @var null|LastModifiedBy|LastModifiedByBuilder */ - private $itemShippingAddresses; + private $lastModifiedBy; /** - * @var ?int + * @var null|CreatedBy|CreatedByBuilder */ - private $totalLineItemQuantity; + private $createdBy; /** *

    Unique identifier of the Cart.

    @@ -295,7 +295,7 @@ public function getId() } /** - *

    The current version of the cart.

    + *

    Current version of the Cart.

    * * @return null|int @@ -306,6 +306,8 @@ public function getVersion() } /** + *

    Date and time (UTC) the Cart was initially created.

    + * * @return null|DateTimeImmutable */ @@ -315,6 +317,8 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Cart was last updated.

    + * * @return null|DateTimeImmutable */ @@ -335,47 +339,40 @@ public function getKey() } /** - *

    Present on resources updated after 1 February 2019 except for events not tracked.

    + *

    id of the Customer that the Cart belongs to.

    * - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy() + public function getCustomerId() { - return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + return $this->customerId; } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Email address of the Customer that the Cart belongs to.

    * - * @return null|CreatedBy - */ - public function getCreatedBy() - { - return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; - } - - /** - * @return null|string */ - public function getCustomerId() + public function getCustomerEmail() { - return $this->customerId; + return $this->customerEmail; } /** + *

    Reference to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

    + * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail() + public function getCustomerGroup() { - return $this->customerEmail; + return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; } /** - *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Cart.

    * * @return null|string @@ -386,7 +383,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Cart belongs to.

    + *

    Reference to a Business Unit the Cart belongs to.

    * * @return null|BusinessUnitKeyReference @@ -397,6 +394,8 @@ public function getBusinessUnit() } /** + *

    Reference to a Store the Cart belongs to.

    + * * @return null|StoreKeyReference */ @@ -406,6 +405,8 @@ public function getStore() } /** + *

    Line Items added to the Cart.

    + * * @return null|LineItemCollection */ @@ -415,6 +416,8 @@ public function getLineItems() } /** + *

    Custom Line Items added to the Cart.

    + * * @return null|CustomLineItemCollection */ @@ -424,21 +427,33 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    + *

    Sum of all LineItem quantities, excluding CustomLineItems. Only present when the Cart has at least one LineItem.

    + * + + * @return null|int + */ + public function getTotalLineItemQuantity() + { + return $this->totalLineItemQuantity; + } + + /** + *

    Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo.

    + *

    Taxes are included if TaxRate includedInPrice is true for each price.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalPrice() { - return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; + return $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; } /** - *

    Not set until the shipping address is set. - * Will be set automatically in the Platform TaxMode. - * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    + *
      + *
    • For a Cart with Platform TaxMode, it is automatically set when a shipping address is set.
    • + *
    • For a Cart with External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
    • + *
    * * @return null|TaxedPrice @@ -449,8 +464,7 @@ public function getTaxedPrice() } /** - *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + *

    Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

    * * @return null|TaxedPrice @@ -461,135 +475,147 @@ public function getTaxedShippingPrice() } /** + *

    Indicates how Tax Rates are set.

    + * * @return null|string */ - public function getCartState() + public function getTaxMode() { - return $this->cartState; + return $this->taxMode; } /** - *

    The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

    + *

    Indicates how monetary values are rounded when calculating taxes for taxedPrice.

    * - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxRoundingMode() { - return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->taxRoundingMode; } /** + *

    Indicates how taxes are calculated when calculating taxes for taxedPrice.

    + * - * @return null|Address + * @return null|string */ - public function getBillingAddress() + public function getTaxCalculationMode() { - return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->taxCalculationMode; } /** - *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + *

    Indicates how stock quantities are tracked for Line Items in the Cart.

    * * @return null|string */ - public function getShippingMode() + public function getInventoryMode() { - return $this->shippingMode; + return $this->inventoryMode; } /** - *

    Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

    - *

    It is automatically updated after the Shipping Method is added.

    + *

    Current status of the Cart.

    * - * @return null|ShippingCollection + * @return null|string */ - public function getShipping() + public function getCartState() { - return $this->shipping; + return $this->cartState; } /** + *

    Billing address associated with the Cart.

    + * - * @return null|string + * @return null|Address */ - public function getInventoryMode() + public function getBillingAddress() { - return $this->inventoryMode; + return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    + * - * @return null|string + * @return null|Address */ - public function getTaxMode() + public function getShippingAddress() { - return $this->taxMode; + return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    + *

    Indicates whether the Cart has one or multiple Shipping Methods.

    * * @return null|string */ - public function getTaxRoundingMode() + public function getShippingMode() { - return $this->taxRoundingMode; + return $this->shippingMode; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    + *

    Shipping-related information of a Cart with Single ShippingMode. Automatically set when a Shipping Method is set.

    * - * @return null|string + * @return null|ShippingInfo */ - public function getTaxCalculationMode() + public function getShippingInfo() { - return $this->taxCalculationMode; + return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; } /** - *

    Set automatically when the customer is set and the customer is a member of a customer group. - * Used for product variant - * price selection.

    + *

    Shipping-related information of a Cart with Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

    * - * @return null|CustomerGroupReference + * @return null|ShippingCollection */ - public function getCustomerGroup() + public function getShipping() { - return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; + return $this->shipping; } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - return $this->country; + return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; } /** - *

    Shipping-related information of a Cart with Single ShippingMode. - * Set automatically once the ShippingMethod is set.

    + *

    Additional shipping addresses of the Cart as specified by LineItems using the shippingDetails field.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

    * - * @return null|ShippingInfo + * @return null|AddressCollection */ - public function getShippingInfo() + public function getItemShippingAddresses() { - return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; + return $this->itemShippingAddresses; } /** + *

    Discount Codes applied to the Cart. A Cart that has directDiscounts cannot have discountCodes.

    + * * @return null|DiscountCodeInfoCollection */ @@ -599,6 +625,8 @@ public function getDiscountCodes() } /** + *

    Direct Discounts added to the Cart. A Cart that has discountCodes cannot have directDiscounts.

    + * * @return null|DirectDiscountCollection */ @@ -608,15 +636,19 @@ public function getDirectDiscounts() } /** + *

    Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Cart.

    + * - * @return null|CustomFields + * @return null|CartDiscountReferenceCollection */ - public function getCustom() + public function getRefusedGifts() { - return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + return $this->refusedGifts; } /** + *

    Payment information related to the Cart.

    + * * @return null|PaymentInfo */ @@ -626,82 +658,80 @@ public function getPaymentInfo() } /** + *

    Used for LineItem Price selection.

    + * * @return null|string */ - public function getLocale() + public function getCountry() { - return $this->locale; + return $this->country; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

    + *

    Languages of the Cart. Can only contain languages supported by the Project.

    * - * @return null|int + * @return null|string */ - public function getDeleteDaysAfterLastModification() + public function getLocale() { - return $this->deleteDaysAfterLastModification; + return $this->locale; } /** - *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

    + *

    Indicates how the Cart was created.

    * - * @return null|CartDiscountReferenceCollection + * @return null|string */ - public function getRefusedGifts() + public function getOrigin() { - return $this->refusedGifts; + return $this->origin; } /** - *

    The origin field indicates how this cart was created. - * The value Customer indicates, that the cart was created by the customer.

    + *

    Custom Fields of the Cart.

    * - * @return null|string + * @return null|CustomFields */ - public function getOrigin() + public function getCustom() { - return $this->origin; + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Number of days after which an active Cart is deleted since its last modification. Configured in Project settings.

    * - * @return null|ShippingRateInput + * @return null|int */ - public function getShippingRateInput() + public function getDeleteDaysAfterLastModification() { - return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + return $this->deleteDaysAfterLastModification; } /** - *

    Contains addresses for carts with multiple shipping addresses. - * Line items reference these addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

    + *

    Present on resources updated after 1 February 2019 except for events not tracked.

    * - * @return null|AddressCollection + * @return null|LastModifiedBy */ - public function getItemShippingAddresses() + public function getLastModifiedBy() { - return $this->itemShippingAddresses; + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; } /** - *

    The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * - * @return null|int + * @return null|CreatedBy */ - public function getTotalLineItemQuantity() + public function getCreatedBy() { - return $this->totalLineItemQuantity; + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; } /** @@ -760,45 +790,34 @@ public function withKey(?string $key) } /** - * @param ?LastModifiedBy $lastModifiedBy - * @return $this - */ - public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) - { - $this->lastModifiedBy = $lastModifiedBy; - - return $this; - } - - /** - * @param ?CreatedBy $createdBy + * @param ?string $customerId * @return $this */ - public function withCreatedBy(?CreatedBy $createdBy) + public function withCustomerId(?string $customerId) { - $this->createdBy = $createdBy; + $this->customerId = $customerId; return $this; } /** - * @param ?string $customerId + * @param ?string $customerEmail * @return $this */ - public function withCustomerId(?string $customerId) + public function withCustomerEmail(?string $customerEmail) { - $this->customerId = $customerId; + $this->customerEmail = $customerEmail; return $this; } /** - * @param ?string $customerEmail + * @param ?CustomerGroupReference $customerGroup * @return $this */ - public function withCustomerEmail(?string $customerEmail) + public function withCustomerGroup(?CustomerGroupReference $customerGroup) { - $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; return $this; } @@ -859,10 +878,21 @@ public function withCustomLineItems(?CustomLineItemCollection $customLineItems) } /** - * @param ?TypedMoney $totalPrice + * @param ?int $totalLineItemQuantity * @return $this */ - public function withTotalPrice(?TypedMoney $totalPrice) + public function withTotalLineItemQuantity(?int $totalLineItemQuantity) + { + $this->totalLineItemQuantity = $totalLineItemQuantity; + + return $this; + } + + /** + * @param ?CentPrecisionMoney $totalPrice + * @return $this + */ + public function withTotalPrice(?CentPrecisionMoney $totalPrice) { $this->totalPrice = $totalPrice; @@ -892,133 +922,133 @@ public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) } /** - * @param ?string $cartState + * @param ?string $taxMode * @return $this */ - public function withCartState(?string $cartState) + public function withTaxMode(?string $taxMode) { - $this->cartState = $cartState; + $this->taxMode = $taxMode; return $this; } /** - * @param ?Address $shippingAddress + * @param ?string $taxRoundingMode * @return $this */ - public function withShippingAddress(?Address $shippingAddress) + public function withTaxRoundingMode(?string $taxRoundingMode) { - $this->shippingAddress = $shippingAddress; + $this->taxRoundingMode = $taxRoundingMode; return $this; } /** - * @param ?Address $billingAddress + * @param ?string $taxCalculationMode * @return $this */ - public function withBillingAddress(?Address $billingAddress) + public function withTaxCalculationMode(?string $taxCalculationMode) { - $this->billingAddress = $billingAddress; + $this->taxCalculationMode = $taxCalculationMode; return $this; } /** - * @param ?string $shippingMode + * @param ?string $inventoryMode * @return $this */ - public function withShippingMode(?string $shippingMode) + public function withInventoryMode(?string $inventoryMode) { - $this->shippingMode = $shippingMode; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?ShippingCollection $shipping + * @param ?string $cartState * @return $this */ - public function withShipping(?ShippingCollection $shipping) + public function withCartState(?string $cartState) { - $this->shipping = $shipping; + $this->cartState = $cartState; return $this; } /** - * @param ?string $inventoryMode + * @param ?Address $billingAddress * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withBillingAddress(?Address $billingAddress) { - $this->inventoryMode = $inventoryMode; + $this->billingAddress = $billingAddress; return $this; } /** - * @param ?string $taxMode + * @param ?Address $shippingAddress * @return $this */ - public function withTaxMode(?string $taxMode) + public function withShippingAddress(?Address $shippingAddress) { - $this->taxMode = $taxMode; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingMode * @return $this */ - public function withTaxRoundingMode(?string $taxRoundingMode) + public function withShippingMode(?string $shippingMode) { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingMode = $shippingMode; return $this; } /** - * @param ?string $taxCalculationMode + * @param ?ShippingInfo $shippingInfo * @return $this */ - public function withTaxCalculationMode(?string $taxCalculationMode) + public function withShippingInfo(?ShippingInfo $shippingInfo) { - $this->taxCalculationMode = $taxCalculationMode; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingCollection $shipping * @return $this */ - public function withCustomerGroup(?CustomerGroupReference $customerGroup) + public function withShipping(?ShippingCollection $shipping) { - $this->customerGroup = $customerGroup; + $this->shipping = $shipping; return $this; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput * @return $this */ - public function withCountry(?string $country) + public function withShippingRateInput(?ShippingRateInput $shippingRateInput) { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?AddressCollection $itemShippingAddresses * @return $this */ - public function withShippingInfo(?ShippingInfo $shippingInfo) + public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) { - $this->shippingInfo = $shippingInfo; + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } @@ -1046,12 +1076,12 @@ public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts) } /** - * @param ?CustomFields $custom + * @param ?CartDiscountReferenceCollection $refusedGifts * @return $this */ - public function withCustom(?CustomFields $custom) + public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) { - $this->custom = $custom; + $this->refusedGifts = $refusedGifts; return $this; } @@ -1068,34 +1098,23 @@ public function withPaymentInfo(?PaymentInfo $paymentInfo) } /** - * @param ?string $locale - * @return $this - */ - public function withLocale(?string $locale) - { - $this->locale = $locale; - - return $this; - } - - /** - * @param ?int $deleteDaysAfterLastModification + * @param ?string $country * @return $this */ - public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) + public function withCountry(?string $country) { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->country = $country; return $this; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?string $locale * @return $this */ - public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) + public function withLocale(?string $locale) { - $this->refusedGifts = $refusedGifts; + $this->locale = $locale; return $this; } @@ -1112,56 +1131,56 @@ public function withOrigin(?string $origin) } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?CustomFields $custom * @return $this */ - public function withShippingRateInput(?ShippingRateInput $shippingRateInput) + public function withCustom(?CustomFields $custom) { - $this->shippingRateInput = $shippingRateInput; + $this->custom = $custom; return $this; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?int $deleteDaysAfterLastModification * @return $this */ - public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) + public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; return $this; } /** - * @param ?int $totalLineItemQuantity + * @param ?LastModifiedBy $lastModifiedBy * @return $this */ - public function withTotalLineItemQuantity(?int $totalLineItemQuantity) + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) { - $this->totalLineItemQuantity = $totalLineItemQuantity; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @deprecated use withLastModifiedBy() instead + * @param ?CreatedBy $createdBy * @return $this */ - public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + public function withCreatedBy(?CreatedBy $createdBy) { - $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; return $this; } /** - * @deprecated use withCreatedBy() instead + * @deprecated use withCustomerGroup() instead * @return $this */ - public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) { - $this->createdBy = $createdBy; + $this->customerGroup = $customerGroup; return $this; } @@ -1192,7 +1211,7 @@ public function withStoreBuilder(?StoreKeyReferenceBuilder $store) * @deprecated use withTotalPrice() instead * @return $this */ - public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice) + public function withTotalPriceBuilder(?CentPrecisionMoneyBuilder $totalPrice) { $this->totalPrice = $totalPrice; @@ -1221,6 +1240,17 @@ public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingP return $this; } + /** + * @deprecated use withBillingAddress() instead + * @return $this + */ + public function withBillingAddressBuilder(?AddressBuilder $billingAddress) + { + $this->billingAddress = $billingAddress; + + return $this; + } + /** * @deprecated use withShippingAddress() instead * @return $this @@ -1233,34 +1263,34 @@ public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) } /** - * @deprecated use withBillingAddress() instead + * @deprecated use withShippingInfo() instead * @return $this */ - public function withBillingAddressBuilder(?AddressBuilder $billingAddress) + public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) { - $this->billingAddress = $billingAddress; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @deprecated use withCustomerGroup() instead + * @deprecated use withShippingRateInput() instead * @return $this */ - public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) { - $this->customerGroup = $customerGroup; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @deprecated use withShippingInfo() instead + * @deprecated use withPaymentInfo() instead * @return $this */ - public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) + public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) { - $this->shippingInfo = $shippingInfo; + $this->paymentInfo = $paymentInfo; return $this; } @@ -1277,23 +1307,23 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) } /** - * @deprecated use withPaymentInfo() instead + * @deprecated use withLastModifiedBy() instead * @return $this */ - public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) { - $this->paymentInfo = $paymentInfo; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @deprecated use withShippingRateInput() instead + * @deprecated use withCreatedBy() instead * @return $this */ - public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) { - $this->shippingRateInput = $shippingRateInput; + $this->createdBy = $createdBy; return $this; } @@ -1306,41 +1336,41 @@ public function build(): Cart $this->createdAt, $this->lastModifiedAt, $this->key, - $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, - $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, $this->customerId, $this->customerEmail, + $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->anonymousId, $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, - $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, + $this->totalLineItemQuantity, + $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, - $this->cartState, - $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, - $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, - $this->shippingMode, - $this->shipping, - $this->inventoryMode, $this->taxMode, $this->taxRoundingMode, $this->taxCalculationMode, - $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, - $this->country, + $this->inventoryMode, + $this->cartState, + $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingMode, $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->shipping, + $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->itemShippingAddresses, $this->discountCodes, $this->directDiscounts, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->refusedGifts, $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, + $this->country, $this->locale, - $this->deleteDaysAfterLastModification, - $this->refusedGifts, $this->origin, - $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, - $this->itemShippingAddresses, - $this->totalLineItemQuantity + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->deleteDaysAfterLastModification, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php index c4ecefe3874..419d56d67ea 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php @@ -18,14 +18,15 @@ interface CartChangeCustomLineItemMoneyAction extends CartUpdateAction public const FIELD_MONEY = 'money'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. Must not be empty. Can be a negative amount.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php index 1d09a9fdf15..0614170f5a8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php @@ -35,6 +35,8 @@ final class CartChangeCustomLineItemMoneyActionBuilder implements Builder private $money; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -44,8 +46,7 @@ public function getCustomLineItemId() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. Must not be empty. Can be a negative amount.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php index 54da0b96382..0ef0a2a6cc7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -91,8 +93,7 @@ public function getCustomLineItemId() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. Must not be empty. Can be a negative amount.

    * * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php index 28c76422306..1fabc298f09 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php @@ -17,7 +17,7 @@ interface CartChangeCustomLineItemPriceModeAction extends CartUpdateAction public const FIELD_MODE = 'mode'; /** - *

    ID of the Custom Line Item to be updated.

    + *

    id of the CustomLineItem to update.

    * * @return null|string @@ -25,7 +25,7 @@ interface CartChangeCustomLineItemPriceModeAction extends CartUpdateAction public function getCustomLineItemId(); /** - *

    New value to set.

    + *

    New value to set. Must not be empty.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php index b88ff87999b..c47abdb6893 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php @@ -33,7 +33,7 @@ final class CartChangeCustomLineItemPriceModeActionBuilder implements Builder private $mode; /** - *

    ID of the Custom Line Item to be updated.

    + *

    id of the CustomLineItem to update.

    * * @return null|string @@ -44,7 +44,7 @@ public function getCustomLineItemId() } /** - *

    New value to set.

    + *

    New value to set. Must not be empty.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php index ddc4214c596..db255e637eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php @@ -71,7 +71,7 @@ public function getAction() } /** - *

    ID of the Custom Line Item to be updated.

    + *

    id of the CustomLineItem to update.

    * * * @return null|string @@ -91,7 +91,7 @@ public function getCustomLineItemId() } /** - *

    New value to set.

    + *

    New value to set. Must not be empty.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php index 0ca4640abd1..b38fd48b565 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php @@ -17,12 +17,17 @@ interface CartChangeCustomLineItemQuantityAction extends CartUpdateAction public const FIELD_QUANTITY = 'quantity'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    New value to set.

    + *

    If 0, the Custom Line Item is removed from the Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php index b9ffbe2451a..d7e1f0612cc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php @@ -33,6 +33,8 @@ final class CartChangeCustomLineItemQuantityActionBuilder implements Builder private $quantity; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getCustomLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Custom Line Item is removed from the Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php index 65ed645a5fe..f26652cec8a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getCustomLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Custom Line Item is removed from the Cart.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php index 6e2109d8fd0..c68c8104e74 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php @@ -20,20 +20,25 @@ interface CartChangeLineItemQuantityAction extends CartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -41,6 +46,8 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php index f1481401427..9386d7001b5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php @@ -47,6 +47,8 @@ final class CartChangeLineItemQuantityActionBuilder implements Builder private $externalTotalPrice; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -56,6 +58,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ @@ -65,8 +70,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -77,6 +82,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php index d002e5b9c30..dab35b838c0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php @@ -89,6 +89,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -107,6 +109,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * * @return null|int */ @@ -125,8 +130,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * * @return null|Money @@ -147,6 +152,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php index 7ffd4fd76d7..edc2f7e6b88 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php @@ -16,6 +16,8 @@ interface CartChangeTaxCalculationModeAction extends CartUpdateAction public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; /** + *

    New value to set.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php index 7a51bf65c4e..2824ada21be 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php @@ -27,6 +27,8 @@ final class CartChangeTaxCalculationModeActionBuilder implements Builder private $taxCalculationMode; /** + *

    New value to set.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php index 744d37ee86b..3533e981f4d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    New value to set.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php index 64df642c6c4..68f32cbadb1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php @@ -16,6 +16,8 @@ interface CartChangeTaxModeAction extends CartUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + *

    The new TaxMode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php index c418a48dd8c..00afe69723b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php @@ -27,6 +27,8 @@ final class CartChangeTaxModeActionBuilder implements Builder private $taxMode; /** + *

    The new TaxMode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php index 22259da9823..825dce00682 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    The new TaxMode.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php index c11d5cb597e..bb23d92eab3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php @@ -16,6 +16,8 @@ interface CartChangeTaxRoundingModeAction extends CartUpdateAction public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; /** + *

    New value to set.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php index d1b50302e02..3100178fa88 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php @@ -27,6 +27,8 @@ final class CartChangeTaxRoundingModeActionBuilder implements Builder private $taxRoundingMode; /** + *

    New value to set.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php index 4d17d529f51..1400516eccb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    New value to set.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartDraft.php b/lib/commercetools-api/src/Models/Cart/CartDraft.php index e5a30d675fb..80281af83f2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraft.php @@ -28,30 +28,30 @@ interface CartDraft extends JsonObject public const FIELD_ANONYMOUS_ID = 'anonymousId'; public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; - public const FIELD_COUNTRY = 'country'; - public const FIELD_INVENTORY_MODE = 'inventoryMode'; + public const FIELD_LINE_ITEMS = 'lineItems'; + public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; public const FIELD_TAX_MODE = 'taxMode'; + public const FIELD_EXTERNAL_TAX_RATE_FOR_SHIPPING_METHOD = 'externalTaxRateForShippingMethod'; public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; - public const FIELD_LINE_ITEMS = 'lineItems'; - public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; - public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; public const FIELD_SHIPPING_METHOD = 'shippingMethod'; - public const FIELD_EXTERNAL_TAX_RATE_FOR_SHIPPING_METHOD = 'externalTaxRateForShippingMethod'; - public const FIELD_CUSTOM = 'custom'; - public const FIELD_LOCALE = 'locale'; - public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; - public const FIELD_ORIGIN = 'origin'; + public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; public const FIELD_SHIPPING_MODE = 'shippingMode'; public const FIELD_CUSTOM_SHIPPING = 'customShipping'; public const FIELD_SHIPPING = 'shipping'; - public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_DISCOUNT_CODES = 'discountCodes'; + public const FIELD_COUNTRY = 'country'; + public const FIELD_LOCALE = 'locale'; + public const FIELD_ORIGIN = 'origin'; + public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; + public const FIELD_CUSTOM = 'custom'; /** - *

    A three-digit currency code as per ISO 4217.

    + *

    Currency the Cart uses.

    * * @return null|string @@ -67,7 +67,7 @@ public function getCurrency(); public function getKey(); /** - *

    Id of an existing Customer.

    + *

    id of the Customer that the Cart belongs to.

    * * @return null|string @@ -75,14 +75,17 @@ public function getKey(); public function getCustomerId(); /** + *

    Email address of the Customer that the Cart belongs to.

    + * * @return null|string */ public function getCustomerEmail(); /** - *

    Will be set automatically when the customerId is set and the customer is a member of a customer group. - * Can be set explicitly when no customerId is present.

    + *

    ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

    + *

    It is automatically set if the Customer referenced in customerId belongs to a Customer Group. + * It can also be set explicitly when no customerId is present.

    * * @return null|CustomerGroupResourceIdentifier @@ -90,7 +93,7 @@ public function getCustomerEmail(); public function getCustomerGroup(); /** - *

    Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Cart.

    * * @return null|string @@ -98,7 +101,7 @@ public function getCustomerGroup(); public function getAnonymousId(); /** - *

    The Business Unit the Cart belongs to.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * * @return null|BusinessUnitResourceIdentifier @@ -106,8 +109,7 @@ public function getAnonymousId(); public function getBusinessUnit(); /** - *

    Assigns the new cart to the store. - * The store assignment can not be modified.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * * @return null|StoreResourceIdentifier @@ -115,23 +117,23 @@ public function getBusinessUnit(); public function getStore(); /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Line Items to add to the Cart.

    * - * @return null|string + * @return null|LineItemDraftCollection */ - public function getCountry(); + public function getLineItems(); /** - *

    Default inventory mode is None.

    + *

    Custom Line Items to add to the Cart.

    * - * @return null|string + * @return null|CustomLineItemDraftCollection */ - public function getInventoryMode(); + public function getCustomLineItems(); /** - *

    The default tax mode is Platform.

    + *

    Determines how Tax Rates are set.

    * * @return null|string @@ -139,152 +141,162 @@ public function getInventoryMode(); public function getTaxMode(); /** - *

    The default tax rounding mode is HalfEven.

    + *

    External Tax Rate for the shippingMethod if the Cart has External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ - public function getTaxRoundingMode(); + public function getExternalTaxRateForShippingMethod(); /** - *

    The default tax calculation mode is LineItemLevel.

    + *

    Determines how monetary values are rounded when calculating taxes for taxedPrice.

    * * @return null|string */ - public function getTaxCalculationMode(); + public function getTaxRoundingMode(); /** + *

    Determines how taxes are calculated when calculating taxes for taxedPrice.

    + * - * @return null|LineItemDraftCollection + * @return null|string */ - public function getLineItems(); + public function getTaxCalculationMode(); /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    + * - * @return null|CustomLineItemDraftCollection + * @return null|string */ - public function getCustomLineItems(); + public function getInventoryMode(); /** - *

    The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

    + *

    Billing address associated with the Cart.

    * * @return null|BaseAddress */ - public function getShippingAddress(); + public function getBillingAddress(); /** + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    + * * @return null|BaseAddress */ - public function getBillingAddress(); + public function getShippingAddress(); /** + *

    Shipping Method for a Cart with Single ShippingMode. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); /** - *

    An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * - * @return null|ExternalTaxRateDraft + * @return null|ShippingRateInputDraft */ - public function getExternalTaxRateForShippingMethod(); + public function getShippingRateInput(); /** - *

    The custom fields.

    + *
      + *
    • If set to Single, only a single Shipping Method can be added to the Cart.
    • + *
    • If set to Multiple, multiple Shipping Methods can be added to the Cart.
    • + *
    * - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom(); + public function getShippingMode(); /** - *

    Must be one of the languages supported for this project

    + *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    * - * @return null|string + * @return null|CustomShippingDraftCollection */ - public function getLocale(); + public function getCustomShipping(); /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    Shipping Methods for a Cart with Multiple ShippingMode.

    * - * @return null|int + * @return null|ShippingDraftCollection */ - public function getDeleteDaysAfterLastModification(); + public function getShipping(); /** - *

    The default origin is Customer.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

    * - * @return null|string + * @return null|BaseAddressCollection */ - public function getOrigin(); + public function getItemShippingAddresses(); /** - *
      - *
    • If Single, only a single Shipping Method can be added to the Cart.
    • - *
    • If Multiple, multiple Shipping Methods can be added to the Cart.
    • - *
    + *

    code of the existing DiscountCodes to add to the Cart.

    * - * @return null|string + * @return null|array */ - public function getShippingMode(); + public function getDiscountCodes(); /** - *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * - * @return null|CustomShippingDraftCollection + * @return null|string */ - public function getCustomShipping(); + public function getCountry(); /** - *

    Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Languages of the Cart. Can only contain languages supported by the Project.

    * - * @return null|ShippingDraftCollection + * @return null|string */ - public function getShipping(); + public function getLocale(); /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier. - * Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    Indicates how the Cart was created.

    * - * @return null|ShippingRateInputDraft + * @return null|string */ - public function getShippingRateInput(); + public function getOrigin(); /** - *

    Contains addresses for carts with multiple shipping addresses. - * Each address must contain a key which is unique in this cart. - * Line items will use these keys to reference the addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

    + *

    Number of days after which an active Cart is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * - * @return null|BaseAddressCollection + * @return null|int */ - public function getItemShippingAddresses(); + public function getDeleteDaysAfterLastModification(); /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes(); + public function getCustom(); /** * @param ?string $currency @@ -327,20 +339,25 @@ public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): public function setStore(?StoreResourceIdentifier $store): void; /** - * @param ?string $country + * @param ?LineItemDraftCollection $lineItems */ - public function setCountry(?string $country): void; + public function setLineItems(?LineItemDraftCollection $lineItems): void; /** - * @param ?string $inventoryMode + * @param ?CustomLineItemDraftCollection $customLineItems */ - public function setInventoryMode(?string $inventoryMode): void; + public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void; /** * @param ?string $taxMode */ public function setTaxMode(?string $taxMode): void; + /** + * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + */ + public function setExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod): void; + /** * @param ?string $taxRoundingMode */ @@ -352,82 +369,77 @@ public function setTaxRoundingMode(?string $taxRoundingMode): void; public function setTaxCalculationMode(?string $taxCalculationMode): void; /** - * @param ?LineItemDraftCollection $lineItems + * @param ?string $inventoryMode */ - public function setLineItems(?LineItemDraftCollection $lineItems): void; + public function setInventoryMode(?string $inventoryMode): void; /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?BaseAddress $billingAddress */ - public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void; + public function setBillingAddress(?BaseAddress $billingAddress): void; /** * @param ?BaseAddress $shippingAddress */ public function setShippingAddress(?BaseAddress $shippingAddress): void; - /** - * @param ?BaseAddress $billingAddress - */ - public function setBillingAddress(?BaseAddress $billingAddress): void; - /** * @param ?ShippingMethodResourceIdentifier $shippingMethod */ public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void; /** - * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + * @param ?ShippingRateInputDraft $shippingRateInput */ - public function setExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod): void; + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shippingMode */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setShippingMode(?string $shippingMode): void; /** - * @param ?string $locale + * @param ?CustomShippingDraftCollection $customShipping */ - public function setLocale(?string $locale): void; + public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void; /** - * @param ?int $deleteDaysAfterLastModification + * @param ?ShippingDraftCollection $shipping */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; + public function setShipping(?ShippingDraftCollection $shipping): void; /** - * @param ?string $origin + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setOrigin(?string $origin): void; + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; /** - * @param ?string $shippingMode + * @param ?array $discountCodes */ - public function setShippingMode(?string $shippingMode): void; + public function setDiscountCodes(?array $discountCodes): void; /** - * @param ?CustomShippingDraftCollection $customShipping + * @param ?string $country */ - public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void; + public function setCountry(?string $country): void; /** - * @param ?ShippingDraftCollection $shipping + * @param ?string $locale */ - public function setShipping(?ShippingDraftCollection $shipping): void; + public function setLocale(?string $locale): void; /** - * @param ?ShippingRateInputDraft $shippingRateInput + * @param ?string $origin */ - public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; + public function setOrigin(?string $origin): void; /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?int $deleteDaysAfterLastModification */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom */ - public function setDiscountCodes(?array $discountCodes): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php index cd5087468ff..aad8769bb1b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php @@ -83,15 +83,15 @@ final class CartDraftBuilder implements Builder /** - * @var ?string + * @var ?LineItemDraftCollection */ - private $country; + private $lineItems; /** - * @var ?string + * @var ?CustomLineItemDraftCollection */ - private $inventoryMode; + private $customLineItems; /** @@ -101,39 +101,39 @@ final class CartDraftBuilder implements Builder /** - * @var ?string + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ - private $taxRoundingMode; + private $externalTaxRateForShippingMethod; /** * @var ?string */ - private $taxCalculationMode; + private $taxRoundingMode; /** - * @var ?LineItemDraftCollection + * @var ?string */ - private $lineItems; + private $taxCalculationMode; /** - * @var ?CustomLineItemDraftCollection + * @var ?string */ - private $customLineItems; + private $inventoryMode; /** * @var null|BaseAddress|BaseAddressBuilder */ - private $shippingAddress; + private $billingAddress; /** * @var null|BaseAddress|BaseAddressBuilder */ - private $billingAddress; + private $shippingAddress; /** @@ -143,72 +143,72 @@ final class CartDraftBuilder implements Builder /** - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder */ - private $externalTaxRateForShippingMethod; + private $shippingRateInput; /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var ?string */ - private $custom; + private $shippingMode; /** - * @var ?string + * @var ?CustomShippingDraftCollection */ - private $locale; + private $customShipping; /** - * @var ?int + * @var ?ShippingDraftCollection */ - private $deleteDaysAfterLastModification; + private $shipping; /** - * @var ?string + * @var ?BaseAddressCollection */ - private $origin; + private $itemShippingAddresses; /** - * @var ?string + * @var ?array */ - private $shippingMode; + private $discountCodes; /** - * @var ?CustomShippingDraftCollection + * @var ?string */ - private $customShipping; + private $country; /** - * @var ?ShippingDraftCollection + * @var ?string */ - private $shipping; + private $locale; /** - * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder + * @var ?string */ - private $shippingRateInput; + private $origin; /** - * @var ?BaseAddressCollection + * @var ?int */ - private $itemShippingAddresses; + private $deleteDaysAfterLastModification; /** - * @var ?array + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - private $discountCodes; + private $custom; /** - *

    A three-digit currency code as per ISO 4217.

    + *

    Currency the Cart uses.

    * * @return null|string @@ -230,7 +230,7 @@ public function getKey() } /** - *

    Id of an existing Customer.

    + *

    id of the Customer that the Cart belongs to.

    * * @return null|string @@ -241,6 +241,8 @@ public function getCustomerId() } /** + *

    Email address of the Customer that the Cart belongs to.

    + * * @return null|string */ @@ -250,8 +252,9 @@ public function getCustomerEmail() } /** - *

    Will be set automatically when the customerId is set and the customer is a member of a customer group. - * Can be set explicitly when no customerId is present.

    + *

    ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

    + *

    It is automatically set if the Customer referenced in customerId belongs to a Customer Group. + * It can also be set explicitly when no customerId is present.

    * * @return null|CustomerGroupResourceIdentifier @@ -262,7 +265,7 @@ public function getCustomerGroup() } /** - *

    Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Cart.

    * * @return null|string @@ -273,7 +276,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Cart belongs to.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * * @return null|BusinessUnitResourceIdentifier @@ -284,8 +287,7 @@ public function getBusinessUnit() } /** - *

    Assigns the new cart to the store. - * The store assignment can not be modified.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * * @return null|StoreResourceIdentifier @@ -296,29 +298,29 @@ public function getStore() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Line Items to add to the Cart.

    * - * @return null|string + * @return null|LineItemDraftCollection */ - public function getCountry() + public function getLineItems() { - return $this->country; + return $this->lineItems; } /** - *

    Default inventory mode is None.

    + *

    Custom Line Items to add to the Cart.

    * - * @return null|string + * @return null|CustomLineItemDraftCollection */ - public function getInventoryMode() + public function getCustomLineItems() { - return $this->inventoryMode; + return $this->customLineItems; } /** - *

    The default tax mode is Platform.

    + *

    Determines how Tax Rates are set.

    * * @return null|string @@ -329,66 +331,74 @@ public function getTaxMode() } /** - *

    The default tax rounding mode is HalfEven.

    + *

    External Tax Rate for the shippingMethod if the Cart has External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ - public function getTaxRoundingMode() + public function getExternalTaxRateForShippingMethod() { - return $this->taxRoundingMode; + return $this->externalTaxRateForShippingMethod instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRateForShippingMethod->build() : $this->externalTaxRateForShippingMethod; } /** - *

    The default tax calculation mode is LineItemLevel.

    + *

    Determines how monetary values are rounded when calculating taxes for taxedPrice.

    * * @return null|string */ - public function getTaxCalculationMode() + public function getTaxRoundingMode() { - return $this->taxCalculationMode; + return $this->taxRoundingMode; } /** + *

    Determines how taxes are calculated when calculating taxes for taxedPrice.

    + * - * @return null|LineItemDraftCollection + * @return null|string */ - public function getLineItems() + public function getTaxCalculationMode() { - return $this->lineItems; + return $this->taxCalculationMode; } /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    + * - * @return null|CustomLineItemDraftCollection + * @return null|string */ - public function getCustomLineItems() + public function getInventoryMode() { - return $this->customLineItems; + return $this->inventoryMode; } /** - *

    The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

    + *

    Billing address associated with the Cart.

    * * @return null|BaseAddress */ - public function getShippingAddress() + public function getBillingAddress() { - return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    + * * @return null|BaseAddress */ - public function getBillingAddress() + public function getShippingAddress() { - return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; } /** + *

    Shipping Method for a Cart with Single ShippingMode. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    + * * @return null|ShippingMethodResourceIdentifier */ @@ -398,136 +408,138 @@ public function getShippingMethod() } /** - *

    An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * - * @return null|ExternalTaxRateDraft + * @return null|ShippingRateInputDraft */ - public function getExternalTaxRateForShippingMethod() + public function getShippingRateInput() { - return $this->externalTaxRateForShippingMethod instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRateForShippingMethod->build() : $this->externalTaxRateForShippingMethod; + return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; } /** - *

    The custom fields.

    + *
      + *
    • If set to Single, only a single Shipping Method can be added to the Cart.
    • + *
    • If set to Multiple, multiple Shipping Methods can be added to the Cart.
    • + *
    * - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getShippingMode() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->shippingMode; } /** - *

    Must be one of the languages supported for this project

    + *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    * - * @return null|string + * @return null|CustomShippingDraftCollection */ - public function getLocale() + public function getCustomShipping() { - return $this->locale; + return $this->customShipping; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    Shipping Methods for a Cart with Multiple ShippingMode.

    * - * @return null|int + * @return null|ShippingDraftCollection */ - public function getDeleteDaysAfterLastModification() + public function getShipping() { - return $this->deleteDaysAfterLastModification; + return $this->shipping; } /** - *

    The default origin is Customer.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

    * - * @return null|string + * @return null|BaseAddressCollection */ - public function getOrigin() + public function getItemShippingAddresses() { - return $this->origin; + return $this->itemShippingAddresses; } /** - *
      - *
    • If Single, only a single Shipping Method can be added to the Cart.
    • - *
    • If Multiple, multiple Shipping Methods can be added to the Cart.
    • - *
    + *

    code of the existing DiscountCodes to add to the Cart.

    * - * @return null|string + * @return null|array */ - public function getShippingMode() + public function getDiscountCodes() { - return $this->shippingMode; + return $this->discountCodes; } /** - *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * - * @return null|CustomShippingDraftCollection + * @return null|string */ - public function getCustomShipping() + public function getCountry() { - return $this->customShipping; + return $this->country; } /** - *

    Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Languages of the Cart. Can only contain languages supported by the Project.

    * - * @return null|ShippingDraftCollection + * @return null|string */ - public function getShipping() + public function getLocale() { - return $this->shipping; + return $this->locale; } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier. - * Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    Indicates how the Cart was created.

    * - * @return null|ShippingRateInputDraft + * @return null|string */ - public function getShippingRateInput() + public function getOrigin() { - return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + return $this->origin; } /** - *

    Contains addresses for carts with multiple shipping addresses. - * Each address must contain a key which is unique in this cart. - * Line items will use these keys to reference the addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

    + *

    Number of days after which an active Cart is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * - * @return null|BaseAddressCollection + * @return null|int */ - public function getItemShippingAddresses() + public function getDeleteDaysAfterLastModification() { - return $this->itemShippingAddresses; + return $this->deleteDaysAfterLastModification; } /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes() + public function getCustom() { - return $this->discountCodes; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -619,23 +631,23 @@ public function withStore(?StoreResourceIdentifier $store) } /** - * @param ?string $country + * @param ?LineItemDraftCollection $lineItems * @return $this */ - public function withCountry(?string $country) + public function withLineItems(?LineItemDraftCollection $lineItems) { - $this->country = $country; + $this->lineItems = $lineItems; return $this; } /** - * @param ?string $inventoryMode + * @param ?CustomLineItemDraftCollection $customLineItems * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems) { - $this->inventoryMode = $inventoryMode; + $this->customLineItems = $customLineItems; return $this; } @@ -651,6 +663,17 @@ public function withTaxMode(?string $taxMode) return $this; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + * @return $this + */ + public function withExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod) + { + $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; + + return $this; + } + /** * @param ?string $taxRoundingMode * @return $this @@ -674,23 +697,23 @@ public function withTaxCalculationMode(?string $taxCalculationMode) } /** - * @param ?LineItemDraftCollection $lineItems + * @param ?string $inventoryMode * @return $this */ - public function withLineItems(?LineItemDraftCollection $lineItems) + public function withInventoryMode(?string $inventoryMode) { - $this->lineItems = $lineItems; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?BaseAddress $billingAddress * @return $this */ - public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems) + public function withBillingAddress(?BaseAddress $billingAddress) { - $this->customLineItems = $customLineItems; + $this->billingAddress = $billingAddress; return $this; } @@ -706,17 +729,6 @@ public function withShippingAddress(?BaseAddress $shippingAddress) return $this; } - /** - * @param ?BaseAddress $billingAddress - * @return $this - */ - public function withBillingAddress(?BaseAddress $billingAddress) - { - $this->billingAddress = $billingAddress; - - return $this; - } - /** * @param ?ShippingMethodResourceIdentifier $shippingMethod * @return $this @@ -729,122 +741,122 @@ public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMe } /** - * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + * @param ?ShippingRateInputDraft $shippingRateInput * @return $this */ - public function withExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod) + public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) { - $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shippingMode * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withShippingMode(?string $shippingMode) { - $this->custom = $custom; + $this->shippingMode = $shippingMode; return $this; } /** - * @param ?string $locale + * @param ?CustomShippingDraftCollection $customShipping * @return $this */ - public function withLocale(?string $locale) + public function withCustomShipping(?CustomShippingDraftCollection $customShipping) { - $this->locale = $locale; + $this->customShipping = $customShipping; return $this; } /** - * @param ?int $deleteDaysAfterLastModification + * @param ?ShippingDraftCollection $shipping * @return $this */ - public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) + public function withShipping(?ShippingDraftCollection $shipping) { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->shipping = $shipping; return $this; } /** - * @param ?string $origin + * @param ?BaseAddressCollection $itemShippingAddresses * @return $this */ - public function withOrigin(?string $origin) + public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) { - $this->origin = $origin; + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } /** - * @param ?string $shippingMode + * @param ?array $discountCodes * @return $this */ - public function withShippingMode(?string $shippingMode) + public function withDiscountCodes(?array $discountCodes) { - $this->shippingMode = $shippingMode; + $this->discountCodes = $discountCodes; return $this; } /** - * @param ?CustomShippingDraftCollection $customShipping + * @param ?string $country * @return $this */ - public function withCustomShipping(?CustomShippingDraftCollection $customShipping) + public function withCountry(?string $country) { - $this->customShipping = $customShipping; + $this->country = $country; return $this; } /** - * @param ?ShippingDraftCollection $shipping + * @param ?string $locale * @return $this */ - public function withShipping(?ShippingDraftCollection $shipping) + public function withLocale(?string $locale) { - $this->shipping = $shipping; + $this->locale = $locale; return $this; } /** - * @param ?ShippingRateInputDraft $shippingRateInput + * @param ?string $origin * @return $this */ - public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) + public function withOrigin(?string $origin) { - $this->shippingRateInput = $shippingRateInput; + $this->origin = $origin; return $this; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?int $deleteDaysAfterLastModification * @return $this */ - public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) + public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; return $this; } /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withDiscountCodes(?array $discountCodes) + public function withCustom(?CustomFieldsDraft $custom) { - $this->discountCodes = $discountCodes; + $this->custom = $custom; return $this; } @@ -883,12 +895,12 @@ public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) } /** - * @deprecated use withShippingAddress() instead + * @deprecated use withExternalTaxRateForShippingMethod() instead * @return $this */ - public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + public function withExternalTaxRateForShippingMethodBuilder(?ExternalTaxRateDraftBuilder $externalTaxRateForShippingMethod) { - $this->shippingAddress = $shippingAddress; + $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; return $this; } @@ -905,45 +917,45 @@ public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress) } /** - * @deprecated use withShippingMethod() instead + * @deprecated use withShippingAddress() instead * @return $this */ - public function withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod) + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) { - $this->shippingMethod = $shippingMethod; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @deprecated use withExternalTaxRateForShippingMethod() instead + * @deprecated use withShippingMethod() instead * @return $this */ - public function withExternalTaxRateForShippingMethodBuilder(?ExternalTaxRateDraftBuilder $externalTaxRateForShippingMethod) + public function withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod) { - $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; + $this->shippingMethod = $shippingMethod; return $this; } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingRateInput() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) { - $this->custom = $custom; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @deprecated use withShippingRateInput() instead + * @deprecated use withCustom() instead * @return $this */ - public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->shippingRateInput = $shippingRateInput; + $this->custom = $custom; return $this; } @@ -959,27 +971,27 @@ public function build(): CartDraft $this->anonymousId, $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, - $this->country, - $this->inventoryMode, + $this->lineItems, + $this->customLineItems, $this->taxMode, + $this->externalTaxRateForShippingMethod instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRateForShippingMethod->build() : $this->externalTaxRateForShippingMethod, $this->taxRoundingMode, $this->taxCalculationMode, - $this->lineItems, - $this->customLineItems, - $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->inventoryMode, $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod, - $this->externalTaxRateForShippingMethod instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRateForShippingMethod->build() : $this->externalTaxRateForShippingMethod, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->locale, - $this->deleteDaysAfterLastModification, - $this->origin, + $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->shippingMode, $this->customShipping, $this->shipping, - $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->itemShippingAddresses, - $this->discountCodes + $this->discountCodes, + $this->country, + $this->locale, + $this->origin, + $this->deleteDaysAfterLastModification, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php index d2f598f7b73..77c84039f68 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php @@ -82,15 +82,15 @@ final class CartDraftModel extends JsonObjectModel implements CartDraft /** * - * @var ?string + * @var ?LineItemDraftCollection */ - protected $country; + protected $lineItems; /** * - * @var ?string + * @var ?CustomLineItemDraftCollection */ - protected $inventoryMode; + protected $customLineItems; /** * @@ -100,39 +100,39 @@ final class CartDraftModel extends JsonObjectModel implements CartDraft /** * - * @var ?string + * @var ?ExternalTaxRateDraft */ - protected $taxRoundingMode; + protected $externalTaxRateForShippingMethod; /** * * @var ?string */ - protected $taxCalculationMode; + protected $taxRoundingMode; /** * - * @var ?LineItemDraftCollection + * @var ?string */ - protected $lineItems; + protected $taxCalculationMode; /** * - * @var ?CustomLineItemDraftCollection + * @var ?string */ - protected $customLineItems; + protected $inventoryMode; /** * * @var ?BaseAddress */ - protected $shippingAddress; + protected $billingAddress; /** * * @var ?BaseAddress */ - protected $billingAddress; + protected $shippingAddress; /** * @@ -142,69 +142,69 @@ final class CartDraftModel extends JsonObjectModel implements CartDraft /** * - * @var ?ExternalTaxRateDraft + * @var ?ShippingRateInputDraft */ - protected $externalTaxRateForShippingMethod; + protected $shippingRateInput; /** * - * @var ?CustomFieldsDraft + * @var ?string */ - protected $custom; + protected $shippingMode; /** * - * @var ?string + * @var ?CustomShippingDraftCollection */ - protected $locale; + protected $customShipping; /** * - * @var ?int + * @var ?ShippingDraftCollection */ - protected $deleteDaysAfterLastModification; + protected $shipping; /** * - * @var ?string + * @var ?BaseAddressCollection */ - protected $origin; + protected $itemShippingAddresses; /** * - * @var ?string + * @var ?array */ - protected $shippingMode; + protected $discountCodes; /** * - * @var ?CustomShippingDraftCollection + * @var ?string */ - protected $customShipping; + protected $country; /** * - * @var ?ShippingDraftCollection + * @var ?string */ - protected $shipping; + protected $locale; /** * - * @var ?ShippingRateInputDraft + * @var ?string */ - protected $shippingRateInput; + protected $origin; /** * - * @var ?BaseAddressCollection + * @var ?int */ - protected $itemShippingAddresses; + protected $deleteDaysAfterLastModification; /** * - * @var ?array + * @var ?CustomFieldsDraft */ - protected $discountCodes; + protected $custom; /** @@ -219,27 +219,27 @@ public function __construct( ?string $anonymousId = null, ?BusinessUnitResourceIdentifier $businessUnit = null, ?StoreResourceIdentifier $store = null, - ?string $country = null, - ?string $inventoryMode = null, + ?LineItemDraftCollection $lineItems = null, + ?CustomLineItemDraftCollection $customLineItems = null, ?string $taxMode = null, + ?ExternalTaxRateDraft $externalTaxRateForShippingMethod = null, ?string $taxRoundingMode = null, ?string $taxCalculationMode = null, - ?LineItemDraftCollection $lineItems = null, - ?CustomLineItemDraftCollection $customLineItems = null, - ?BaseAddress $shippingAddress = null, + ?string $inventoryMode = null, ?BaseAddress $billingAddress = null, + ?BaseAddress $shippingAddress = null, ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?ExternalTaxRateDraft $externalTaxRateForShippingMethod = null, - ?CustomFieldsDraft $custom = null, - ?string $locale = null, - ?int $deleteDaysAfterLastModification = null, - ?string $origin = null, + ?ShippingRateInputDraft $shippingRateInput = null, ?string $shippingMode = null, ?CustomShippingDraftCollection $customShipping = null, ?ShippingDraftCollection $shipping = null, - ?ShippingRateInputDraft $shippingRateInput = null, ?BaseAddressCollection $itemShippingAddresses = null, - ?array $discountCodes = null + ?array $discountCodes = null, + ?string $country = null, + ?string $locale = null, + ?string $origin = null, + ?int $deleteDaysAfterLastModification = null, + ?CustomFieldsDraft $custom = null ) { $this->currency = $currency; $this->key = $key; @@ -249,31 +249,31 @@ public function __construct( $this->anonymousId = $anonymousId; $this->businessUnit = $businessUnit; $this->store = $store; - $this->country = $country; - $this->inventoryMode = $inventoryMode; + $this->lineItems = $lineItems; + $this->customLineItems = $customLineItems; $this->taxMode = $taxMode; + $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; $this->taxRoundingMode = $taxRoundingMode; $this->taxCalculationMode = $taxCalculationMode; - $this->lineItems = $lineItems; - $this->customLineItems = $customLineItems; - $this->shippingAddress = $shippingAddress; + $this->inventoryMode = $inventoryMode; $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; $this->shippingMethod = $shippingMethod; - $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; - $this->custom = $custom; - $this->locale = $locale; - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->origin = $origin; + $this->shippingRateInput = $shippingRateInput; $this->shippingMode = $shippingMode; $this->customShipping = $customShipping; $this->shipping = $shipping; - $this->shippingRateInput = $shippingRateInput; $this->itemShippingAddresses = $itemShippingAddresses; $this->discountCodes = $discountCodes; + $this->country = $country; + $this->locale = $locale; + $this->origin = $origin; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->custom = $custom; } /** - *

    A three-digit currency code as per ISO 4217.

    + *

    Currency the Cart uses.

    * * * @return null|string @@ -313,7 +313,7 @@ public function getKey() } /** - *

    Id of an existing Customer.

    + *

    id of the Customer that the Cart belongs to.

    * * * @return null|string @@ -333,6 +333,8 @@ public function getCustomerId() } /** + *

    Email address of the Customer that the Cart belongs to.

    + * * * @return null|string */ @@ -351,8 +353,9 @@ public function getCustomerEmail() } /** - *

    Will be set automatically when the customerId is set and the customer is a member of a customer group. - * Can be set explicitly when no customerId is present.

    + *

    ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

    + *

    It is automatically set if the Customer referenced in customerId belongs to a Customer Group. + * It can also be set explicitly when no customerId is present.

    * * * @return null|CustomerGroupResourceIdentifier @@ -373,7 +376,7 @@ public function getCustomerGroup() } /** - *

    Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Cart.

    * * * @return null|string @@ -393,7 +396,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Cart belongs to.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * * * @return null|BusinessUnitResourceIdentifier @@ -414,8 +417,7 @@ public function getBusinessUnit() } /** - *

    Assigns the new cart to the store. - * The store assignment can not be modified.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * * * @return null|StoreResourceIdentifier @@ -436,47 +438,47 @@ public function getStore() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Line Items to add to the Cart.

    * * - * @return null|string + * @return null|LineItemDraftCollection */ - public function getCountry() + public function getLineItems() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->lineItems)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_LINE_ITEMS); if (is_null($data)) { return null; } - $this->country = (string) $data; + $this->lineItems = LineItemDraftCollection::fromArray($data); } - return $this->country; + return $this->lineItems; } /** - *

    Default inventory mode is None.

    + *

    Custom Line Items to add to the Cart.

    * * - * @return null|string + * @return null|CustomLineItemDraftCollection */ - public function getInventoryMode() + public function getCustomLineItems() { - if (is_null($this->inventoryMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($this->customLineItems)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEMS); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + $this->customLineItems = CustomLineItemDraftCollection::fromArray($data); } - return $this->inventoryMode; + return $this->customLineItems; } /** - *

    The default tax mode is Platform.

    + *

    Determines how Tax Rates are set.

    * * * @return null|string @@ -496,7 +498,28 @@ public function getTaxMode() } /** - *

    The default tax rounding mode is HalfEven.

    + *

    External Tax Rate for the shippingMethod if the Cart has External TaxMode.

    + * + * + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRateForShippingMethod() + { + if (is_null($this->externalTaxRateForShippingMethod)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE_FOR_SHIPPING_METHOD); + if (is_null($data)) { + return null; + } + + $this->externalTaxRateForShippingMethod = ExternalTaxRateDraftModel::of($data); + } + + return $this->externalTaxRateForShippingMethod; + } + + /** + *

    Determines how monetary values are rounded when calculating taxes for taxedPrice.

    * * * @return null|string @@ -516,7 +539,7 @@ public function getTaxRoundingMode() } /** - *

    The default tax calculation mode is LineItemLevel.

    + *

    Determines how taxes are calculated when calculating taxes for taxedPrice.

    * * * @return null|string @@ -536,43 +559,48 @@ public function getTaxCalculationMode() } /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    * - * @return null|LineItemDraftCollection + * + * @return null|string */ - public function getLineItems() + public function getInventoryMode() { - if (is_null($this->lineItems)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_LINE_ITEMS); + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - $this->lineItems = LineItemDraftCollection::fromArray($data); + $this->inventoryMode = (string) $data; } - return $this->lineItems; + return $this->inventoryMode; } /** + *

    Billing address associated with the Cart.

    * - * @return null|CustomLineItemDraftCollection + * + * @return null|BaseAddress */ - public function getCustomLineItems() + public function getBillingAddress() { - if (is_null($this->customLineItems)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEMS); + if (is_null($this->billingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->customLineItems = CustomLineItemDraftCollection::fromArray($data); + + $this->billingAddress = BaseAddressModel::of($data); } - return $this->customLineItems; + return $this->billingAddress; } /** - *

    The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

    + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * * * @return null|BaseAddress @@ -593,25 +621,8 @@ public function getShippingAddress() } /** + *

    Shipping Method for a Cart with Single ShippingMode. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    * - * @return null|BaseAddress - */ - public function getBillingAddress() - { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); - if (is_null($data)) { - return null; - } - - $this->billingAddress = BaseAddressModel::of($data); - } - - return $this->billingAddress; - } - - /** * * @return null|ShippingMethodResourceIdentifier */ @@ -631,238 +642,239 @@ public function getShippingMethod() } /** - *

    An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * - * @return null|ExternalTaxRateDraft + * @return null|ShippingRateInputDraft */ - public function getExternalTaxRateForShippingMethod() + public function getShippingRateInput() { - if (is_null($this->externalTaxRateForShippingMethod)) { + if (is_null($this->shippingRateInput)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE_FOR_SHIPPING_METHOD); + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); if (is_null($data)) { return null; } - $this->externalTaxRateForShippingMethod = ExternalTaxRateDraftModel::of($data); + $this->shippingRateInput = ShippingRateInputDraftModel::of($data); } - return $this->externalTaxRateForShippingMethod; + return $this->shippingRateInput; } /** - *

    The custom fields.

    + *
      + *
    • If set to Single, only a single Shipping Method can be added to the Cart.
    • + *
    • If set to Multiple, multiple Shipping Methods can be added to the Cart.
    • + *
    * * - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getShippingMode() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->shippingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_MODE); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsDraftModel::of($data); + $this->shippingMode = (string) $data; } - return $this->custom; + return $this->shippingMode; } /** - *

    Must be one of the languages supported for this project

    + *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    * * - * @return null|string + * @return null|CustomShippingDraftCollection */ - public function getLocale() + public function getCustomShipping() { - if (is_null($this->locale)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_LOCALE); + if (is_null($this->customShipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOM_SHIPPING); if (is_null($data)) { return null; } - $this->locale = (string) $data; + $this->customShipping = CustomShippingDraftCollection::fromArray($data); } - return $this->locale; + return $this->customShipping; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    Shipping Methods for a Cart with Multiple ShippingMode.

    * * - * @return null|int + * @return null|ShippingDraftCollection */ - public function getDeleteDaysAfterLastModification() + public function getShipping() { - if (is_null($this->deleteDaysAfterLastModification)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); if (is_null($data)) { return null; } - $this->deleteDaysAfterLastModification = (int) $data; + $this->shipping = ShippingDraftCollection::fromArray($data); } - return $this->deleteDaysAfterLastModification; + return $this->shipping; } /** - *

    The default origin is Customer.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

    * * - * @return null|string + * @return null|BaseAddressCollection */ - public function getOrigin() + public function getItemShippingAddresses() { - if (is_null($this->origin)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORIGIN); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - $this->origin = (string) $data; + $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); } - return $this->origin; + return $this->itemShippingAddresses; } /** - *
      - *
    • If Single, only a single Shipping Method can be added to the Cart.
    • - *
    • If Multiple, multiple Shipping Methods can be added to the Cart.
    • - *
    + *

    code of the existing DiscountCodes to add to the Cart.

    * * - * @return null|string + * @return null|array */ - public function getShippingMode() + public function getDiscountCodes() { - if (is_null($this->shippingMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_MODE); + if (is_null($this->discountCodes)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNT_CODES); if (is_null($data)) { return null; } - $this->shippingMode = (string) $data; + $this->discountCodes = $data; } - return $this->shippingMode; + return $this->discountCodes; } /** - *

    Custom Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * * - * @return null|CustomShippingDraftCollection + * @return null|string */ - public function getCustomShipping() + public function getCountry() { - if (is_null($this->customShipping)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_CUSTOM_SHIPPING); + if (is_null($this->country)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->customShipping = CustomShippingDraftCollection::fromArray($data); + $this->country = (string) $data; } - return $this->customShipping; + return $this->country; } /** - *

    Shipping Methods for a Cart with Multiple ShippingMode.

    + *

    Languages of the Cart. Can only contain languages supported by the Project.

    * * - * @return null|ShippingDraftCollection + * @return null|string */ - public function getShipping() + public function getLocale() { - if (is_null($this->shipping)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($this->locale)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LOCALE); if (is_null($data)) { return null; } - $this->shipping = ShippingDraftCollection::fromArray($data); + $this->locale = (string) $data; } - return $this->shipping; + return $this->locale; } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier. - * Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    Indicates how the Cart was created.

    * * - * @return null|ShippingRateInputDraft + * @return null|string */ - public function getShippingRateInput() + public function getOrigin() { - if (is_null($this->shippingRateInput)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($this->origin)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORIGIN); if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + $this->origin = (string) $data; } - return $this->shippingRateInput; + return $this->origin; } /** - *

    Contains addresses for carts with multiple shipping addresses. - * Each address must contain a key which is unique in this cart. - * Line items will use these keys to reference the addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

    + *

    Number of days after which an active Cart is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * * - * @return null|BaseAddressCollection + * @return null|int */ - public function getItemShippingAddresses() + public function getDeleteDaysAfterLastModification() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->deleteDaysAfterLastModification)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); if (is_null($data)) { return null; } - $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); + $this->deleteDaysAfterLastModification = (int) $data; } - return $this->itemShippingAddresses; + return $this->deleteDaysAfterLastModification; } /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes() + public function getCustom() { - if (is_null($this->discountCodes)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_DISCOUNT_CODES); + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->discountCodes = $data; + + $this->custom = CustomFieldsDraftModel::of($data); } - return $this->discountCodes; + return $this->custom; } @@ -931,19 +943,19 @@ public function setStore(?StoreResourceIdentifier $store): void } /** - * @param ?string $country + * @param ?LineItemDraftCollection $lineItems */ - public function setCountry(?string $country): void + public function setLineItems(?LineItemDraftCollection $lineItems): void { - $this->country = $country; + $this->lineItems = $lineItems; } /** - * @param ?string $inventoryMode + * @param ?CustomLineItemDraftCollection $customLineItems */ - public function setInventoryMode(?string $inventoryMode): void + public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void { - $this->inventoryMode = $inventoryMode; + $this->customLineItems = $customLineItems; } /** @@ -954,6 +966,14 @@ public function setTaxMode(?string $taxMode): void $this->taxMode = $taxMode; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + */ + public function setExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod): void + { + $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; + } + /** * @param ?string $taxRoundingMode */ @@ -971,19 +991,19 @@ public function setTaxCalculationMode(?string $taxCalculationMode): void } /** - * @param ?LineItemDraftCollection $lineItems + * @param ?string $inventoryMode */ - public function setLineItems(?LineItemDraftCollection $lineItems): void + public function setInventoryMode(?string $inventoryMode): void { - $this->lineItems = $lineItems; + $this->inventoryMode = $inventoryMode; } /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?BaseAddress $billingAddress */ - public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void + public function setBillingAddress(?BaseAddress $billingAddress): void { - $this->customLineItems = $customLineItems; + $this->billingAddress = $billingAddress; } /** @@ -994,14 +1014,6 @@ public function setShippingAddress(?BaseAddress $shippingAddress): void $this->shippingAddress = $shippingAddress; } - /** - * @param ?BaseAddress $billingAddress - */ - public function setBillingAddress(?BaseAddress $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - /** * @param ?ShippingMethodResourceIdentifier $shippingMethod */ @@ -1011,90 +1023,90 @@ public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMet } /** - * @param ?ExternalTaxRateDraft $externalTaxRateForShippingMethod + * @param ?ShippingRateInputDraft $shippingRateInput */ - public function setExternalTaxRateForShippingMethod(?ExternalTaxRateDraft $externalTaxRateForShippingMethod): void + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void { - $this->externalTaxRateForShippingMethod = $externalTaxRateForShippingMethod; + $this->shippingRateInput = $shippingRateInput; } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shippingMode */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setShippingMode(?string $shippingMode): void { - $this->custom = $custom; + $this->shippingMode = $shippingMode; } /** - * @param ?string $locale + * @param ?CustomShippingDraftCollection $customShipping */ - public function setLocale(?string $locale): void + public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void { - $this->locale = $locale; + $this->customShipping = $customShipping; } /** - * @param ?int $deleteDaysAfterLastModification + * @param ?ShippingDraftCollection $shipping */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void + public function setShipping(?ShippingDraftCollection $shipping): void { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->shipping = $shipping; } /** - * @param ?string $origin + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setOrigin(?string $origin): void + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void { - $this->origin = $origin; + $this->itemShippingAddresses = $itemShippingAddresses; } /** - * @param ?string $shippingMode + * @param ?array $discountCodes */ - public function setShippingMode(?string $shippingMode): void + public function setDiscountCodes(?array $discountCodes): void { - $this->shippingMode = $shippingMode; + $this->discountCodes = $discountCodes; } /** - * @param ?CustomShippingDraftCollection $customShipping + * @param ?string $country */ - public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void + public function setCountry(?string $country): void { - $this->customShipping = $customShipping; + $this->country = $country; } /** - * @param ?ShippingDraftCollection $shipping + * @param ?string $locale */ - public function setShipping(?ShippingDraftCollection $shipping): void + public function setLocale(?string $locale): void { - $this->shipping = $shipping; + $this->locale = $locale; } /** - * @param ?ShippingRateInputDraft $shippingRateInput + * @param ?string $origin */ - public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void + public function setOrigin(?string $origin): void { - $this->shippingRateInput = $shippingRateInput; + $this->origin = $origin; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?int $deleteDaysAfterLastModification */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; } /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom */ - public function setDiscountCodes(?array $discountCodes): void + public function setCustom(?CustomFieldsDraft $custom): void { - $this->discountCodes = $discountCodes; + $this->custom = $custom; } } diff --git a/lib/commercetools-api/src/Models/Cart/CartModel.php b/lib/commercetools-api/src/Models/Cart/CartModel.php index 39fb6242174..3063932a0a7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartModel.php @@ -16,12 +16,12 @@ use Commercetools\Api\Models\Common\AddressModel; use Commercetools\Api\Models\Common\BaseResource; use Commercetools\Api\Models\Common\BaseResourceModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\CreatedByModel; use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LastModifiedByModel; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceModel; use Commercetools\Api\Models\Order\PaymentInfo; @@ -74,27 +74,21 @@ final class CartModel extends JsonObjectModel implements Cart /** * - * @var ?LastModifiedBy - */ - protected $lastModifiedBy; - - /** - * - * @var ?CreatedBy + * @var ?string */ - protected $createdBy; + protected $customerId; /** * * @var ?string */ - protected $customerId; + protected $customerEmail; /** * - * @var ?string + * @var ?CustomerGroupReference */ - protected $customerEmail; + protected $customerGroup; /** * @@ -128,7 +122,13 @@ final class CartModel extends JsonObjectModel implements Cart /** * - * @var ?TypedMoney + * @var ?int + */ + protected $totalLineItemQuantity; + + /** + * + * @var ?CentPrecisionMoney */ protected $totalPrice; @@ -148,73 +148,73 @@ final class CartModel extends JsonObjectModel implements Cart * * @var ?string */ - protected $cartState; + protected $taxMode; /** * - * @var ?Address + * @var ?string */ - protected $shippingAddress; + protected $taxRoundingMode; /** * - * @var ?Address + * @var ?string */ - protected $billingAddress; + protected $taxCalculationMode; /** * * @var ?string */ - protected $shippingMode; + protected $inventoryMode; /** * - * @var ?ShippingCollection + * @var ?string */ - protected $shipping; + protected $cartState; /** * - * @var ?string + * @var ?Address */ - protected $inventoryMode; + protected $billingAddress; /** * - * @var ?string + * @var ?Address */ - protected $taxMode; + protected $shippingAddress; /** * * @var ?string */ - protected $taxRoundingMode; + protected $shippingMode; /** * - * @var ?string + * @var ?ShippingInfo */ - protected $taxCalculationMode; + protected $shippingInfo; /** * - * @var ?CustomerGroupReference + * @var ?ShippingCollection */ - protected $customerGroup; + protected $shipping; /** * - * @var ?string + * @var ?ShippingRateInput */ - protected $country; + protected $shippingRateInput; /** * - * @var ?ShippingInfo + * @var ?AddressCollection */ - protected $shippingInfo; + protected $itemShippingAddresses; /** * @@ -230,9 +230,9 @@ final class CartModel extends JsonObjectModel implements Cart /** * - * @var ?CustomFields + * @var ?CartDiscountReferenceCollection */ - protected $custom; + protected $refusedGifts; /** * @@ -244,43 +244,43 @@ final class CartModel extends JsonObjectModel implements Cart * * @var ?string */ - protected $locale; + protected $country; /** * - * @var ?int + * @var ?string */ - protected $deleteDaysAfterLastModification; + protected $locale; /** * - * @var ?CartDiscountReferenceCollection + * @var ?string */ - protected $refusedGifts; + protected $origin; /** * - * @var ?string + * @var ?CustomFields */ - protected $origin; + protected $custom; /** * - * @var ?ShippingRateInput + * @var ?int */ - protected $shippingRateInput; + protected $deleteDaysAfterLastModification; /** * - * @var ?AddressCollection + * @var ?LastModifiedBy */ - protected $itemShippingAddresses; + protected $lastModifiedBy; /** * - * @var ?int + * @var ?CreatedBy */ - protected $totalLineItemQuantity; + protected $createdBy; /** @@ -292,82 +292,82 @@ public function __construct( ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, ?string $key = null, - ?LastModifiedBy $lastModifiedBy = null, - ?CreatedBy $createdBy = null, ?string $customerId = null, ?string $customerEmail = null, + ?CustomerGroupReference $customerGroup = null, ?string $anonymousId = null, ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, ?LineItemCollection $lineItems = null, ?CustomLineItemCollection $customLineItems = null, - ?TypedMoney $totalPrice = null, + ?int $totalLineItemQuantity = null, + ?CentPrecisionMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, ?TaxedPrice $taxedShippingPrice = null, - ?string $cartState = null, - ?Address $shippingAddress = null, - ?Address $billingAddress = null, - ?string $shippingMode = null, - ?ShippingCollection $shipping = null, - ?string $inventoryMode = null, ?string $taxMode = null, ?string $taxRoundingMode = null, ?string $taxCalculationMode = null, - ?CustomerGroupReference $customerGroup = null, - ?string $country = null, + ?string $inventoryMode = null, + ?string $cartState = null, + ?Address $billingAddress = null, + ?Address $shippingAddress = null, + ?string $shippingMode = null, ?ShippingInfo $shippingInfo = null, + ?ShippingCollection $shipping = null, + ?ShippingRateInput $shippingRateInput = null, + ?AddressCollection $itemShippingAddresses = null, ?DiscountCodeInfoCollection $discountCodes = null, ?DirectDiscountCollection $directDiscounts = null, - ?CustomFields $custom = null, + ?CartDiscountReferenceCollection $refusedGifts = null, ?PaymentInfo $paymentInfo = null, + ?string $country = null, ?string $locale = null, - ?int $deleteDaysAfterLastModification = null, - ?CartDiscountReferenceCollection $refusedGifts = null, ?string $origin = null, - ?ShippingRateInput $shippingRateInput = null, - ?AddressCollection $itemShippingAddresses = null, - ?int $totalLineItemQuantity = null + ?CustomFields $custom = null, + ?int $deleteDaysAfterLastModification = null, + ?LastModifiedBy $lastModifiedBy = null, + ?CreatedBy $createdBy = null ) { $this->id = $id; $this->version = $version; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; $this->key = $key; - $this->lastModifiedBy = $lastModifiedBy; - $this->createdBy = $createdBy; $this->customerId = $customerId; $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; $this->anonymousId = $anonymousId; $this->businessUnit = $businessUnit; $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; + $this->totalLineItemQuantity = $totalLineItemQuantity; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; $this->taxedShippingPrice = $taxedShippingPrice; - $this->cartState = $cartState; - $this->shippingAddress = $shippingAddress; - $this->billingAddress = $billingAddress; - $this->shippingMode = $shippingMode; - $this->shipping = $shipping; - $this->inventoryMode = $inventoryMode; $this->taxMode = $taxMode; $this->taxRoundingMode = $taxRoundingMode; $this->taxCalculationMode = $taxCalculationMode; - $this->customerGroup = $customerGroup; - $this->country = $country; + $this->inventoryMode = $inventoryMode; + $this->cartState = $cartState; + $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; + $this->shippingMode = $shippingMode; $this->shippingInfo = $shippingInfo; + $this->shipping = $shipping; + $this->shippingRateInput = $shippingRateInput; + $this->itemShippingAddresses = $itemShippingAddresses; $this->discountCodes = $discountCodes; $this->directDiscounts = $directDiscounts; - $this->custom = $custom; + $this->refusedGifts = $refusedGifts; $this->paymentInfo = $paymentInfo; + $this->country = $country; $this->locale = $locale; - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->refusedGifts = $refusedGifts; $this->origin = $origin; - $this->shippingRateInput = $shippingRateInput; - $this->itemShippingAddresses = $itemShippingAddresses; - $this->totalLineItemQuantity = $totalLineItemQuantity; + $this->custom = $custom; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; } /** @@ -391,7 +391,7 @@ public function getId() } /** - *

    The current version of the cart.

    + *

    Current version of the Cart.

    * * * @return null|int @@ -411,6 +411,8 @@ public function getVersion() } /** + *

    Date and time (UTC) the Cart was initially created.

    + * * * @return null|DateTimeImmutable */ @@ -433,6 +435,8 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Cart was last updated.

    + * * * @return null|DateTimeImmutable */ @@ -475,48 +479,8 @@ public function getKey() } /** - *

    Present on resources updated after 1 February 2019 except for events not tracked.

    - * - * - * @return null|LastModifiedBy - */ - public function getLastModifiedBy() - { - if (is_null($this->lastModifiedBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); - if (is_null($data)) { - return null; - } - - $this->lastModifiedBy = LastModifiedByModel::of($data); - } - - return $this->lastModifiedBy; - } - - /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    id of the Customer that the Cart belongs to.

    * - * - * @return null|CreatedBy - */ - public function getCreatedBy() - { - if (is_null($this->createdBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CREATED_BY); - if (is_null($data)) { - return null; - } - - $this->createdBy = CreatedByModel::of($data); - } - - return $this->createdBy; - } - - /** * * @return null|string */ @@ -535,6 +499,8 @@ public function getCustomerId() } /** + *

    Email address of the Customer that the Cart belongs to.

    + * * * @return null|string */ @@ -553,7 +519,28 @@ public function getCustomerEmail() } /** - *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    + *

    Reference to the Customer Group of the Customer that the Cart belongs to. Used for LineItem Price selection.

    + * + * + * @return null|CustomerGroupReference + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupReferenceModel::of($data); + } + + return $this->customerGroup; + } + + /** + *

    Anonymous session associated with the Cart.

    * * * @return null|string @@ -573,7 +560,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Cart belongs to.

    + *

    Reference to a Business Unit the Cart belongs to.

    * * * @return null|BusinessUnitKeyReference @@ -594,6 +581,8 @@ public function getBusinessUnit() } /** + *

    Reference to a Store the Cart belongs to.

    + * * * @return null|StoreKeyReference */ @@ -613,6 +602,8 @@ public function getStore() } /** + *

    Line Items added to the Cart.

    + * * * @return null|LineItemCollection */ @@ -631,6 +622,8 @@ public function getLineItems() } /** + *

    Custom Line Items added to the Cart.

    + * * * @return null|CustomLineItemCollection */ @@ -649,11 +642,31 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    + *

    Sum of all LineItem quantities, excluding CustomLineItems. Only present when the Cart has at least one LineItem.

    + * + * + * @return null|int + */ + public function getTotalLineItemQuantity() + { + if (is_null($this->totalLineItemQuantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_TOTAL_LINE_ITEM_QUANTITY); + if (is_null($data)) { + return null; + } + $this->totalLineItemQuantity = (int) $data; + } + + return $this->totalLineItemQuantity; + } + + /** + *

    Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo.

    + *

    Taxes are included if TaxRate includedInPrice is true for each price.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalPrice() { @@ -664,16 +677,17 @@ public function getTotalPrice() return null; } - $this->totalPrice = TypedMoneyModel::of($data); + $this->totalPrice = CentPrecisionMoneyModel::of($data); } return $this->totalPrice; } /** - *

    Not set until the shipping address is set. - * Will be set automatically in the Platform TaxMode. - * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    + *
      + *
    • For a Cart with Platform TaxMode, it is automatically set when a shipping address is set.
    • + *
    • For a Cart with External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
    • + *
    * * * @return null|TaxedPrice @@ -694,8 +708,7 @@ public function getTaxedPrice() } /** - *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + *

    Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

    * * * @return null|TaxedPrice @@ -716,247 +729,259 @@ public function getTaxedShippingPrice() } /** + *

    Indicates how Tax Rates are set.

    + * * * @return null|string */ - public function getCartState() + public function getTaxMode() { - if (is_null($this->cartState)) { + if (is_null($this->taxMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CART_STATE); + $data = $this->raw(self::FIELD_TAX_MODE); if (is_null($data)) { return null; } - $this->cartState = (string) $data; + $this->taxMode = (string) $data; } - return $this->cartState; + return $this->taxMode; } /** - *

    The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

    + *

    Indicates how monetary values are rounded when calculating taxes for taxedPrice.

    * * - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxRoundingMode() { - if (is_null($this->shippingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($this->taxRoundingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); if (is_null($data)) { return null; } - - $this->shippingAddress = AddressModel::of($data); + $this->taxRoundingMode = (string) $data; } - return $this->shippingAddress; + return $this->taxRoundingMode; } /** + *

    Indicates how taxes are calculated when calculating taxes for taxedPrice.

    * - * @return null|Address + * + * @return null|string */ - public function getBillingAddress() + public function getTaxCalculationMode() { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); + if (is_null($this->taxCalculationMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); if (is_null($data)) { return null; } - - $this->billingAddress = AddressModel::of($data); + $this->taxCalculationMode = (string) $data; } - return $this->billingAddress; + return $this->taxCalculationMode; } /** - *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + *

    Indicates how stock quantities are tracked for Line Items in the Cart.

    * * * @return null|string */ - public function getShippingMode() + public function getInventoryMode() { - if (is_null($this->shippingMode)) { + if (is_null($this->inventoryMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_MODE); + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - $this->shippingMode = (string) $data; + $this->inventoryMode = (string) $data; } - return $this->shippingMode; + return $this->inventoryMode; } /** - *

    Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

    - *

    It is automatically updated after the Shipping Method is added.

    + *

    Current status of the Cart.

    * * - * @return null|ShippingCollection + * @return null|string */ - public function getShipping() + public function getCartState() { - if (is_null($this->shipping)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($this->cartState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CART_STATE); if (is_null($data)) { return null; } - $this->shipping = ShippingCollection::fromArray($data); + $this->cartState = (string) $data; } - return $this->shipping; + return $this->cartState; } /** + *

    Billing address associated with the Cart.

    * - * @return null|string + * + * @return null|Address */ - public function getInventoryMode() + public function getBillingAddress() { - if (is_null($this->inventoryMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($this->billingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + + $this->billingAddress = AddressModel::of($data); } - return $this->inventoryMode; + return $this->billingAddress; } /** + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * - * @return null|string + * + * @return null|Address */ - public function getTaxMode() + public function getShippingAddress() { - if (is_null($this->taxMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_MODE); + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); if (is_null($data)) { return null; } - $this->taxMode = (string) $data; + + $this->shippingAddress = AddressModel::of($data); } - return $this->taxMode; + return $this->shippingAddress; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    + *

    Indicates whether the Cart has one or multiple Shipping Methods.

    * * * @return null|string */ - public function getTaxRoundingMode() + public function getShippingMode() { - if (is_null($this->taxRoundingMode)) { + if (is_null($this->shippingMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); + $data = $this->raw(self::FIELD_SHIPPING_MODE); if (is_null($data)) { return null; } - $this->taxRoundingMode = (string) $data; + $this->shippingMode = (string) $data; } - return $this->taxRoundingMode; + return $this->shippingMode; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    + *

    Shipping-related information of a Cart with Single ShippingMode. Automatically set when a Shipping Method is set.

    * * - * @return null|string + * @return null|ShippingInfo */ - public function getTaxCalculationMode() + public function getShippingInfo() { - if (is_null($this->taxCalculationMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); + if (is_null($this->shippingInfo)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_INFO); if (is_null($data)) { return null; } - $this->taxCalculationMode = (string) $data; + + $this->shippingInfo = ShippingInfoModel::of($data); } - return $this->taxCalculationMode; + return $this->shippingInfo; } /** - *

    Set automatically when the customer is set and the customer is a member of a customer group. - * Used for product variant - * price selection.

    + *

    Shipping-related information of a Cart with Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

    * * - * @return null|CustomerGroupReference + * @return null|ShippingCollection */ - public function getCustomerGroup() + public function getShipping() { - if (is_null($this->customerGroup)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); if (is_null($data)) { return null; } - - $this->customerGroup = CustomerGroupReferenceModel::of($data); + $this->shipping = ShippingCollection::fromArray($data); } - return $this->customerGroup; + return $this->shipping; } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); if (is_null($data)) { return null; } - $this->country = (string) $data; + + $this->shippingRateInput = ShippingRateInputModel::of($data); } - return $this->country; + return $this->shippingRateInput; } /** - *

    Shipping-related information of a Cart with Single ShippingMode. - * Set automatically once the ShippingMethod is set.

    + *

    Additional shipping addresses of the Cart as specified by LineItems using the shippingDetails field.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

    * * - * @return null|ShippingInfo + * @return null|AddressCollection */ - public function getShippingInfo() + public function getItemShippingAddresses() { - if (is_null($this->shippingInfo)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_INFO); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - - $this->shippingInfo = ShippingInfoModel::of($data); + $this->itemShippingAddresses = AddressCollection::fromArray($data); } - return $this->shippingInfo; + return $this->itemShippingAddresses; } /** + *

    Discount Codes applied to the Cart. A Cart that has directDiscounts cannot have discountCodes.

    + * * * @return null|DiscountCodeInfoCollection */ @@ -975,6 +1000,8 @@ public function getDiscountCodes() } /** + *

    Direct Discounts added to the Cart. A Cart that has discountCodes cannot have directDiscounts.

    + * * * @return null|DirectDiscountCollection */ @@ -993,25 +1020,28 @@ public function getDirectDiscounts() } /** + *

    Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Cart.

    * - * @return null|CustomFields + * + * @return null|CartDiscountReferenceCollection */ - public function getCustom() + public function getRefusedGifts() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->refusedGifts)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REFUSED_GIFTS); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsModel::of($data); + $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); } - return $this->custom; + return $this->refusedGifts; } /** + *

    Payment information related to the Cart.

    + * * * @return null|PaymentInfo */ @@ -1031,146 +1061,146 @@ public function getPaymentInfo() } /** + *

    Used for LineItem Price selection.

    + * * * @return null|string */ - public function getLocale() + public function getCountry() { - if (is_null($this->locale)) { + if (is_null($this->country)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_LOCALE); + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->locale = (string) $data; + $this->country = (string) $data; } - return $this->locale; + return $this->country; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

    + *

    Languages of the Cart. Can only contain languages supported by the Project.

    * * - * @return null|int + * @return null|string */ - public function getDeleteDaysAfterLastModification() + public function getLocale() { - if (is_null($this->deleteDaysAfterLastModification)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); + if (is_null($this->locale)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LOCALE); if (is_null($data)) { return null; } - $this->deleteDaysAfterLastModification = (int) $data; + $this->locale = (string) $data; } - return $this->deleteDaysAfterLastModification; + return $this->locale; } /** - *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

    + *

    Indicates how the Cart was created.

    * * - * @return null|CartDiscountReferenceCollection + * @return null|string */ - public function getRefusedGifts() + public function getOrigin() { - if (is_null($this->refusedGifts)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_REFUSED_GIFTS); + if (is_null($this->origin)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORIGIN); if (is_null($data)) { return null; } - $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); + $this->origin = (string) $data; } - return $this->refusedGifts; + return $this->origin; } /** - *

    The origin field indicates how this cart was created. - * The value Customer indicates, that the cart was created by the customer.

    + *

    Custom Fields of the Cart.

    * * - * @return null|string + * @return null|CustomFields */ - public function getOrigin() + public function getCustom() { - if (is_null($this->origin)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORIGIN); + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->origin = (string) $data; + + $this->custom = CustomFieldsModel::of($data); } - return $this->origin; + return $this->custom; } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Number of days after which an active Cart is deleted since its last modification. Configured in Project settings.

    * * - * @return null|ShippingRateInput + * @return null|int */ - public function getShippingRateInput() + public function getDeleteDaysAfterLastModification() { - if (is_null($this->shippingRateInput)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($this->deleteDaysAfterLastModification)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputModel::of($data); + $this->deleteDaysAfterLastModification = (int) $data; } - return $this->shippingRateInput; + return $this->deleteDaysAfterLastModification; } /** - *

    Contains addresses for carts with multiple shipping addresses. - * Line items reference these addresses under their shippingDetails. - * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. - * Only the cart's shippingAddress is used for this.

    + *

    Present on resources updated after 1 February 2019 except for events not tracked.

    * * - * @return null|AddressCollection + * @return null|LastModifiedBy */ - public function getItemShippingAddresses() + public function getLastModifiedBy() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); if (is_null($data)) { return null; } - $this->itemShippingAddresses = AddressCollection::fromArray($data); + + $this->lastModifiedBy = LastModifiedByModel::of($data); } - return $this->itemShippingAddresses; + return $this->lastModifiedBy; } /** - *

    The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * * - * @return null|int + * @return null|CreatedBy */ - public function getTotalLineItemQuantity() + public function getCreatedBy() { - if (is_null($this->totalLineItemQuantity)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL_LINE_ITEM_QUANTITY); + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); if (is_null($data)) { return null; } - $this->totalLineItemQuantity = (int) $data; + + $this->createdBy = CreatedByModel::of($data); } - return $this->totalLineItemQuantity; + return $this->createdBy; } @@ -1214,22 +1244,6 @@ public function setKey(?string $key): void $this->key = $key; } - /** - * @param ?LastModifiedBy $lastModifiedBy - */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void - { - $this->lastModifiedBy = $lastModifiedBy; - } - - /** - * @param ?CreatedBy $createdBy - */ - public function setCreatedBy(?CreatedBy $createdBy): void - { - $this->createdBy = $createdBy; - } - /** * @param ?string $customerId */ @@ -1246,6 +1260,14 @@ public function setCustomerEmail(?string $customerEmail): void $this->customerEmail = $customerEmail; } + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + { + $this->customerGroup = $customerGroup; + } + /** * @param ?string $anonymousId */ @@ -1287,9 +1309,17 @@ public function setCustomLineItems(?CustomLineItemCollection $customLineItems): } /** - * @param ?TypedMoney $totalPrice + * @param ?int $totalLineItemQuantity */ - public function setTotalPrice(?TypedMoney $totalPrice): void + public function setTotalLineItemQuantity(?int $totalLineItemQuantity): void + { + $this->totalLineItemQuantity = $totalLineItemQuantity; + } + + /** + * @param ?CentPrecisionMoney $totalPrice + */ + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void { $this->totalPrice = $totalPrice; } @@ -1311,99 +1341,99 @@ public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void } /** - * @param ?string $cartState + * @param ?string $taxMode */ - public function setCartState(?string $cartState): void + public function setTaxMode(?string $taxMode): void { - $this->cartState = $cartState; + $this->taxMode = $taxMode; } /** - * @param ?Address $shippingAddress + * @param ?string $taxRoundingMode */ - public function setShippingAddress(?Address $shippingAddress): void + public function setTaxRoundingMode(?string $taxRoundingMode): void { - $this->shippingAddress = $shippingAddress; + $this->taxRoundingMode = $taxRoundingMode; } /** - * @param ?Address $billingAddress + * @param ?string $taxCalculationMode */ - public function setBillingAddress(?Address $billingAddress): void + public function setTaxCalculationMode(?string $taxCalculationMode): void { - $this->billingAddress = $billingAddress; + $this->taxCalculationMode = $taxCalculationMode; } /** - * @param ?string $shippingMode + * @param ?string $inventoryMode */ - public function setShippingMode(?string $shippingMode): void + public function setInventoryMode(?string $inventoryMode): void { - $this->shippingMode = $shippingMode; + $this->inventoryMode = $inventoryMode; } /** - * @param ?ShippingCollection $shipping + * @param ?string $cartState */ - public function setShipping(?ShippingCollection $shipping): void + public function setCartState(?string $cartState): void { - $this->shipping = $shipping; + $this->cartState = $cartState; } /** - * @param ?string $inventoryMode + * @param ?Address $billingAddress */ - public function setInventoryMode(?string $inventoryMode): void + public function setBillingAddress(?Address $billingAddress): void { - $this->inventoryMode = $inventoryMode; + $this->billingAddress = $billingAddress; } /** - * @param ?string $taxMode + * @param ?Address $shippingAddress */ - public function setTaxMode(?string $taxMode): void + public function setShippingAddress(?Address $shippingAddress): void { - $this->taxMode = $taxMode; + $this->shippingAddress = $shippingAddress; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingMode */ - public function setTaxRoundingMode(?string $taxRoundingMode): void + public function setShippingMode(?string $shippingMode): void { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingMode = $shippingMode; } /** - * @param ?string $taxCalculationMode + * @param ?ShippingInfo $shippingInfo */ - public function setTaxCalculationMode(?string $taxCalculationMode): void + public function setShippingInfo(?ShippingInfo $shippingInfo): void { - $this->taxCalculationMode = $taxCalculationMode; + $this->shippingInfo = $shippingInfo; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingCollection $shipping */ - public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + public function setShipping(?ShippingCollection $shipping): void { - $this->customerGroup = $customerGroup; + $this->shipping = $shipping; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput */ - public function setCountry(?string $country): void + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?AddressCollection $itemShippingAddresses */ - public function setShippingInfo(?ShippingInfo $shippingInfo): void + public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void { - $this->shippingInfo = $shippingInfo; + $this->itemShippingAddresses = $itemShippingAddresses; } /** @@ -1423,11 +1453,11 @@ public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): } /** - * @param ?CustomFields $custom + * @param ?CartDiscountReferenceCollection $refusedGifts */ - public function setCustom(?CustomFields $custom): void + public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void { - $this->custom = $custom; + $this->refusedGifts = $refusedGifts; } /** @@ -1439,59 +1469,59 @@ public function setPaymentInfo(?PaymentInfo $paymentInfo): void } /** - * @param ?string $locale + * @param ?string $country */ - public function setLocale(?string $locale): void + public function setCountry(?string $country): void { - $this->locale = $locale; + $this->country = $country; } /** - * @param ?int $deleteDaysAfterLastModification + * @param ?string $locale */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void + public function setLocale(?string $locale): void { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->locale = $locale; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?string $origin */ - public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void + public function setOrigin(?string $origin): void { - $this->refusedGifts = $refusedGifts; + $this->origin = $origin; } /** - * @param ?string $origin + * @param ?CustomFields $custom */ - public function setOrigin(?string $origin): void + public function setCustom(?CustomFields $custom): void { - $this->origin = $origin; + $this->custom = $custom; } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?int $deleteDaysAfterLastModification */ - public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void { - $this->shippingRateInput = $shippingRateInput; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?LastModifiedBy $lastModifiedBy */ - public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->lastModifiedBy = $lastModifiedBy; } /** - * @param ?int $totalLineItemQuantity + * @param ?CreatedBy $createdBy */ - public function setTotalLineItemQuantity(?int $totalLineItemQuantity): void + public function setCreatedBy(?CreatedBy $createdBy): void { - $this->totalLineItemQuantity = $totalLineItemQuantity; + $this->createdBy = $createdBy; } diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php index d42e8f2e68c..5e41ab33195 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php @@ -14,9 +14,9 @@ interface CartPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** @@ -28,26 +28,36 @@ interface CartPagedQueryResponse extends JsonObject public function getLimit(); /** + *

    Number of elements skipped.

    + * * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

    Actual number of results returned.

    + * * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

    Carts matching the query.

    + * * @return null|CartCollection */ @@ -58,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -68,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?CartCollection $results */ diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php index f829e499867..1d6508a5e82 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php @@ -30,19 +30,19 @@ final class CartPagedQueryResponseBuilder implements Builder * @var ?int */ - private $count; + private $offset; /** * @var ?int */ - private $total; + private $count; /** * @var ?int */ - private $offset; + private $total; /** @@ -62,35 +62,45 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

    Carts matching the query.

    + * * @return null|CartCollection */ @@ -111,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -159,9 +169,9 @@ public function build(): CartPagedQueryResponse { return new CartPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php index 246b766281a..da55dc9f824 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php @@ -29,19 +29,19 @@ final class CartPagedQueryResponseModel extends JsonObjectModel implements CartP * * @var ?int */ - protected $count; + protected $offset; /** * * @var ?int */ - protected $total; + protected $count; /** * * @var ?int */ - protected $offset; + protected $total; /** * @@ -55,15 +55,15 @@ final class CartPagedQueryResponseModel extends JsonObjectModel implements CartP */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?CartCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } @@ -88,62 +88,72 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

    Carts matching the query.

    + * * * @return null|CartCollection */ @@ -170,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -186,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?CartCollection $results */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php index f3a98397420..4803061ac7a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php @@ -16,9 +16,10 @@ interface CartRecalculateAction extends CartUpdateAction public const FIELD_UPDATE_PRODUCT_DATA = 'updateProductData'; /** - *

    If set to true, the line item product data (name, variant and productType) will also be updated. - * If set to false, only the prices and tax rates of the line item will be updated. - * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

    + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php index 57e0e670f40..4c13aac8eb9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php @@ -27,9 +27,10 @@ final class CartRecalculateActionBuilder implements Builder private $updateProductData; /** - *

    If set to true, the line item product data (name, variant and productType) will also be updated. - * If set to false, only the prices and tax rates of the line item will be updated. - * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

    + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php index 003d836b97b..d3f56c24c1c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php @@ -63,9 +63,10 @@ public function getAction() } /** - *

    If set to true, the line item product data (name, variant and productType) will also be updated. - * If set to false, only the prices and tax rates of the line item will be updated. - * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

    + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    * * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php index 2940a81f4fa..d5b9d6109c8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php @@ -16,6 +16,8 @@ interface CartRemoveCustomLineItemAction extends CartUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + *

    id of the Custom Line Item to remove.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php index f2780568d89..7f84ab83ea5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php @@ -27,6 +27,8 @@ final class CartRemoveCustomLineItemActionBuilder implements Builder private $customLineItemId; /** + *

    id of the Custom Line Item to remove.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php index a8ee1baf3f7..50aa00a2a8b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    id of the Custom Line Item to remove.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php index c9e541f02c4..58034461d5e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php @@ -17,7 +17,7 @@ interface CartRemoveDiscountCodeAction extends CartUpdateAction public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php index 797ed4ad4bd..ece9ccba611 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php @@ -29,7 +29,7 @@ final class CartRemoveDiscountCodeActionBuilder implements Builder private $discountCode; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php index 6495735039e..1bf6720ab24 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php index c7344a371bb..d1e345bbc0e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php @@ -16,6 +16,8 @@ interface CartRemoveItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php index ded2db3caf4..ad134d08d4b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php @@ -27,6 +27,8 @@ final class CartRemoveItemShippingAddressActionBuilder implements Builder private $addressKey; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php index 84fa14e8c35..b75353a22ce 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php index 85136b4e228..a2f228995ff 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php @@ -21,20 +21,24 @@ interface CartRemoveLineItemAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS_TO_REMOVE = 'shippingDetailsToRemove'; /** + *

    id of the Line Item to remove.

    + * * @return null|string */ public function getLineItemId(); /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -42,12 +46,16 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + *

    Container for Line Item-specific addresses to remove.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php index 6992a12efbf..fd22747841b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php @@ -53,6 +53,8 @@ final class CartRemoveLineItemActionBuilder implements Builder private $shippingDetailsToRemove; /** + *

    id of the Line Item to remove.

    + * * @return null|string */ @@ -62,6 +64,9 @@ public function getLineItemId() } /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * @return null|int */ @@ -71,8 +76,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -83,6 +87,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -92,6 +98,8 @@ public function getExternalTotalPrice() } /** + *

    Container for Line Item-specific addresses to remove.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php index 9d1fefc2e6a..2f26f2971ef 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php @@ -97,6 +97,8 @@ public function getAction() } /** + *

    id of the Line Item to remove.

    + * * * @return null|string */ @@ -115,6 +117,9 @@ public function getLineItemId() } /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * * @return null|int */ @@ -133,8 +138,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -155,6 +159,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -174,6 +180,8 @@ public function getExternalTotalPrice() } /** + *

    Container for Line Item-specific addresses to remove.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php index b98badde8c4..2c3879a043b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php @@ -17,6 +17,8 @@ interface CartRemovePaymentAction extends CartUpdateAction public const FIELD_PAYMENT = 'payment'; /** + *

    Payment to remove from the Cart.

    + * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php index 9cec9ea55a6..f1349924d61 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php @@ -29,6 +29,8 @@ final class CartRemovePaymentActionBuilder implements Builder private $payment; /** + *

    Payment to remove from the Cart.

    + * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php index 7a72f6c176f..dd280128ecc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    Payment to remove from the Cart.

    + * * * @return null|PaymentResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php index db843af3edd..9fc6ba07e16 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php @@ -16,7 +16,7 @@ interface CartRemoveShippingMethodAction extends CartUpdateAction public const FIELD_SHIPPING_KEY = 'shippingKey'; /** - *

    User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping Method to remove from the Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php index b689311a3e1..48caa4bc6e7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php @@ -27,7 +27,7 @@ final class CartRemoveShippingMethodActionBuilder implements Builder private $shippingKey; /** - *

    User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping Method to remove from the Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php index e78a76b4ec9..719553b7fe9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php @@ -63,7 +63,7 @@ public function getAction() } /** - *

    User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping Method to remove from the Cart.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php index f5acd745c2b..b46700cbf93 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php @@ -16,7 +16,8 @@ interface CartSetAnonymousIdAction extends CartUpdateAction public const FIELD_ANONYMOUS_ID = 'anonymousId'; /** - *

    If not set, any existing anonymous ID will be removed.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php index 560e59fe2a7..b45dfdaf533 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php @@ -27,7 +27,8 @@ final class CartSetAnonymousIdActionBuilder implements Builder private $anonymousId; /** - *

    If not set, any existing anonymous ID will be removed.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php index c22b12ca59f..9e4853398d5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php @@ -63,7 +63,8 @@ public function getAction() } /** - *

    If not set, any existing anonymous ID will be removed.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php index cb4581bd77f..a5d806891aa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php @@ -17,6 +17,9 @@ interface CartSetBillingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php index 3cca6ab90d3..b609ef19f90 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php @@ -29,6 +29,9 @@ final class CartSetBillingAddressActionBuilder implements Builder private $address; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php index 3aad9b182f5..f017b55623a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitAction.php b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitAction.php new file mode 100644 index 00000000000..7ec80b0731b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitAction.php @@ -0,0 +1,31 @@ +New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit(); + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionBuilder.php new file mode 100644 index 00000000000..c48d3e4c669 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CartSetBusinessUnitActionBuilder implements Builder +{ + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $businessUnit; + + /** + *

    New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + public function build(): CartSetBusinessUnitAction + { + return new CartSetBusinessUnitActionModel( + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit + ); + } + + public static function of(): CartSetBusinessUnitActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionCollection.php new file mode 100644 index 00000000000..4bd811ed495 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartSetBusinessUnitAction current() + * @method CartSetBusinessUnitAction end() + * @method CartSetBusinessUnitAction at($offset) + */ +class CartSetBusinessUnitActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartSetBusinessUnitAction $value + * @psalm-param CartSetBusinessUnitAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartSetBusinessUnitActionCollection + */ + public function add($value) + { + if (!$value instanceof CartSetBusinessUnitAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartSetBusinessUnitAction + */ + protected function mapper() + { + return function (?int $index): ?CartSetBusinessUnitAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartSetBusinessUnitAction $data */ + $data = CartSetBusinessUnitActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionModel.php new file mode 100644 index 00000000000..0f98be01e9d --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetBusinessUnitActionModel.php @@ -0,0 +1,96 @@ +businessUnit = $businessUnit; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart.

    + * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->businessUnit; + } + + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + { + $this->businessUnit = $businessUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php index e1caa0a794d..efc6c7b42f5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php @@ -18,7 +18,7 @@ interface CartSetCartTotalTaxAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_PORTIONS = 'externalTaxPortions'; /** - *

    The total gross amount of the cart (totalNet + taxes).

    + *

    The Cart's total gross price becoming the totalGross field (totalNet + taxes) on the Cart's taxedPrice.

    * * @return null|Money @@ -26,6 +26,8 @@ interface CartSetCartTotalTaxAction extends CartUpdateAction public function getExternalTotalGross(); /** + *

    Set if the externalTotalGross price is a sum of portions with different tax rates.

    + * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php index 2666912d354..3d5e57c0cfe 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php @@ -35,7 +35,7 @@ final class CartSetCartTotalTaxActionBuilder implements Builder private $externalTaxPortions; /** - *

    The total gross amount of the cart (totalNet + taxes).

    + *

    The Cart's total gross price becoming the totalGross field (totalNet + taxes) on the Cart's taxedPrice.

    * * @return null|Money @@ -46,6 +46,8 @@ public function getExternalTotalGross() } /** + *

    Set if the externalTotalGross price is a sum of portions with different tax rates.

    + * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php index 8e73054e544..0e12f21fe48 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php @@ -73,7 +73,7 @@ public function getAction() } /** - *

    The total gross amount of the cart (totalNet + taxes).

    + *

    The Cart's total gross price becoming the totalGross field (totalNet + taxes) on the Cart's taxedPrice.

    * * * @return null|Money @@ -94,6 +94,8 @@ public function getExternalTotalGross() } /** + *

    Set if the externalTotalGross price is a sum of portions with different tax rates.

    + * * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php index 301678b539f..2335426f269 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php @@ -16,7 +16,10 @@ interface CartSetCountryAction extends CartUpdateAction public const FIELD_COUNTRY = 'country'; /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php index da6cf790f67..6ac1b4d96a5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php @@ -27,7 +27,10 @@ final class CartSetCountryActionBuilder implements Builder private $country; /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php index 0905507420d..b9c1bac24c5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php @@ -63,7 +63,10 @@ public function getAction() } /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php index 5e4926f0177..b12f63473c8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php @@ -18,6 +18,8 @@ interface CartSetCustomLineItemCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php index 8d20de0ca15..6d57081bd99 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetCustomLineItemCustomFieldActionBuilder implements Builder private $value; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php index 3a333d3e80f..a261f3e49e0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php index 0c64383c6d0..c5434ec77d3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php @@ -20,6 +20,8 @@ interface CartSetCustomLineItemCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php index b5a5da7797f..a3ac17e123a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class CartSetCustomLineItemCustomTypeActionBuilder implements Builder private $fields; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php index 74d85847d37..bdad2655931 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php index 71d3888c802..8a0ba788a54 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php @@ -17,12 +17,17 @@ interface CartSetCustomLineItemShippingDetailsAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php index 7d4096aaa06..99064ad75c1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php @@ -33,6 +33,8 @@ final class CartSetCustomLineItemShippingDetailsActionBuilder implements Builder private $shippingDetails; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php index 13fdf0f5ec7..634594746b9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php index 6599c44e066..4f0d377c066 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php @@ -17,12 +17,17 @@ interface CartSetCustomLineItemTaxAmountAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php index f683816f848..e65c635fb91 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php @@ -33,6 +33,8 @@ final class CartSetCustomLineItemTaxAmountActionBuilder implements Builder private $externalTaxAmount; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php index f09ac38acf3..1d5c61e85a5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php index 187f42a03ab..d220e6b9816 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php @@ -17,12 +17,17 @@ interface CartSetCustomLineItemTaxRateAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    Value to set. + * If empty, an existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php index a94cc96c36c..dc6c3b5434a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php @@ -33,6 +33,8 @@ final class CartSetCustomLineItemTaxRateActionBuilder implements Builder private $externalTaxRate; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, an existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php index f8171ecdabe..0f889b57693 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getCustomLineItemId() } /** + *

    Value to set. + * If empty, an existing value is removed.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php index 8560809c5f1..2b0bc510acd 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php @@ -21,19 +21,23 @@ interface CartSetCustomShippingMethodAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    Name of the custom Shipping Method.

    + * * @return null|string */ public function getShippingMethodName(); /** + *

    Determines the shipping price.

    + * * @return null|ShippingRateDraft */ public function getShippingRate(); /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -41,6 +45,8 @@ public function getShippingRate(); public function getTaxCategory(); /** + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php index b188f2dd087..e5925478bbb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php @@ -49,6 +49,8 @@ final class CartSetCustomShippingMethodActionBuilder implements Builder private $externalTaxRate; /** + *

    Name of the custom Shipping Method.

    + * * @return null|string */ @@ -58,6 +60,8 @@ public function getShippingMethodName() } /** + *

    Determines the shipping price.

    + * * @return null|ShippingRateDraft */ @@ -67,7 +71,7 @@ public function getShippingRate() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -78,6 +82,8 @@ public function getTaxCategory() } /** + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php index 91460c9cd61..d048af09b71 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php @@ -91,6 +91,8 @@ public function getAction() } /** + *

    Name of the custom Shipping Method.

    + * * * @return null|string */ @@ -109,6 +111,8 @@ public function getShippingMethodName() } /** + *

    Determines the shipping price.

    + * * * @return null|ShippingRateDraft */ @@ -128,7 +132,7 @@ public function getShippingRate() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * * @return null|TaxCategoryResourceIdentifier @@ -149,6 +153,8 @@ public function getTaxCategory() } /** + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php index d262f2d4f2d..a577dec0df3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php @@ -16,6 +16,9 @@ interface CartSetCustomerEmailAction extends CartUpdateAction public const FIELD_EMAIL = 'email'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php index 33a8abcaa17..8e2e8ff430d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php @@ -27,6 +27,9 @@ final class CartSetCustomerEmailActionBuilder implements Builder private $email; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php index 7d82ca257fa..c0af6dc82de 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php index abe906f075a..804eee20b1c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php @@ -17,7 +17,8 @@ interface CartSetCustomerGroupAction extends CartUpdateAction public const FIELD_CUSTOMER_GROUP = 'customerGroup'; /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php index ed7ff721ff8..c46d91480ff 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php @@ -29,7 +29,8 @@ final class CartSetCustomerGroupActionBuilder implements Builder private $customerGroup; /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php index 5539dd93edd..32dbd63d9af 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php @@ -65,7 +65,8 @@ public function getAction() } /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php index f05a624ccd3..625ddf21952 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php @@ -16,7 +16,7 @@ interface CartSetCustomerIdAction extends CartUpdateAction public const FIELD_CUSTOMER_ID = 'customerId'; /** - *

    If set, a customer with the given ID must exist in the project.

    + *

    id of an existing Customer. If empty, any value is removed.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php index 74d7bfa7877..bbab59b2f94 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php @@ -27,7 +27,7 @@ final class CartSetCustomerIdActionBuilder implements Builder private $customerId; /** - *

    If set, a customer with the given ID must exist in the project.

    + *

    id of an existing Customer. If empty, any value is removed.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php index 5a9b72d2aa2..6fc8e020a64 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php @@ -63,7 +63,7 @@ public function getAction() } /** - *

    If set, a customer with the given ID must exist in the project.

    + *

    id of an existing Customer. If empty, any value is removed.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php index 7d7e9e8ed9d..985f5dce336 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,9 @@ interface CartSetDeleteDaysAfterLastModificationAction extends CartUpdateAction public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php index b168fb13fdb..f1fe807d18f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php @@ -27,6 +27,9 @@ final class CartSetDeleteDaysAfterLastModificationActionBuilder implements Build private $deleteDaysAfterLastModification; /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php index 9627b65df74..b37c9bb1dc7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php index 9db4f9224a0..82450cec922 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php @@ -18,6 +18,8 @@ interface CartSetDeliveryAddressCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + *

    id of the Delivery.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php index 7a4666cf1cb..ea86c4883f0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetDeliveryAddressCustomFieldActionBuilder implements Builder private $value; /** + *

    id of the Delivery.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php index bc4d71641f6..5d13d59df76 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the Delivery.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php index 51c05592dce..811bd15f402 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php @@ -20,14 +20,16 @@ interface CartSetDeliveryAddressCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    id of the Delivery.

    + * * @return null|string */ public function getDeliveryId(); /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * @return null|TypeResourceIdentifier @@ -35,7 +37,7 @@ public function getDeliveryId(); public function getType(); /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php index aa34ad8e526..4aedf4fc2cc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class CartSetDeliveryAddressCustomTypeActionBuilder implements Builder private $fields; /** + *

    id of the Delivery.

    + * * @return null|string */ @@ -52,8 +54,8 @@ public function getDeliveryId() } /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * @return null|TypeResourceIdentifier @@ -64,7 +66,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php index 118344008ef..9b55d62ec8a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    id of the Delivery.

    + * * * @return null|string */ @@ -101,8 +103,8 @@ public function getDeliveryId() } /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * * @return null|TypeResourceIdentifier @@ -123,7 +125,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php index 941557c9f1e..d5d96ae8aef 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php @@ -16,6 +16,12 @@ interface CartSetDirectDiscountsAction extends CartUpdateAction public const FIELD_DISCOUNTS = 'discounts'; /** + *
      + *
    • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
    • + *
    • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
    • + *
    + * * @return null|DirectDiscountDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php index 58b6a55bea6..190611e13d6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php @@ -27,6 +27,12 @@ final class CartSetDirectDiscountsActionBuilder implements Builder private $discounts; /** + *
      + *
    • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
    • + *
    • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
    • + *
    + * * @return null|DirectDiscountDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php index df96cd5afef..5f4770e1499 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php @@ -63,6 +63,12 @@ public function getAction() } /** + *
      + *
    • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
    • + *
    • If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
    • + *
    + * * * @return null|DirectDiscountDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php index 0badfa35415..81ebf5fc730 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php @@ -18,6 +18,8 @@ interface CartSetItemShippingAddressCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + *

    key of the Address in itemShippingAddress.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php index f670fdbb026..e0bd9a40b83 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetItemShippingAddressCustomFieldActionBuilder implements Builde private $value; /** + *

    key of the Address in itemShippingAddress.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php index df4eba768cb..32d4129af9f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    key of the Address in itemShippingAddress.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php index 75f3f8d4e0e..4343cded627 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php @@ -20,6 +20,8 @@ interface CartSetItemShippingAddressCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    key of the Address in itemShippingAddress.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php index f09ee96cab6..7cc2313475b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class CartSetItemShippingAddressCustomTypeActionBuilder implements Builder private $fields; /** + *

    key of the Address in itemShippingAddress.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php index 0a50a2334c6..f48c71e6d67 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    key of the Address in itemShippingAddress.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php index 8756f34db55..f497ba9e5da 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php @@ -16,6 +16,9 @@ interface CartSetKeyAction extends CartUpdateAction public const FIELD_KEY = 'key'; /** + *

    Value to set. + * If empty, any existing key will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php index e34150d35ff..185ef3bb330 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php @@ -27,6 +27,9 @@ final class CartSetKeyActionBuilder implements Builder private $key; /** + *

    Value to set. + * If empty, any existing key will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php index 988dac79739..035cb1e8d6b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing key will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php index acffda50fcb..70af13892b3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php @@ -18,6 +18,8 @@ interface CartSetLineItemCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php index 78d70a80bf1..76b914c9784 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetLineItemCustomFieldActionBuilder implements Builder private $value; /** + *

    id of the LineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php index 6f6b2c54b43..9f5e4b41ae3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php index 61dfe887071..a907349b0c7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php @@ -20,14 +20,16 @@ interface CartSetLineItemCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + *

    Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * @return null|TypeResourceIdentifier @@ -35,7 +37,7 @@ public function getLineItemId(); public function getType(); /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php index 049e14bbe92..0b32e12f35a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class CartSetLineItemCustomTypeActionBuilder implements Builder private $fields; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -52,8 +54,8 @@ public function getLineItemId() } /** - *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + *

    Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * @return null|TypeResourceIdentifier @@ -64,7 +66,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php index 161ed30dc70..07e0751f095 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -101,8 +103,8 @@ public function getLineItemId() } /** - *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + *

    Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * * @return null|TypeResourceIdentifier @@ -123,7 +125,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php index c49c69e4c7e..249d260126b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php @@ -18,13 +18,19 @@ interface CartSetLineItemDistributionChannelAction extends CartUpdateAction public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php index 601e908dc2b..575b58ad57a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php @@ -35,6 +35,8 @@ final class CartSetLineItemDistributionChannelActionBuilder implements Builder private $distributionChannel; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,7 +46,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php index add8d96be0b..c9e49b8cb0c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,7 +93,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php index 070a51b9b13..d1dfdae118b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php @@ -18,14 +18,16 @@ interface CartSetLineItemPriceAction extends CartUpdateAction public const FIELD_EXTERNAL_PRICE = 'externalPrice'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php index f58d8a84531..4b663376833 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php @@ -35,6 +35,8 @@ final class CartSetLineItemPriceActionBuilder implements Builder private $externalPrice; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,8 +46,8 @@ public function getLineItemId() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php index d91f7ac87e1..d6c36ecf82d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,8 +93,8 @@ public function getLineItemId() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

    * * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php index 2907d5dcd3b..0b9c4caa34f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php @@ -17,12 +17,17 @@ interface CartSetLineItemShippingDetailsAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php index 36e1d49028d..550c1446b26 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php @@ -33,6 +33,8 @@ final class CartSetLineItemShippingDetailsActionBuilder implements Builder private $shippingDetails; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php index 44ba2db166b..9541512af3d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php index 7c29e078cfb..4a6c3598490 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php @@ -18,13 +18,19 @@ interface CartSetLineItemSupplyChannelAction extends CartUpdateAction public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php index fadbb6d2c08..02913d932c2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php @@ -35,6 +35,8 @@ final class CartSetLineItemSupplyChannelActionBuilder implements Builder private $supplyChannel; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,7 +46,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php index 8fa49b27ce5..969f326f4e9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,7 +93,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php index 7ae7c296512..8775012f67e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php @@ -18,19 +18,24 @@ interface CartSetLineItemTaxAmountAction extends CartUpdateAction public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php index b65738e45bd..23d225629ee 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetLineItemTaxAmountActionBuilder implements Builder private $shippingKey; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -48,6 +50,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ @@ -57,7 +62,7 @@ public function getExternalTaxAmount() } /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php index cbdcd4c9f93..dbac05a55f6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -97,6 +99,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ExternalTaxAmountDraft */ @@ -116,7 +121,7 @@ public function getExternalTaxAmount() } /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php index 210842a7f6d..4c145ba1faf 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php @@ -18,19 +18,24 @@ interface CartSetLineItemTaxRateAction extends CartUpdateAction public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php index 49188570089..fdd0b0ab8b5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php @@ -39,6 +39,8 @@ final class CartSetLineItemTaxRateActionBuilder implements Builder private $shippingKey; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -48,6 +50,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ @@ -57,7 +62,7 @@ public function getExternalTaxRate() } /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php index 9cc0f02173a..68bbb8f4e39 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -97,6 +99,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ExternalTaxRateDraft */ @@ -116,7 +121,7 @@ public function getExternalTaxRate() } /** - *

    key of the ShippingMethod used for this Line Item.``` + *

    key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

    * * diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php index c186b4509e0..668e19bd89e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php @@ -17,12 +17,17 @@ interface CartSetLineItemTotalPriceAction extends CartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php index 411b4cede84..6c0d73ebe32 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php @@ -33,6 +33,8 @@ final class CartSetLineItemTotalPriceActionBuilder implements Builder private $externalTotalPrice; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -42,6 +44,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php index 9be61470c91..f5319acc86d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -89,6 +91,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

    + * * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php index 6623c89cb41..0693a14a5ec 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php @@ -16,6 +16,10 @@ interface CartSetLocaleAction extends CartUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php index 7fe9a541e18..980e50be9a2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php @@ -27,6 +27,10 @@ final class CartSetLocaleActionBuilder implements Builder private $locale; /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php index 6c29cf3ff37..220da287eb6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php @@ -63,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php index 51fdce91bc4..b95a1ee74be 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php @@ -17,6 +17,9 @@ interface CartSetShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items of the Cart.

    + * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php index 5d5a1a70aa8..2e801fa2a8a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php @@ -29,6 +29,9 @@ final class CartSetShippingAddressActionBuilder implements Builder private $address; /** + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items of the Cart.

    + * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php index 6a4240d010f..72d6d046448 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items of the Cart.

    + * * * @return null|BaseAddress */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php index 389bbce7e0a..fe339eb6afa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php @@ -18,7 +18,9 @@ interface CartSetShippingCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php index 77268bc5015..c49918d0676 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php @@ -39,7 +39,9 @@ final class CartSetShippingCustomFieldActionBuilder implements Builder private $value; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php index 994e3c317a4..b601539059c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php @@ -79,7 +79,9 @@ public function getAction() } /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php index 3e4b73974a7..ecfdc54879e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php @@ -20,7 +20,9 @@ interface CartSetShippingCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * @return null|string @@ -28,8 +30,8 @@ interface CartSetShippingCustomTypeAction extends CartUpdateAction public function getShippingKey(); /** - *

    Defines the Type that extends the shippingAddress with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    + *

    Defines the Type that extends the specified ShippingMethod with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * * @return null|TypeResourceIdentifier @@ -37,7 +39,7 @@ public function getShippingKey(); public function getType(); /** - *

    Sets the Custom Fields fields for the shippingAddress.

    + *

    Sets the Custom Fields fields for the shippingMethod.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php index 0d1d1706f1b..d9fd6a474e7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php @@ -43,7 +43,9 @@ final class CartSetShippingCustomTypeActionBuilder implements Builder private $fields; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * @return null|string @@ -54,8 +56,8 @@ public function getShippingKey() } /** - *

    Defines the Type that extends the shippingAddress with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    + *

    Defines the Type that extends the specified ShippingMethod with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * * @return null|TypeResourceIdentifier @@ -66,7 +68,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the shippingAddress.

    + *

    Sets the Custom Fields fields for the shippingMethod.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php index 6637a7bd387..5ce04626639 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php @@ -83,7 +83,9 @@ public function getAction() } /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize + * on a Cart with Multiple ShippingMode. + * Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

    * * * @return null|string @@ -103,8 +105,8 @@ public function getShippingKey() } /** - *

    Defines the Type that extends the shippingAddress with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    + *

    Defines the Type that extends the specified ShippingMethod with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * * * @return null|TypeResourceIdentifier @@ -125,7 +127,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the shippingAddress.

    + *

    Sets the Custom Fields fields for the shippingMethod.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php index 3da4d557467..77c9d66c8c5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php @@ -18,7 +18,9 @@ interface CartSetShippingMethodAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * @return null|ShippingMethodResourceIdentifier @@ -26,6 +28,8 @@ interface CartSetShippingMethodAction extends CartUpdateAction public function getShippingMethod(); /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php index f02c54968bc..a418ccad33c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php @@ -35,7 +35,9 @@ final class CartSetShippingMethodActionBuilder implements Builder private $externalTaxRate; /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * @return null|ShippingMethodResourceIdentifier @@ -46,6 +48,8 @@ public function getShippingMethod() } /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php index bbb17027fb6..11729daa524 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php @@ -73,7 +73,9 @@ public function getAction() } /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * * @return null|ShippingMethodResourceIdentifier @@ -94,6 +96,8 @@ public function getShippingMethod() } /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php index daf35da1015..2b608bccede 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php @@ -16,6 +16,9 @@ interface CartSetShippingMethodTaxAmountAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php index 63138953113..8f47fb01fb9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php @@ -27,6 +27,9 @@ final class CartSetShippingMethodTaxAmountActionBuilder implements Builder private $externalTaxAmount; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php index 91de19d0adf..757031eb8c5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php index 9f1f937196c..2a22f33657b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php @@ -16,6 +16,9 @@ interface CartSetShippingMethodTaxRateAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php index 636e662d192..4cd053aa8aa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php @@ -27,6 +27,9 @@ final class CartSetShippingMethodTaxRateActionBuilder implements Builder private $externalTaxRate; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php index fa811e8269d..974ba7867c0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php index 427a3572c2f..cfbe858883a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php @@ -16,10 +16,12 @@ interface CartSetShippingRateInputAction extends CartUpdateAction public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; /** - *

    Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php index 50795ef0cea..4baeb949926 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php @@ -27,10 +27,12 @@ final class CartSetShippingRateInputActionBuilder implements Builder private $shippingRateInput; /** - *

    Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php index ebefc9361b8..c14423089e5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php @@ -63,10 +63,12 @@ public function getAction() } /** - *

    Based on the definition of ShippingRateInputType. - * If CartClassification is defined, it must be ClassificationShippingRateInput. - * If CartScore is defined, it must be ScoreShippingRateInput. - * Otherwise it can not bet set.

    + *

    The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdate.php b/lib/commercetools-api/src/Models/Cart/CartUpdate.php index 981e174867d..6cc92723dc0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdate.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdate.php @@ -17,12 +17,17 @@ interface CartUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Cart on which the changes apply. + * If the expected version does not match the actual version, a 409 Conflict is returned.

    + * * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Cart.

    + * * @return null|CartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php index de35982accd..db6c1abbc12 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php @@ -60,6 +60,7 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA 'setBillingAddress' => CartSetBillingAddressActionModel::class, 'setBillingAddressCustomField' => CartSetBillingAddressCustomFieldActionModel::class, 'setBillingAddressCustomType' => CartSetBillingAddressCustomTypeActionModel::class, + 'setBusinessUnit' => CartSetBusinessUnitActionModel::class, 'setCartTotalTax' => CartSetCartTotalTaxActionModel::class, 'setCountry' => CartSetCountryActionModel::class, 'setCustomField' => CartSetCustomFieldActionModel::class, diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php b/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php index 4ff957fe461..953c6dc3f74 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php @@ -33,6 +33,9 @@ final class CartUpdateBuilder implements Builder private $actions; /** + *

    Expected version of the Cart on which the changes apply. + * If the expected version does not match the actual version, a 409 Conflict is returned.

    + * * @return null|int */ @@ -42,6 +45,8 @@ public function getVersion() } /** + *

    Update actions to be performed on the Cart.

    + * * @return null|CartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php index 932450074f4..0d30a25c566 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php @@ -17,9 +17,7 @@ interface CartUpdateItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php index 764b961c26d..73a31682bc5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php @@ -29,9 +29,7 @@ final class CartUpdateItemShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php index 34561186426..b1e68041749 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php @@ -65,9 +65,7 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php index 9a061fe6db2..189cd56af5a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php @@ -44,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Cart on which the changes apply. + * If the expected version does not match the actual version, a 409 Conflict is returned.

    + * * * @return null|int */ @@ -62,6 +65,8 @@ public function getVersion() } /** + *

    Update actions to be performed on the Cart.

    + * * * @return null|CartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php index eee8a46bd16..5490b884b07 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php @@ -18,13 +18,15 @@ interface ClassificationShippingRateInput extends ShippingRateInput public const FIELD_LABEL = 'label'; /** + *

    Key of the value used as a programmatic identifier.

    + * * @return null|string */ public function getKey(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Descriptive localized label of the value.

    * * @return null|LocalizedString diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php index 07b54cf0567..113bf9df443 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php @@ -35,6 +35,8 @@ final class ClassificationShippingRateInputBuilder implements Builder private $label; /** + *

    Key of the value used as a programmatic identifier.

    + * * @return null|string */ @@ -44,7 +46,7 @@ public function getKey() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Descriptive localized label of the value.

    * * @return null|LocalizedString diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php index c428bd78df3..05b25dbf69f 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php @@ -16,6 +16,8 @@ interface ClassificationShippingRateInputDraft extends ShippingRateInputDraft public const FIELD_KEY = 'key'; /** + *

    Key of the value used as a programmatic identifier.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php index ee44e4795c8..d3dc2761587 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php @@ -27,6 +27,8 @@ final class ClassificationShippingRateInputDraftBuilder implements Builder private $key; /** + *

    Key of the value used as a programmatic identifier.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php index df445e83bbf..f41eb760399 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php @@ -63,6 +63,8 @@ public function getType() } /** + *

    Key of the value used as a programmatic identifier.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php index 9094f3c3501..f61179dc7ce 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php @@ -73,6 +73,8 @@ public function getType() } /** + *

    Key of the value used as a programmatic identifier.

    + * * * @return null|string */ @@ -91,7 +93,7 @@ public function getKey() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Descriptive localized label of the value.

    * * * @return null|LocalizedString diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php index 05286289f68..ba407d263aa 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\TypedMoney; use Commercetools\Api\Models\Order\ItemStateCollection; @@ -35,7 +36,7 @@ interface CustomLineItem extends JsonObject public const FIELD_PRICE_MODE = 'priceMode'; /** - *

    Unique identifier of the CustomLineItem.

    + *

    Unique identifier of the Custom Line Item.

    * * @return null|string @@ -43,7 +44,7 @@ interface CustomLineItem extends JsonObject public function getId(); /** - *

    The name of this CustomLineItem.

    + *

    Name of the Custom Line Item.

    * * @return null|LocalizedString @@ -51,8 +52,7 @@ public function getId(); public function getName(); /** - *

    The cost to add to the cart. - * The amount can be negative.

    + *

    Money value of the Custom Line Item.

    * * @return null|TypedMoney @@ -60,7 +60,7 @@ public function getName(); public function getMoney(); /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * @return null|TaxedItemPrice @@ -68,18 +68,18 @@ public function getMoney(); public function getTaxedPrice(); /** - *

    The total price of this custom line item. - * If custom line item is discounted, then the totalPrice would be the discounted custom line item price multiplied by quantity. - * Otherwise a total price is just a money multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Total price of the Custom Line Item (money multiplied by quantity). + * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

    + *

    Includes taxes if the TaxRate includedInPrice is true.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalPrice(); /** - *

    A unique String in the cart to identify this CustomLineItem.

    + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It matches the pattern [a-zA-Z0-9_-]{2,256}.

    * * @return null|string @@ -87,8 +87,7 @@ public function getTotalPrice(); public function getSlug(); /** - *

    The amount of a CustomLineItem in the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items in the Cart.

    * * @return null|int @@ -96,20 +95,26 @@ public function getSlug(); public function getQuantity(); /** + *

    State of the Custom Line Item in the Cart.

    + * * @return null|ItemStateCollection */ public function getState(); /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * @return null|TaxCategoryReference */ public function getTaxCategory(); /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Custom Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Custom Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * @return null|TaxRate @@ -117,21 +122,23 @@ public function getTaxCategory(); public function getTaxRate(); /** + *

    Discounted price of a single quantity of the Custom Line Item.

    + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** + *

    Custom Fields of the Custom Line Item.

    + * * @return null|CustomFields */ public function getCustom(); /** - *

    Container for custom line item specific address(es). - * CustomLineItem fields that can be used in query predicates: slug, name, quantity, - * money, state, discountedPricePerQuantity.

    + *

    Container for Custom Line Item-specific addresses.

    * * @return null|ItemShippingDetails @@ -139,8 +146,7 @@ public function getCustom(); public function getShippingDetails(); /** - *

    Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.

    + *

    Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

    * * @return null|string @@ -168,9 +174,9 @@ public function setMoney(?TypedMoney $money): void; public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; /** - * @param ?TypedMoney $totalPrice + * @param ?CentPrecisionMoney $totalPrice */ - public function setTotalPrice(?TypedMoney $totalPrice): void; + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void; /** * @param ?string $slug diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php index 8a96d40bd4e..32ee8eb5f8a 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\TypedMoney; @@ -57,7 +59,7 @@ final class CustomLineItemBuilder implements Builder /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalPrice; @@ -116,7 +118,7 @@ final class CustomLineItemBuilder implements Builder private $priceMode; /** - *

    Unique identifier of the CustomLineItem.

    + *

    Unique identifier of the Custom Line Item.

    * * @return null|string @@ -127,7 +129,7 @@ public function getId() } /** - *

    The name of this CustomLineItem.

    + *

    Name of the Custom Line Item.

    * * @return null|LocalizedString @@ -138,8 +140,7 @@ public function getName() } /** - *

    The cost to add to the cart. - * The amount can be negative.

    + *

    Money value of the Custom Line Item.

    * * @return null|TypedMoney @@ -150,7 +151,7 @@ public function getMoney() } /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * @return null|TaxedItemPrice @@ -161,21 +162,21 @@ public function getTaxedPrice() } /** - *

    The total price of this custom line item. - * If custom line item is discounted, then the totalPrice would be the discounted custom line item price multiplied by quantity. - * Otherwise a total price is just a money multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Total price of the Custom Line Item (money multiplied by quantity). + * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

    + *

    Includes taxes if the TaxRate includedInPrice is true.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalPrice() { - return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; + return $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; } /** - *

    A unique String in the cart to identify this CustomLineItem.

    + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It matches the pattern [a-zA-Z0-9_-]{2,256}.

    * * @return null|string @@ -186,8 +187,7 @@ public function getSlug() } /** - *

    The amount of a CustomLineItem in the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items in the Cart.

    * * @return null|int @@ -198,6 +198,8 @@ public function getQuantity() } /** + *

    State of the Custom Line Item in the Cart.

    + * * @return null|ItemStateCollection */ @@ -207,6 +209,8 @@ public function getState() } /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * @return null|TaxCategoryReference */ @@ -216,8 +220,10 @@ public function getTaxCategory() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Custom Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Custom Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * @return null|TaxRate @@ -228,6 +234,8 @@ public function getTaxRate() } /** + *

    Discounted price of a single quantity of the Custom Line Item.

    + * * @return null|DiscountedLineItemPriceForQuantityCollection */ @@ -237,6 +245,8 @@ public function getDiscountedPricePerQuantity() } /** + *

    Custom Fields of the Custom Line Item.

    + * * @return null|CustomFields */ @@ -246,9 +256,7 @@ public function getCustom() } /** - *

    Container for custom line item specific address(es). - * CustomLineItem fields that can be used in query predicates: slug, name, quantity, - * money, state, discountedPricePerQuantity.

    + *

    Container for Custom Line Item-specific addresses.

    * * @return null|ItemShippingDetails @@ -259,8 +267,7 @@ public function getShippingDetails() } /** - *

    Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.

    + *

    Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

    * * @return null|string @@ -315,10 +322,10 @@ public function withTaxedPrice(?TaxedItemPrice $taxedPrice) } /** - * @param ?TypedMoney $totalPrice + * @param ?CentPrecisionMoney $totalPrice * @return $this */ - public function withTotalPrice(?TypedMoney $totalPrice) + public function withTotalPrice(?CentPrecisionMoney $totalPrice) { $this->totalPrice = $totalPrice; @@ -461,7 +468,7 @@ public function withTaxedPriceBuilder(?TaxedItemPriceBuilder $taxedPrice) * @deprecated use withTotalPrice() instead * @return $this */ - public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice) + public function withTotalPriceBuilder(?CentPrecisionMoneyBuilder $totalPrice) { $this->totalPrice = $totalPrice; @@ -519,7 +526,7 @@ public function build(): CustomLineItem $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->money instanceof TypedMoneyBuilder ? $this->money->build() : $this->money, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, - $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, + $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->slug, $this->quantity, $this->state, diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php index bd70b638295..ad6178ce628 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php @@ -28,14 +28,15 @@ interface CustomLineItemDraft extends JsonObject public const FIELD_PRICE_MODE = 'priceMode'; /** + *

    Name of the Custom Line Item.

    + * * @return null|LocalizedString */ public function getName(); /** - *

    The amount of a CustomLineItemin the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items to add to the Cart.

    * * @return null|int @@ -43,19 +44,26 @@ public function getName(); public function getQuantity(); /** + *

    Money value of the Custom Line Item. + * The value can be negative.

    + * * @return null|Money */ public function getMoney(); /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * @return null|string */ public function getSlug(); /** - *

    The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode. + * This field is required for Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -63,7 +71,7 @@ public function getSlug(); public function getTaxCategory(); /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Custom Line Item if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft @@ -71,7 +79,7 @@ public function getTaxCategory(); public function getExternalTaxRate(); /** - *

    The custom fields.

    + *

    Custom Fields for the Custom Line Item.

    * * @return null|CustomFieldsDraft @@ -79,7 +87,7 @@ public function getExternalTaxRate(); public function getCustom(); /** - *

    Container for custom line item specific address(es).

    + *

    Container for Custom Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php index d315c937a71..1e3f7b76b2d 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php @@ -83,6 +83,8 @@ final class CustomLineItemDraftBuilder implements Builder private $priceMode; /** + *

    Name of the Custom Line Item.

    + * * @return null|LocalizedString */ @@ -92,8 +94,7 @@ public function getName() } /** - *

    The amount of a CustomLineItemin the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items to add to the Cart.

    * * @return null|int @@ -104,6 +105,9 @@ public function getQuantity() } /** + *

    Money value of the Custom Line Item. + * The value can be negative.

    + * * @return null|Money */ @@ -113,6 +117,9 @@ public function getMoney() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * @return null|string */ @@ -122,7 +129,8 @@ public function getSlug() } /** - *

    The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode. + * This field is required for Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -133,7 +141,7 @@ public function getTaxCategory() } /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Custom Line Item if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft @@ -144,7 +152,7 @@ public function getExternalTaxRate() } /** - *

    The custom fields.

    + *

    Custom Fields for the Custom Line Item.

    * * @return null|CustomFieldsDraft @@ -155,7 +163,7 @@ public function getCustom() } /** - *

    Container for custom line item specific address(es).

    + *

    Container for Custom Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php index 04dcf0b757c..d09a3059263 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php @@ -108,6 +108,8 @@ public function __construct( } /** + *

    Name of the Custom Line Item.

    + * * * @return null|LocalizedString */ @@ -127,8 +129,7 @@ public function getName() } /** - *

    The amount of a CustomLineItemin the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items to add to the Cart.

    * * * @return null|int @@ -148,6 +149,9 @@ public function getQuantity() } /** + *

    Money value of the Custom Line Item. + * The value can be negative.

    + * * * @return null|Money */ @@ -167,6 +171,9 @@ public function getMoney() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * * @return null|string */ @@ -185,7 +192,8 @@ public function getSlug() } /** - *

    The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode. + * This field is required for Platform TaxMode.

    * * * @return null|TaxCategoryResourceIdentifier @@ -206,7 +214,7 @@ public function getTaxCategory() } /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Custom Line Item if the Cart has the External TaxMode.

    * * * @return null|ExternalTaxRateDraft @@ -227,7 +235,7 @@ public function getExternalTaxRate() } /** - *

    The custom fields.

    + *

    Custom Fields for the Custom Line Item.

    * * * @return null|CustomFieldsDraft @@ -248,7 +256,7 @@ public function getCustom() } /** - *

    Container for custom line item specific address(es).

    + *

    Container for Custom Line Item-specific addresses.

    * * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index e30810a9f96..1374fcdbd82 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\TypedMoney; @@ -56,7 +58,7 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineIte /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalPrice; @@ -123,7 +125,7 @@ public function __construct( ?LocalizedString $name = null, ?TypedMoney $money = null, ?TaxedItemPrice $taxedPrice = null, - ?TypedMoney $totalPrice = null, + ?CentPrecisionMoney $totalPrice = null, ?string $slug = null, ?int $quantity = null, ?ItemStateCollection $state = null, @@ -151,7 +153,7 @@ public function __construct( } /** - *

    Unique identifier of the CustomLineItem.

    + *

    Unique identifier of the Custom Line Item.

    * * * @return null|string @@ -171,7 +173,7 @@ public function getId() } /** - *

    The name of this CustomLineItem.

    + *

    Name of the Custom Line Item.

    * * * @return null|LocalizedString @@ -192,8 +194,7 @@ public function getName() } /** - *

    The cost to add to the cart. - * The amount can be negative.

    + *

    Money value of the Custom Line Item.

    * * * @return null|TypedMoney @@ -214,7 +215,7 @@ public function getMoney() } /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * * @return null|TaxedItemPrice @@ -235,13 +236,12 @@ public function getTaxedPrice() } /** - *

    The total price of this custom line item. - * If custom line item is discounted, then the totalPrice would be the discounted custom line item price multiplied by quantity. - * Otherwise a total price is just a money multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Total price of the Custom Line Item (money multiplied by quantity). + * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

    + *

    Includes taxes if the TaxRate includedInPrice is true.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalPrice() { @@ -252,14 +252,15 @@ public function getTotalPrice() return null; } - $this->totalPrice = TypedMoneyModel::of($data); + $this->totalPrice = CentPrecisionMoneyModel::of($data); } return $this->totalPrice; } /** - *

    A unique String in the cart to identify this CustomLineItem.

    + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. + * It matches the pattern [a-zA-Z0-9_-]{2,256}.

    * * * @return null|string @@ -279,8 +280,7 @@ public function getSlug() } /** - *

    The amount of a CustomLineItem in the cart. - * Must be a positive integer.

    + *

    Number of Custom Line Items in the Cart.

    * * * @return null|int @@ -300,6 +300,8 @@ public function getQuantity() } /** + *

    State of the Custom Line Item in the Cart.

    + * * * @return null|ItemStateCollection */ @@ -318,6 +320,8 @@ public function getState() } /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * * @return null|TaxCategoryReference */ @@ -337,8 +341,10 @@ public function getTaxCategory() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Custom Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Custom Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * * @return null|TaxRate @@ -359,6 +365,8 @@ public function getTaxRate() } /** + *

    Discounted price of a single quantity of the Custom Line Item.

    + * * * @return null|DiscountedLineItemPriceForQuantityCollection */ @@ -377,6 +385,8 @@ public function getDiscountedPricePerQuantity() } /** + *

    Custom Fields of the Custom Line Item.

    + * * * @return null|CustomFields */ @@ -396,9 +406,7 @@ public function getCustom() } /** - *

    Container for custom line item specific address(es). - * CustomLineItem fields that can be used in query predicates: slug, name, quantity, - * money, state, discountedPricePerQuantity.

    + *

    Container for Custom Line Item-specific addresses.

    * * * @return null|ItemShippingDetails @@ -419,8 +427,7 @@ public function getShippingDetails() } /** - *

    Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.

    + *

    Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

    * * * @return null|string @@ -473,9 +480,9 @@ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void } /** - * @param ?TypedMoney $totalPrice + * @param ?CentPrecisionMoney $totalPrice */ - public function setTotalPrice(?TypedMoney $totalPrice): void + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void { $this->totalPrice = $totalPrice; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php index 75e5c9b301d..2c41bc5b638 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php @@ -9,9 +9,10 @@ namespace Commercetools\Api\Models\Cart; use Commercetools\Api\Models\Common\BaseAddress; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,7 +29,7 @@ interface CustomShippingDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the custom Shipping Method in the Cart with Multiple ShippingMode.

    * * @return null|string @@ -60,12 +61,13 @@ public function getShippingAddress(); public function getShippingRate(); /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -73,7 +75,7 @@ public function getShippingRate(); public function getShippingRateInput(); /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -84,16 +86,15 @@ public function getTaxCategory(); *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries(); @@ -101,7 +102,7 @@ public function getDeliveries(); *

    Custom Fields for the custom Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -136,17 +137,17 @@ public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput) public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void; + public function setDeliveries(?DeliveryDraftCollection $deliveries): void; /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php index eff9e0bbfd7..20900ca8a26 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php @@ -10,11 +10,13 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -65,24 +67,24 @@ final class CustomShippingDraftBuilder implements Builder /** - * @var ?string + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ private $deliveries; /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the custom Shipping Method in the Cart with Multiple ShippingMode.

    * * @return null|string @@ -126,12 +128,13 @@ public function getShippingRate() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -142,7 +145,7 @@ public function getShippingRateInput() } /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -156,19 +159,18 @@ public function getTaxCategory() *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { - return $this->externalTaxRate; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -179,11 +181,11 @@ public function getDeliveries() *

    Custom Fields for the custom Shipping Method.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { - return $this->custom; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -253,10 +255,10 @@ public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withExternalTaxRate(?string $externalTaxRate) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { $this->externalTaxRate = $externalTaxRate; @@ -264,10 +266,10 @@ public function withExternalTaxRate(?string $externalTaxRate) } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries * @return $this */ - public function withDeliveries(?DeliveryCollection $deliveries) + public function withDeliveries(?DeliveryDraftCollection $deliveries) { $this->deliveries = $deliveries; @@ -275,10 +277,10 @@ public function withDeliveries(?DeliveryCollection $deliveries) } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withCustom(?string $custom) + public function withCustom(?CustomFieldsDraft $custom) { $this->custom = $custom; @@ -329,6 +331,28 @@ public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $ta return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): CustomShippingDraft { return new CustomShippingDraftModel( @@ -338,9 +362,9 @@ public function build(): CustomShippingDraft $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->externalTaxRate, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->deliveries, - $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php index 394dff1ad43..6c33375798d 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php @@ -10,11 +10,13 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressModel; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -64,19 +66,19 @@ final class CustomShippingDraftModel extends JsonObjectModel implements CustomSh /** * - * @var ?string + * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** * - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ protected $deliveries; /** * - * @var ?string + * @var ?CustomFieldsDraft */ protected $custom; @@ -91,9 +93,9 @@ public function __construct( ?ShippingRateDraft $shippingRate = null, ?ShippingRateInputDraft $shippingRateInput = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?string $externalTaxRate = null, - ?DeliveryCollection $deliveries = null, - ?string $custom = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?DeliveryDraftCollection $deliveries = null, + ?CustomFieldsDraft $custom = null ) { $this->key = $key; $this->shippingMethodName = $shippingMethodName; @@ -107,7 +109,7 @@ public function __construct( } /** - *

    User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the custom Shipping Method in the Cart with Multiple ShippingMode.

    * * * @return null|string @@ -189,12 +191,13 @@ public function getShippingRate() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * * @return null|ShippingRateInputDraft @@ -215,7 +218,7 @@ public function getShippingRateInput() } /** - *

    Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

    + *

    Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

    * * * @return null|TaxCategoryResourceIdentifier @@ -239,28 +242,28 @@ public function getTaxCategory() *

    Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

    * * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { if (is_null($this->externalTaxRate)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->externalTaxRate = (string) $data; + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } return $this->externalTaxRate; } /** - *

    Deliveries tied to a Shipping Method in a multi-shipping method Cart. - * It holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the custom Shipping Method.

    * * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -270,7 +273,7 @@ public function getDeliveries() if (is_null($data)) { return null; } - $this->deliveries = DeliveryCollection::fromArray($data); + $this->deliveries = DeliveryDraftCollection::fromArray($data); } return $this->deliveries; @@ -280,17 +283,18 @@ public function getDeliveries() *

    Custom Fields for the custom Shipping Method.

    * * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { if (is_null($this->custom)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->custom = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } return $this->custom; @@ -346,25 +350,25 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void + public function setDeliveries(?DeliveryDraftCollection $deliveries): void { $this->deliveries = $deliveries; } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void + public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php index 63b230a7d43..b7de92b61c2 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php @@ -20,7 +20,7 @@ interface DirectDiscount extends JsonObject public const FIELD_TARGET = 'target'; /** - *

    The unique ID of the cart discount.

    + *

    Unique identifier of the Direct Discount.

    * * @return null|string @@ -28,13 +28,16 @@ interface DirectDiscount extends JsonObject public function getId(); /** + *

    Effect of the Discount on the Cart.

    + * * @return null|CartDiscountValue */ public function getValue(); /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Part of the Cart that is discounted.

    + *

    Empty when the value is set to giftLineItem.

    * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php index 17697b750cb..d78c22f0dea 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php @@ -43,7 +43,7 @@ final class DirectDiscountBuilder implements Builder private $target; /** - *

    The unique ID of the cart discount.

    + *

    Unique identifier of the Direct Discount.

    * * @return null|string @@ -54,6 +54,8 @@ public function getId() } /** + *

    Effect of the Discount on the Cart.

    + * * @return null|CartDiscountValue */ @@ -63,7 +65,8 @@ public function getValue() } /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Part of the Cart that is discounted.

    + *

    Empty when the value is set to giftLineItem.

    * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php index 5b8c2fe2073..61392c32276 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php @@ -19,13 +19,16 @@ interface DirectDiscountDraft extends JsonObject public const FIELD_TARGET = 'target'; /** + *

    Defines the effect the Discount will have.

    + * * @return null|CartDiscountValue */ public function getValue(); /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Defines what part of the Cart will be discounted.

    + *

    If value is set to giftLineItem, this must not be set.

    * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php index 8efa0b8cedb..3e1251615ee 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php @@ -37,6 +37,8 @@ final class DirectDiscountDraftBuilder implements Builder private $target; /** + *

    Defines the effect the Discount will have.

    + * * @return null|CartDiscountValue */ @@ -46,7 +48,8 @@ public function getValue() } /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Defines what part of the Cart will be discounted.

    + *

    If value is set to giftLineItem, this must not be set.

    * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php index c0b7a5cb1ad..9e03cd1d979 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php @@ -48,6 +48,8 @@ public function __construct( } /** + *

    Defines the effect the Discount will have.

    + * * * @return null|CartDiscountValue */ @@ -67,7 +69,8 @@ public function getValue() } /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Defines what part of the Cart will be discounted.

    + *

    If value is set to giftLineItem, this must not be set.

    * * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php index 02900326a08..fa776ec2b25 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php @@ -56,7 +56,7 @@ public function __construct( } /** - *

    The unique ID of the cart discount.

    + *

    Unique identifier of the Direct Discount.

    * * * @return null|string @@ -76,6 +76,8 @@ public function getId() } /** + *

    Effect of the Discount on the Cart.

    + * * * @return null|CartDiscountValue */ @@ -95,7 +97,8 @@ public function getValue() } /** - *

    Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

    + *

    Part of the Cart that is discounted.

    + *

    Empty when the value is set to giftLineItem.

    * * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php index 4b9b38611ad..5e7775bc3b1 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php @@ -18,12 +18,16 @@ interface DiscountCodeInfo extends JsonObject public const FIELD_STATE = 'state'; /** + *

    Discount Code associated with the Cart or Order.

    + * * @return null|DiscountCodeReference */ public function getDiscountCode(); /** + *

    Indicates the state of the Discount Code applied to the Cart or Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php index 9393c624199..c0c7d01aae5 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php @@ -35,6 +35,8 @@ final class DiscountCodeInfoBuilder implements Builder private $state; /** + *

    Discount Code associated with the Cart or Order.

    + * * @return null|DiscountCodeReference */ @@ -44,6 +46,8 @@ public function getDiscountCode() } /** + *

    Indicates the state of the Discount Code applied to the Cart or Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php index 04174528d24..65231cbe192 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php @@ -46,6 +46,8 @@ public function __construct( } /** + *

    Discount Code associated with the Cart or Order.

    + * * * @return null|DiscountCodeReference */ @@ -65,6 +67,8 @@ public function getDiscountCode() } /** + *

    Indicates the state of the Discount Code applied to the Cart or Order.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php index 81a5b85a437..98ad8e918ca 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php @@ -19,12 +19,16 @@ interface DiscountedLineItemPortion extends JsonObject public const FIELD_DISCOUNTED_AMOUNT = 'discountedAmount'; /** + *

    Cart Discount applicable on the Line Item.

    + * * @return null|CartDiscountReference */ public function getDiscount(); /** + *

    Money value of the discount applicable.

    + * * @return null|TypedMoney */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php index 167aa521343..d493c39c4ff 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php @@ -37,6 +37,8 @@ final class DiscountedLineItemPortionBuilder implements Builder private $discountedAmount; /** + *

    Cart Discount applicable on the Line Item.

    + * * @return null|CartDiscountReference */ @@ -46,6 +48,8 @@ public function getDiscount() } /** + *

    Money value of the discount applicable.

    + * * @return null|TypedMoney */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php index c129029edcf..e803859dbfe 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php @@ -48,6 +48,8 @@ public function __construct( } /** + *

    Cart Discount applicable on the Line Item.

    + * * * @return null|CartDiscountReference */ @@ -67,6 +69,8 @@ public function getDiscount() } /** + *

    Money value of the discount applicable.

    + * * * @return null|TypedMoney */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php index e1a2eb80719..617ed005d7f 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php @@ -18,12 +18,16 @@ interface DiscountedLineItemPrice extends JsonObject public const FIELD_INCLUDED_DISCOUNTS = 'includedDiscounts'; /** + *

    Money value of the discounted Line Item or Custom Line Item.

    + * * @return null|TypedMoney */ public function getValue(); /** + *

    Discount applicable on the Line Item or Custom Line Item.

    + * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php index 4f7f7e6d553..6f37fb8ca3c 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php @@ -35,6 +35,8 @@ final class DiscountedLineItemPriceBuilder implements Builder private $includedDiscounts; /** + *

    Money value of the discounted Line Item or Custom Line Item.

    + * * @return null|TypedMoney */ @@ -44,6 +46,8 @@ public function getValue() } /** + *

    Discount applicable on the Line Item or Custom Line Item.

    + * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php index 6ad5a4a5196..7ee4ab7d09f 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php @@ -17,12 +17,16 @@ interface DiscountedLineItemPriceForQuantity extends JsonObject public const FIELD_DISCOUNTED_PRICE = 'discountedPrice'; /** + *

    Number of Line Items or Custom Line Items in the Cart.

    + * * @return null|int */ public function getQuantity(); /** + *

    Discounted price of the Line Item or Custom Line Item.

    + * * @return null|DiscountedLineItemPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php index fd9e3e1923c..9e1f0d19242 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php @@ -33,6 +33,8 @@ final class DiscountedLineItemPriceForQuantityBuilder implements Builder private $discountedPrice; /** + *

    Number of Line Items or Custom Line Items in the Cart.

    + * * @return null|int */ @@ -42,6 +44,8 @@ public function getQuantity() } /** + *

    Discounted price of the Line Item or Custom Line Item.

    + * * @return null|DiscountedLineItemPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php index acca3f4faf9..015766e5cd5 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php @@ -44,6 +44,8 @@ public function __construct( } /** + *

    Number of Line Items or Custom Line Items in the Cart.

    + * * * @return null|int */ @@ -62,6 +64,8 @@ public function getQuantity() } /** + *

    Discounted price of the Line Item or Custom Line Item.

    + * * * @return null|DiscountedLineItemPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php index 7f88c1fa09b..af1685a17db 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php @@ -46,6 +46,8 @@ public function __construct( } /** + *

    Money value of the discounted Line Item or Custom Line Item.

    + * * * @return null|TypedMoney */ @@ -65,6 +67,8 @@ public function getValue() } /** + *

    Discount applicable on the Line Item or Custom Line Item.

    + * * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php index c2dc425077b..9d08f04a9e1 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php @@ -18,12 +18,17 @@ interface ExternalLineItemTotalPrice extends JsonObject public const FIELD_TOTAL_PRICE = 'totalPrice'; /** + *

    Price of the Line Item.

    + *

    The value is selected from the Product Variant according to the Product priceMode.

    + * * @return null|Money */ public function getPrice(); /** + *

    Total price of the Line Item.

    + * * @return null|Money */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php index 9d1b175f0d5..09a5342fe8e 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php @@ -35,6 +35,9 @@ final class ExternalLineItemTotalPriceBuilder implements Builder private $totalPrice; /** + *

    Price of the Line Item.

    + *

    The value is selected from the Product Variant according to the Product priceMode.

    + * * @return null|Money */ @@ -44,6 +47,8 @@ public function getPrice() } /** + *

    Total price of the Line Item.

    + * * @return null|Money */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php index 4e79449aa9d..62a17abf2f9 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php @@ -46,6 +46,9 @@ public function __construct( } /** + *

    Price of the Line Item.

    + *

    The value is selected from the Product Variant according to the Product priceMode.

    + * * * @return null|Money */ @@ -65,6 +68,8 @@ public function getPrice() } /** + *

    Total price of the Line Item.

    + * * * @return null|Money */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php index a693ec35f20..c4a82e9f328 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php @@ -18,7 +18,7 @@ interface ExternalTaxAmountDraft extends JsonObject public const FIELD_TAX_RATE = 'taxRate'; /** - *

    The total gross amount of the item (totalNet + taxes).

    + *

    Total gross amount (totalNet + taxPortions) of the Line Item or Custom Line Item.

    * * @return null|Money @@ -26,6 +26,8 @@ interface ExternalTaxAmountDraft extends JsonObject public function getTotalGross(); /** + *

    Tax Rates and subrates of states and countries.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php index d7aea8449bc..19637d50e25 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php @@ -35,7 +35,7 @@ final class ExternalTaxAmountDraftBuilder implements Builder private $taxRate; /** - *

    The total gross amount of the item (totalNet + taxes).

    + *

    Total gross amount (totalNet + taxPortions) of the Line Item or Custom Line Item.

    * * @return null|Money @@ -46,6 +46,8 @@ public function getTotalGross() } /** + *

    Tax Rates and subrates of states and countries.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php index b2a5ef33e27..6e9806c05ab 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *

    The total gross amount of the item (totalNet + taxes).

    + *

    Total gross amount (totalNet + taxPortions) of the Line Item or Custom Line Item.

    * * * @return null|Money @@ -67,6 +67,8 @@ public function getTotalGross() } /** + *

    Tax Rates and subrates of states and countries.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php index 1df66f7cae6..6cd3687d768 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php @@ -16,22 +16,25 @@ interface ExternalTaxRateDraft extends JsonObject { public const FIELD_NAME = 'name'; public const FIELD_AMOUNT = 'amount'; + public const FIELD_INCLUDED_IN_PRICE = 'includedInPrice'; public const FIELD_COUNTRY = 'country'; public const FIELD_STATE = 'state'; public const FIELD_SUB_RATES = 'subRates'; - public const FIELD_INCLUDED_IN_PRICE = 'includedInPrice'; /** + *

    Name of the Tax Rate.

    + * * @return null|string */ public function getName(); /** - *

    Percentage in the range of [0..1]. - * Must be supplied if no subRates are specified. - * If subRates are specified - * then the amount can be omitted or it must be the sum of the amounts of all subRates.

    + *

    Percentage in the range of 0-1.

    + *
      + *
    • If no subRates are specified, a value must be defined.
    • + *
    • If subRates are specified, this can be omitted or its value must be the sum of all subRates amounts.
    • + *
    * * @return null|float @@ -39,38 +42,39 @@ public function getName(); public function getAmount(); /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *
      + *
    • If set to false, the related price is considered the net price and the provided amount is applied to calculate the gross price.
    • + *
    • If set to true, the related price is considered the gross price, and the provided amount is applied to calculate the net price.
    • + *
    * - * @return null|string + * @return null|bool */ - public function getCountry(); + public function getIncludedInPrice(); /** - *

    The state in the country

    + *

    Country for which the tax applies.

    * * @return null|string */ - public function getState(); + public function getCountry(); /** - *

    For countries (e.g. - * the US) where the total tax is a combination of multiple taxes (e.g. - * state and local taxes).

    + *

    State within the specified country.

    * - * @return null|SubRateCollection + * @return null|string */ - public function getSubRates(); + public function getState(); /** - *

    The default value for includedInPrice is FALSE.

    + *

    For countries (such as the US) where the total tax is a combination of multiple taxes (such as state and local taxes).

    * - * @return null|bool + * @return null|SubRateCollection */ - public function getIncludedInPrice(); + public function getSubRates(); /** * @param ?string $name @@ -82,6 +86,11 @@ public function setName(?string $name): void; */ public function setAmount(?float $amount): void; + /** + * @param ?bool $includedInPrice + */ + public function setIncludedInPrice(?bool $includedInPrice): void; + /** * @param ?string $country */ @@ -96,9 +105,4 @@ public function setState(?string $state): void; * @param ?SubRateCollection $subRates */ public function setSubRates(?SubRateCollection $subRates): void; - - /** - * @param ?bool $includedInPrice - */ - public function setIncludedInPrice(?bool $includedInPrice): void; } diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php index 39a945051a7..69cf781b021 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php @@ -33,6 +33,12 @@ final class ExternalTaxRateDraftBuilder implements Builder */ private $amount; + /** + + * @var ?bool + */ + private $includedInPrice; + /** * @var ?string @@ -52,12 +58,8 @@ final class ExternalTaxRateDraftBuilder implements Builder private $subRates; /** - - * @var ?bool - */ - private $includedInPrice; - - /** + *

    Name of the Tax Rate.

    + * * @return null|string */ @@ -67,10 +69,11 @@ public function getName() } /** - *

    Percentage in the range of [0..1]. - * Must be supplied if no subRates are specified. - * If subRates are specified - * then the amount can be omitted or it must be the sum of the amounts of all subRates.

    + *

    Percentage in the range of 0-1.

    + *
      + *
    • If no subRates are specified, a value must be defined.
    • + *
    • If subRates are specified, this can be omitted or its value must be the sum of all subRates amounts.
    • + *
    * * @return null|float @@ -81,7 +84,21 @@ public function getAmount() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *
      + *
    • If set to false, the related price is considered the net price and the provided amount is applied to calculate the gross price.
    • + *
    • If set to true, the related price is considered the gross price, and the provided amount is applied to calculate the net price.
    • + *
    + * + + * @return null|bool + */ + public function getIncludedInPrice() + { + return $this->includedInPrice; + } + + /** + *

    Country for which the tax applies.

    * * @return null|string @@ -92,7 +109,7 @@ public function getCountry() } /** - *

    The state in the country

    + *

    State within the specified country.

    * * @return null|string @@ -103,9 +120,7 @@ public function getState() } /** - *

    For countries (e.g. - * the US) where the total tax is a combination of multiple taxes (e.g. - * state and local taxes).

    + *

    For countries (such as the US) where the total tax is a combination of multiple taxes (such as state and local taxes).

    * * @return null|SubRateCollection @@ -115,17 +130,6 @@ public function getSubRates() return $this->subRates; } - /** - *

    The default value for includedInPrice is FALSE.

    - * - - * @return null|bool - */ - public function getIncludedInPrice() - { - return $this->includedInPrice; - } - /** * @param ?string $name * @return $this @@ -148,6 +152,17 @@ public function withAmount(?float $amount) return $this; } + /** + * @param ?bool $includedInPrice + * @return $this + */ + public function withIncludedInPrice(?bool $includedInPrice) + { + $this->includedInPrice = $includedInPrice; + + return $this; + } + /** * @param ?string $country * @return $this @@ -181,27 +196,16 @@ public function withSubRates(?SubRateCollection $subRates) return $this; } - /** - * @param ?bool $includedInPrice - * @return $this - */ - public function withIncludedInPrice(?bool $includedInPrice) - { - $this->includedInPrice = $includedInPrice; - - return $this; - } - public function build(): ExternalTaxRateDraft { return new ExternalTaxRateDraftModel( $this->name, $this->amount, + $this->includedInPrice, $this->country, $this->state, - $this->subRates, - $this->includedInPrice + $this->subRates ); } diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php index 842ac30f959..e7af1ca4b69 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php @@ -32,6 +32,12 @@ final class ExternalTaxRateDraftModel extends JsonObjectModel implements Externa */ protected $amount; + /** + * + * @var ?bool + */ + protected $includedInPrice; + /** * * @var ?string @@ -50,12 +56,6 @@ final class ExternalTaxRateDraftModel extends JsonObjectModel implements Externa */ protected $subRates; - /** - * - * @var ?bool - */ - protected $includedInPrice; - /** * @psalm-suppress MissingParamType @@ -63,20 +63,22 @@ final class ExternalTaxRateDraftModel extends JsonObjectModel implements Externa public function __construct( ?string $name = null, ?float $amount = null, + ?bool $includedInPrice = null, ?string $country = null, ?string $state = null, - ?SubRateCollection $subRates = null, - ?bool $includedInPrice = null + ?SubRateCollection $subRates = null ) { $this->name = $name; $this->amount = $amount; + $this->includedInPrice = $includedInPrice; $this->country = $country; $this->state = $state; $this->subRates = $subRates; - $this->includedInPrice = $includedInPrice; } /** + *

    Name of the Tax Rate.

    + * * * @return null|string */ @@ -95,10 +97,11 @@ public function getName() } /** - *

    Percentage in the range of [0..1]. - * Must be supplied if no subRates are specified. - * If subRates are specified - * then the amount can be omitted or it must be the sum of the amounts of all subRates.

    + *

    Percentage in the range of 0-1.

    + *
      + *
    • If no subRates are specified, a value must be defined.
    • + *
    • If subRates are specified, this can be omitted or its value must be the sum of all subRates amounts.
    • + *
    * * * @return null|float @@ -118,7 +121,30 @@ public function getAmount() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *
      + *
    • If set to false, the related price is considered the net price and the provided amount is applied to calculate the gross price.
    • + *
    • If set to true, the related price is considered the gross price, and the provided amount is applied to calculate the net price.
    • + *
    + * + * + * @return null|bool + */ + public function getIncludedInPrice() + { + if (is_null($this->includedInPrice)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INCLUDED_IN_PRICE); + if (is_null($data)) { + return null; + } + $this->includedInPrice = (bool) $data; + } + + return $this->includedInPrice; + } + + /** + *

    Country for which the tax applies.

    * * * @return null|string @@ -138,7 +164,7 @@ public function getCountry() } /** - *

    The state in the country

    + *

    State within the specified country.

    * * * @return null|string @@ -158,9 +184,7 @@ public function getState() } /** - *

    For countries (e.g. - * the US) where the total tax is a combination of multiple taxes (e.g. - * state and local taxes).

    + *

    For countries (such as the US) where the total tax is a combination of multiple taxes (such as state and local taxes).

    * * * @return null|SubRateCollection @@ -179,26 +203,6 @@ public function getSubRates() return $this->subRates; } - /** - *

    The default value for includedInPrice is FALSE.

    - * - * - * @return null|bool - */ - public function getIncludedInPrice() - { - if (is_null($this->includedInPrice)) { - /** @psalm-var ?bool $data */ - $data = $this->raw(self::FIELD_INCLUDED_IN_PRICE); - if (is_null($data)) { - return null; - } - $this->includedInPrice = (bool) $data; - } - - return $this->includedInPrice; - } - /** * @param ?string $name @@ -216,6 +220,14 @@ public function setAmount(?float $amount): void $this->amount = $amount; } + /** + * @param ?bool $includedInPrice + */ + public function setIncludedInPrice(?bool $includedInPrice): void + { + $this->includedInPrice = $includedInPrice; + } + /** * @param ?string $country */ @@ -239,12 +251,4 @@ public function setSubRates(?SubRateCollection $subRates): void { $this->subRates = $subRates; } - - /** - * @param ?bool $includedInPrice - */ - public function setIncludedInPrice(?bool $includedInPrice): void - { - $this->includedInPrice = $includedInPrice; - } } diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php index 03b23be5fbd..9a9f1448bc6 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php @@ -17,8 +17,7 @@ interface ItemShippingDetails extends JsonObject public const FIELD_VALID = 'valid'; /** - *

    Used to map what sub-quantity should be shipped to which address. - * Duplicate address keys are not allowed.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    * * @return null|ItemShippingTargetCollection @@ -26,8 +25,11 @@ interface ItemShippingDetails extends JsonObject public function getTargets(); /** - *

    true if the quantity of the Line Item or Custom Line Item is equal to the sum of the sub-quantities in targets, else it is false. - * Ordering a Cart with value as false returns an InvalidItemShippingDetails error.

    + *
      + *
    • true if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in targets.
    • + *
    • false if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in targets. + * Ordering a Cart when the value is false returns an InvalidItemShippingDetails error.
    • + *
    * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php index 08dccdcb5fe..3142c65d714 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php @@ -33,8 +33,7 @@ final class ItemShippingDetailsBuilder implements Builder private $valid; /** - *

    Used to map what sub-quantity should be shipped to which address. - * Duplicate address keys are not allowed.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    * * @return null|ItemShippingTargetCollection @@ -45,8 +44,11 @@ public function getTargets() } /** - *

    true if the quantity of the Line Item or Custom Line Item is equal to the sum of the sub-quantities in targets, else it is false. - * Ordering a Cart with value as false returns an InvalidItemShippingDetails error.

    + *
      + *
    • true if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in targets.
    • + *
    • false if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in targets. + * Ordering a Cart when the value is false returns an InvalidItemShippingDetails error.
    • + *
    * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php index 8f7aec48441..848cfb80a4c 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php @@ -16,10 +16,8 @@ interface ItemShippingDetailsDraft extends JsonObject public const FIELD_TARGETS = 'targets'; /** - *

    Used to capture one or more (custom) line item specific shipping addresses. - * By specifying sub-quantities, it is possible to set multiple shipping addresses for one line item. - * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. - * For the order creation and order updates the targets sum must match the quantity.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    + *

    If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified.

    * * @return null|ItemShippingTargetCollection diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php index 11a6834be20..7a27f8ccf34 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php @@ -27,10 +27,8 @@ final class ItemShippingDetailsDraftBuilder implements Builder private $targets; /** - *

    Used to capture one or more (custom) line item specific shipping addresses. - * By specifying sub-quantities, it is possible to set multiple shipping addresses for one line item. - * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. - * For the order creation and order updates the targets sum must match the quantity.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    + *

    If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified.

    * * @return null|ItemShippingTargetCollection diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php index a36ba85b9bb..e0f0586d7f5 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php @@ -36,10 +36,8 @@ public function __construct( } /** - *

    Used to capture one or more (custom) line item specific shipping addresses. - * By specifying sub-quantities, it is possible to set multiple shipping addresses for one line item. - * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. - * For the order creation and order updates the targets sum must match the quantity.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    + *

    If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified.

    * * * @return null|ItemShippingTargetCollection diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php index 2902345c9e9..93b779ed3a8 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php @@ -44,8 +44,7 @@ public function __construct( } /** - *

    Used to map what sub-quantity should be shipped to which address. - * Duplicate address keys are not allowed.

    + *

    Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

    * * * @return null|ItemShippingTargetCollection @@ -65,8 +64,11 @@ public function getTargets() } /** - *

    true if the quantity of the Line Item or Custom Line Item is equal to the sum of the sub-quantities in targets, else it is false. - * Ordering a Cart with value as false returns an InvalidItemShippingDetails error.

    + *
      + *
    • true if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in targets.
    • + *
    • false if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in targets. + * Ordering a Cart when the value is false returns an InvalidItemShippingDetails error.
    • + *
    * * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php index 070247fddc8..f01ac46b4fc 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php @@ -18,7 +18,8 @@ interface ItemShippingTarget extends JsonObject public const FIELD_SHIPPING_METHOD_KEY = 'shippingMethodKey'; /** - *

    The key of the address in the cart's itemShippingAddresses

    + *

    Key of the address in the Cart itemShippingAddresses. + * Duplicate address keys are not allowed.

    * * @return null|string @@ -26,9 +27,8 @@ interface ItemShippingTarget extends JsonObject public function getAddressKey(); /** - *

    The quantity of items that should go to the address with the specified addressKey. - * Only positive values are allowed. - * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    + *

    Quantity of Line Items or Custom Line Items shipped to the address with the specified addressKey.

    + *

    If a quantity is updated to 0 when defining ItemShippingDetailsDraft, the targets are removed from a Line Item or Custom Line Item in the resulting ItemShippingDetails.

    * * @return null|int diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php index 63403ab48b3..f74d26d8b2b 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php @@ -39,7 +39,8 @@ final class ItemShippingTargetBuilder implements Builder private $shippingMethodKey; /** - *

    The key of the address in the cart's itemShippingAddresses

    + *

    Key of the address in the Cart itemShippingAddresses. + * Duplicate address keys are not allowed.

    * * @return null|string @@ -50,9 +51,8 @@ public function getAddressKey() } /** - *

    The quantity of items that should go to the address with the specified addressKey. - * Only positive values are allowed. - * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    + *

    Quantity of Line Items or Custom Line Items shipped to the address with the specified addressKey.

    + *

    If a quantity is updated to 0 when defining ItemShippingDetailsDraft, the targets are removed from a Line Item or Custom Line Item in the resulting ItemShippingDetails.

    * * @return null|int diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php index e4857636bb7..9579c244ab4 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php @@ -52,7 +52,8 @@ public function __construct( } /** - *

    The key of the address in the cart's itemShippingAddresses

    + *

    Key of the address in the Cart itemShippingAddresses. + * Duplicate address keys are not allowed.

    * * * @return null|string @@ -72,9 +73,8 @@ public function getAddressKey() } /** - *

    The quantity of items that should go to the address with the specified addressKey. - * Only positive values are allowed. - * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    + *

    Quantity of Line Items or Custom Line Items shipped to the address with the specified addressKey.

    + *

    If a quantity is updated to 0 when defining ItemShippingDetailsDraft, the targets are removed from a Line Item or Custom Line Item in the resulting ItemShippingDetails.

    * * * @return null|int diff --git a/lib/commercetools-api/src/Models/Cart/LineItem.php b/lib/commercetools-api/src/Models/Cart/LineItem.php index d35c851cf5e..8562d9ab911 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItem.php +++ b/lib/commercetools-api/src/Models/Cart/LineItem.php @@ -9,9 +9,9 @@ namespace Commercetools\Api\Models\Cart; use Commercetools\Api\Models\Channel\ChannelReference; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\Price; -use Commercetools\Api\Models\Common\TypedMoney; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\Product\ProductVariant; use Commercetools\Api\Models\ProductType\ProductTypeReference; @@ -31,26 +31,26 @@ interface LineItem extends JsonObject public const FIELD_PRODUCT_TYPE = 'productType'; public const FIELD_VARIANT = 'variant'; public const FIELD_PRICE = 'price'; + public const FIELD_QUANTITY = 'quantity'; + public const FIELD_TOTAL_PRICE = 'totalPrice'; + public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TAXED_PRICE = 'taxedPrice'; public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions'; - public const FIELD_TOTAL_PRICE = 'totalPrice'; - public const FIELD_QUANTITY = 'quantity'; - public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_STATE = 'state'; public const FIELD_TAX_RATE = 'taxRate'; public const FIELD_PER_METHOD_TAX_RATE = 'perMethodTaxRate'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_PRICE_MODE = 'priceMode'; public const FIELD_LINE_ITEM_MODE = 'lineItemMode'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; + public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt'; /** - *

    Unique identifier of the LineItem.

    + *

    Unique identifier of the Line Item.

    * * @return null|string @@ -58,14 +58,21 @@ interface LineItem extends JsonObject public function getId(); /** + *

    id of the Product the Line Item is based on.

    + * * @return null|string */ public function getProductId(); /** - *

    User-defined unique identifier of the Product. - * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

    + *

    key of the Product.

    + *

    This field is only present on:

    + *
      + *
    • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
    • + *
    • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
    • + *
    + *

    Present on resources created or updated after 3 December 2021.

    * * @return null|string @@ -73,7 +80,7 @@ public function getProductId(); public function getProductKey(); /** - *

    The product name.

    + *

    Name of the Product.

    * * @return null|LocalizedString @@ -81,10 +88,8 @@ public function getProductKey(); public function getName(); /** - *

    The slug of a product is inserted on the fly. - * It is always up-to-date and can therefore be used to link to the product detail page of the product. - * It is empty if the product has been deleted. - * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

    + *

    slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. + * The productSlug field of LineItem is not expanded when using Reference Expansion.

    * * @return null|LocalizedString @@ -92,14 +97,17 @@ public function getName(); public function getProductSlug(); /** + *

    Product Type of the Product.

    + * * @return null|ProductTypeReference */ public function getProductType(); /** - *

    The variant data is saved when the variant is added to the cart, and not updated automatically. - * It can manually be updated with the Recalculate update action.

    + *

    Holds the data of the Product Variant added to the Cart.

    + *

    The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. + * Must be updated using the Recalculate update action.

    * * @return null|ProductVariant @@ -107,8 +115,7 @@ public function getProductType(); public function getVariant(); /** - *

    The price of a line item is selected from the product variant according to the Product's priceMode value. - * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    + *

    Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    * * @return null|Price @@ -116,59 +123,59 @@ public function getVariant(); public function getPrice(); /** - *

    Set once the taxRate is set.

    + *

    Number of Line Items of the given Product Variant present in the Cart.

    * - * @return null|TaxedItemPrice + * @return null|int */ - public function getTaxedPrice(); + public function getQuantity(); /** - *

    Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

    + *

    Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. + * Includes taxes if the TaxRate includedInPrice is true.

    * - * @return null|MethodTaxedPriceCollection + * @return null|CentPrecisionMoney */ - public function getTaxedPricePortions(); + public function getTotalPrice(); /** - *

    The total price of this line item. - * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. - * Otherwise the total price is the product price multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Discounted price of a single quantity of the Line Item.

    * - * @return null|TypedMoney + * @return null|DiscountedLineItemPriceForQuantityCollection */ - public function getTotalPrice(); + public function getDiscountedPricePerQuantity(); /** - *

    The amount of a LineItem in the cart. - * Must be a positive integer.

    + *

    Automatically set after taxRate is set.

    * - * @return null|int + * @return null|TaxedItemPrice */ - public function getQuantity(); + public function getTaxedPrice(); /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

    * - * @return null|DateTimeImmutable + * @return null|MethodTaxedPriceCollection */ - public function getAddedAt(); + public function getTaxedPricePortions(); /** + *

    State of the Line Item in the Cart.

    + * * @return null|ItemStateCollection */ public function getState(); /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * @return null|TaxRate @@ -176,8 +183,8 @@ public function getState(); public function getTaxRate(); /** - *

    Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

    - *

    For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    + *

    Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. + * For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    * * @return null|MethodTaxRateCollection @@ -185,9 +192,7 @@ public function getTaxRate(); public function getPerMethodTaxRate(); /** - *

    The supply channel identifies the inventory entries that should be reserved. - * The channel has - * the role InventorySupply.

    + *

    Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelReference @@ -195,8 +200,7 @@ public function getPerMethodTaxRate(); public function getSupplyChannel(); /** - *

    The distribution channel is used to select a ProductPrice. - * The channel has the role ProductDistribution.

    + *

    Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelReference @@ -204,50 +208,56 @@ public function getSupplyChannel(); public function getDistributionChannel(); /** + *

    Indicates how the Price for the Line Item is set.

    + * - * @return null|DiscountedLineItemPriceForQuantityCollection + * @return null|string */ - public function getDiscountedPricePerQuantity(); + public function getPriceMode(); /** + *

    Indicates how the Line Item is added to the Cart.

    + * * @return null|string */ - public function getPriceMode(); + public function getLineItemMode(); /** + *

    Inventory mode specific to this Line Item only, and valid for the entire quantity of the Line Item. + * Only present if the inventory mode is different from the inventoryMode specified on the Cart.

    + * * @return null|string */ - public function getLineItemMode(); + public function getInventoryMode(); /** + *

    Container for Line Item-specific addresses.

    + * - * @return null|CustomFields + * @return null|ItemShippingDetails */ - public function getCustom(); + public function getShippingDetails(); /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Only present if inventory mode is different from the inventoryMode specified on the Cart.

    + *

    Custom Fields of the Line Item.

    * - * @return null|string + * @return null|CustomFields */ - public function getInventoryMode(); + public function getCustom(); /** - *

    Container for line item specific address(es).

    + *

    Date and time (UTC) the Line Item was added to the Cart.

    * - * @return null|ItemShippingDetails + * @return null|DateTimeImmutable */ - public function getShippingDetails(); + public function getAddedAt(); /** - *

    The date when the LineItem was last modified by one of the following actions - * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. - * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

    + *

    Date and time (UTC) the Line Item was last updated.

    * * @return null|DateTimeImmutable @@ -295,29 +305,29 @@ public function setVariant(?ProductVariant $variant): void; public function setPrice(?Price $price): void; /** - * @param ?TaxedItemPrice $taxedPrice + * @param ?int $quantity */ - public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; + public function setQuantity(?int $quantity): void; /** - * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @param ?CentPrecisionMoney $totalPrice */ - public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void; /** - * @param ?TypedMoney $totalPrice + * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ - public function setTotalPrice(?TypedMoney $totalPrice): void; + public function setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity): void; /** - * @param ?int $quantity + * @param ?TaxedItemPrice $taxedPrice */ - public function setQuantity(?int $quantity): void; + public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; /** - * @param ?DateTimeImmutable $addedAt + * @param ?MethodTaxedPriceCollection $taxedPricePortions */ - public function setAddedAt(?DateTimeImmutable $addedAt): void; + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; /** * @param ?ItemStateCollection $state @@ -344,11 +354,6 @@ public function setSupplyChannel(?ChannelReference $supplyChannel): void; */ public function setDistributionChannel(?ChannelReference $distributionChannel): void; - /** - * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity - */ - public function setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity): void; - /** * @param ?string $priceMode */ @@ -359,11 +364,6 @@ public function setPriceMode(?string $priceMode): void; */ public function setLineItemMode(?string $lineItemMode): void; - /** - * @param ?CustomFields $custom - */ - public function setCustom(?CustomFields $custom): void; - /** * @param ?string $inventoryMode */ @@ -374,6 +374,16 @@ public function setInventoryMode(?string $inventoryMode): void; */ public function setShippingDetails(?ItemShippingDetails $shippingDetails): void; + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void; + + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void; + /** * @param ?DateTimeImmutable $lastModifiedAt */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php index b8d6fdf6b29..77e4f6676a7 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php @@ -10,12 +10,12 @@ use Commercetools\Api\Models\Channel\ChannelReference; use Commercetools\Api\Models\Channel\ChannelReferenceBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\Price; use Commercetools\Api\Models\Common\PriceBuilder; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\Product\ProductVariant; use Commercetools\Api\Models\Product\ProductVariantBuilder; @@ -88,33 +88,33 @@ final class LineItemBuilder implements Builder /** - * @var null|TaxedItemPrice|TaxedItemPriceBuilder + * @var ?int */ - private $taxedPrice; + private $quantity; /** - * @var ?MethodTaxedPriceCollection + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ - private $taxedPricePortions; + private $totalPrice; /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var ?DiscountedLineItemPriceForQuantityCollection */ - private $totalPrice; + private $discountedPricePerQuantity; /** - * @var ?int + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ - private $quantity; + private $taxedPrice; /** - * @var ?DateTimeImmutable + * @var ?MethodTaxedPriceCollection */ - private $addedAt; + private $taxedPricePortions; /** @@ -148,39 +148,39 @@ final class LineItemBuilder implements Builder /** - * @var ?DiscountedLineItemPriceForQuantityCollection + * @var ?string */ - private $discountedPricePerQuantity; + private $priceMode; /** * @var ?string */ - private $priceMode; + private $lineItemMode; /** * @var ?string */ - private $lineItemMode; + private $inventoryMode; /** - * @var null|CustomFields|CustomFieldsBuilder + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ - private $custom; + private $shippingDetails; /** - * @var ?string + * @var null|CustomFields|CustomFieldsBuilder */ - private $inventoryMode; + private $custom; /** - * @var null|ItemShippingDetails|ItemShippingDetailsBuilder + * @var ?DateTimeImmutable */ - private $shippingDetails; + private $addedAt; /** @@ -189,7 +189,7 @@ final class LineItemBuilder implements Builder private $lastModifiedAt; /** - *

    Unique identifier of the LineItem.

    + *

    Unique identifier of the Line Item.

    * * @return null|string @@ -200,6 +200,8 @@ public function getId() } /** + *

    id of the Product the Line Item is based on.

    + * * @return null|string */ @@ -209,8 +211,13 @@ public function getProductId() } /** - *

    User-defined unique identifier of the Product. - * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

    + *

    key of the Product.

    + *

    This field is only present on:

    + *
      + *
    • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
    • + *
    • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
    • + *
    + *

    Present on resources created or updated after 3 December 2021.

    * * @return null|string @@ -221,7 +228,7 @@ public function getProductKey() } /** - *

    The product name.

    + *

    Name of the Product.

    * * @return null|LocalizedString @@ -232,10 +239,8 @@ public function getName() } /** - *

    The slug of a product is inserted on the fly. - * It is always up-to-date and can therefore be used to link to the product detail page of the product. - * It is empty if the product has been deleted. - * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

    + *

    slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. + * The productSlug field of LineItem is not expanded when using Reference Expansion.

    * * @return null|LocalizedString @@ -246,6 +251,8 @@ public function getProductSlug() } /** + *

    Product Type of the Product.

    + * * @return null|ProductTypeReference */ @@ -255,8 +262,9 @@ public function getProductType() } /** - *

    The variant data is saved when the variant is added to the cart, and not updated automatically. - * It can manually be updated with the Recalculate update action.

    + *

    Holds the data of the Product Variant added to the Cart.

    + *

    The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. + * Must be updated using the Recalculate update action.

    * * @return null|ProductVariant @@ -267,8 +275,7 @@ public function getVariant() } /** - *

    The price of a line item is selected from the product variant according to the Product's priceMode value. - * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    + *

    Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    * * @return null|Price @@ -279,66 +286,64 @@ public function getPrice() } /** - *

    Set once the taxRate is set.

    + *

    Number of Line Items of the given Product Variant present in the Cart.

    * - * @return null|TaxedItemPrice + * @return null|int */ - public function getTaxedPrice() + public function getQuantity() { - return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; + return $this->quantity; } /** - *

    Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

    + *

    Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. + * Includes taxes if the TaxRate includedInPrice is true.

    * - * @return null|MethodTaxedPriceCollection + * @return null|CentPrecisionMoney */ - public function getTaxedPricePortions() + public function getTotalPrice() { - return $this->taxedPricePortions; + return $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; } /** - *

    The total price of this line item. - * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. - * Otherwise the total price is the product price multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Discounted price of a single quantity of the Line Item.

    * - * @return null|TypedMoney + * @return null|DiscountedLineItemPriceForQuantityCollection */ - public function getTotalPrice() + public function getDiscountedPricePerQuantity() { - return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; + return $this->discountedPricePerQuantity; } /** - *

    The amount of a LineItem in the cart. - * Must be a positive integer.

    + *

    Automatically set after taxRate is set.

    * - * @return null|int + * @return null|TaxedItemPrice */ - public function getQuantity() + public function getTaxedPrice() { - return $this->quantity; + return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

    * - * @return null|DateTimeImmutable + * @return null|MethodTaxedPriceCollection */ - public function getAddedAt() + public function getTaxedPricePortions() { - return $this->addedAt; + return $this->taxedPricePortions; } /** + *

    State of the Line Item in the Cart.

    + * * @return null|ItemStateCollection */ @@ -348,8 +353,10 @@ public function getState() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * @return null|TaxRate @@ -360,8 +367,8 @@ public function getTaxRate() } /** - *

    Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

    - *

    For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    + *

    Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. + * For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    * * @return null|MethodTaxRateCollection @@ -372,9 +379,7 @@ public function getPerMethodTaxRate() } /** - *

    The supply channel identifies the inventory entries that should be reserved. - * The channel has - * the role InventorySupply.

    + *

    Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelReference @@ -385,8 +390,7 @@ public function getSupplyChannel() } /** - *

    The distribution channel is used to select a ProductPrice. - * The channel has the role ProductDistribution.

    + *

    Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelReference @@ -397,68 +401,74 @@ public function getDistributionChannel() } /** + *

    Indicates how the Price for the Line Item is set.

    + * - * @return null|DiscountedLineItemPriceForQuantityCollection + * @return null|string */ - public function getDiscountedPricePerQuantity() + public function getPriceMode() { - return $this->discountedPricePerQuantity; + return $this->priceMode; } /** + *

    Indicates how the Line Item is added to the Cart.

    + * * @return null|string */ - public function getPriceMode() + public function getLineItemMode() { - return $this->priceMode; + return $this->lineItemMode; } /** + *

    Inventory mode specific to this Line Item only, and valid for the entire quantity of the Line Item. + * Only present if the inventory mode is different from the inventoryMode specified on the Cart.

    + * * @return null|string */ - public function getLineItemMode() + public function getInventoryMode() { - return $this->lineItemMode; + return $this->inventoryMode; } /** + *

    Container for Line Item-specific addresses.

    + * - * @return null|CustomFields + * @return null|ItemShippingDetails */ - public function getCustom() + public function getShippingDetails() { - return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + return $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Only present if inventory mode is different from the inventoryMode specified on the Cart.

    + *

    Custom Fields of the Line Item.

    * - * @return null|string + * @return null|CustomFields */ - public function getInventoryMode() + public function getCustom() { - return $this->inventoryMode; + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } /** - *

    Container for line item specific address(es).

    + *

    Date and time (UTC) the Line Item was added to the Cart.

    * - * @return null|ItemShippingDetails + * @return null|DateTimeImmutable */ - public function getShippingDetails() + public function getAddedAt() { - return $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails; + return $this->addedAt; } /** - *

    The date when the LineItem was last modified by one of the following actions - * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. - * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

    + *

    Date and time (UTC) the Line Item was last updated.

    * * @return null|DateTimeImmutable @@ -557,56 +567,56 @@ public function withPrice(?Price $price) } /** - * @param ?TaxedItemPrice $taxedPrice + * @param ?int $quantity * @return $this */ - public function withTaxedPrice(?TaxedItemPrice $taxedPrice) + public function withQuantity(?int $quantity) { - $this->taxedPrice = $taxedPrice; + $this->quantity = $quantity; return $this; } /** - * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @param ?CentPrecisionMoney $totalPrice * @return $this */ - public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) + public function withTotalPrice(?CentPrecisionMoney $totalPrice) { - $this->taxedPricePortions = $taxedPricePortions; + $this->totalPrice = $totalPrice; return $this; } /** - * @param ?TypedMoney $totalPrice + * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity * @return $this */ - public function withTotalPrice(?TypedMoney $totalPrice) + public function withDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity) { - $this->totalPrice = $totalPrice; + $this->discountedPricePerQuantity = $discountedPricePerQuantity; return $this; } /** - * @param ?int $quantity + * @param ?TaxedItemPrice $taxedPrice * @return $this */ - public function withQuantity(?int $quantity) + public function withTaxedPrice(?TaxedItemPrice $taxedPrice) { - $this->quantity = $quantity; + $this->taxedPrice = $taxedPrice; return $this; } /** - * @param ?DateTimeImmutable $addedAt + * @param ?MethodTaxedPriceCollection $taxedPricePortions * @return $this */ - public function withAddedAt(?DateTimeImmutable $addedAt) + public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) { - $this->addedAt = $addedAt; + $this->taxedPricePortions = $taxedPricePortions; return $this; } @@ -667,67 +677,67 @@ public function withDistributionChannel(?ChannelReference $distributionChannel) } /** - * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity + * @param ?string $priceMode * @return $this */ - public function withDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity) + public function withPriceMode(?string $priceMode) { - $this->discountedPricePerQuantity = $discountedPricePerQuantity; + $this->priceMode = $priceMode; return $this; } /** - * @param ?string $priceMode + * @param ?string $lineItemMode * @return $this */ - public function withPriceMode(?string $priceMode) + public function withLineItemMode(?string $lineItemMode) { - $this->priceMode = $priceMode; + $this->lineItemMode = $lineItemMode; return $this; } /** - * @param ?string $lineItemMode + * @param ?string $inventoryMode * @return $this */ - public function withLineItemMode(?string $lineItemMode) + public function withInventoryMode(?string $inventoryMode) { - $this->lineItemMode = $lineItemMode; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?CustomFields $custom + * @param ?ItemShippingDetails $shippingDetails * @return $this */ - public function withCustom(?CustomFields $custom) + public function withShippingDetails(?ItemShippingDetails $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @param ?string $inventoryMode + * @param ?CustomFields $custom * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withCustom(?CustomFields $custom) { - $this->inventoryMode = $inventoryMode; + $this->custom = $custom; return $this; } /** - * @param ?ItemShippingDetails $shippingDetails + * @param ?DateTimeImmutable $addedAt * @return $this */ - public function withShippingDetails(?ItemShippingDetails $shippingDetails) + public function withAddedAt(?DateTimeImmutable $addedAt) { - $this->shippingDetails = $shippingDetails; + $this->addedAt = $addedAt; return $this; } @@ -799,23 +809,23 @@ public function withPriceBuilder(?PriceBuilder $price) } /** - * @deprecated use withTaxedPrice() instead + * @deprecated use withTotalPrice() instead * @return $this */ - public function withTaxedPriceBuilder(?TaxedItemPriceBuilder $taxedPrice) + public function withTotalPriceBuilder(?CentPrecisionMoneyBuilder $totalPrice) { - $this->taxedPrice = $taxedPrice; + $this->totalPrice = $totalPrice; return $this; } /** - * @deprecated use withTotalPrice() instead + * @deprecated use withTaxedPrice() instead * @return $this */ - public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice) + public function withTaxedPriceBuilder(?TaxedItemPriceBuilder $taxedPrice) { - $this->totalPrice = $totalPrice; + $this->taxedPrice = $taxedPrice; return $this; } @@ -854,23 +864,23 @@ public function withDistributionChannelBuilder(?ChannelReferenceBuilder $distrib } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsBuilder $custom) + public function withShippingDetailsBuilder(?ItemShippingDetailsBuilder $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withShippingDetails() instead + * @deprecated use withCustom() instead * @return $this */ - public function withShippingDetailsBuilder(?ItemShippingDetailsBuilder $shippingDetails) + public function withCustomBuilder(?CustomFieldsBuilder $custom) { - $this->shippingDetails = $shippingDetails; + $this->custom = $custom; return $this; } @@ -886,22 +896,22 @@ public function build(): LineItem $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType, $this->variant instanceof ProductVariantBuilder ? $this->variant->build() : $this->variant, $this->price instanceof PriceBuilder ? $this->price->build() : $this->price, + $this->quantity, + $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, + $this->discountedPricePerQuantity, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, $this->taxedPricePortions, - $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, - $this->quantity, - $this->addedAt, $this->state, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, $this->perMethodTaxRate, $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->discountedPricePerQuantity, $this->priceMode, $this->lineItemMode, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addedAt, $this->lastModifiedAt ); } diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php index 33ba2a139ce..8a0afb10589 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php @@ -25,33 +25,39 @@ interface LineItemDraft extends JsonObject public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; /** + *

    id of the Product.

    + * * @return null|string */ public function getProductId(); /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * @return null|int */ public function getVariantId(); /** + *

    sku of the ProductVariant.

    + * * @return null|string */ public function getSku(); /** - *

    The amount of a LineItemin the cart. - * Must be a positive integer.

    + *

    Number of Product Variants to add to the Cart.

    * * @return null|int @@ -59,8 +65,9 @@ public function getSku(); public function getQuantity(); /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * @return null|DateTimeImmutable @@ -68,10 +75,8 @@ public function getQuantity(); public function getAddedAt(); /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have - * the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -79,8 +84,10 @@ public function getAddedAt(); public function getSupplyChannel(); /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * @return null|ChannelResourceIdentifier @@ -88,7 +95,7 @@ public function getSupplyChannel(); public function getDistributionChannel(); /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft @@ -96,15 +103,7 @@ public function getDistributionChannel(); public function getExternalTaxRate(); /** - *

    The custom fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom(); - - /** - *

    Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -112,7 +111,7 @@ public function getCustom(); public function getExternalPrice(); /** - *

    Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

    + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    * * @return null|ExternalLineItemTotalPrice @@ -120,8 +119,8 @@ public function getExternalPrice(); public function getExternalTotalPrice(); /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

    + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    * * @return null|string @@ -129,13 +128,21 @@ public function getExternalTotalPrice(); public function getInventoryMode(); /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); + /** + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + /** * @param ?string $productId */ @@ -176,11 +183,6 @@ public function setDistributionChannel(?ChannelResourceIdentifier $distributionC */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; - /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void; - /** * @param ?Money $externalPrice */ @@ -200,4 +202,9 @@ public function setInventoryMode(?string $inventoryMode): void; * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php index 3e361356675..fe3d13bda88 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php @@ -75,12 +75,6 @@ final class LineItemDraftBuilder implements Builder */ private $externalTaxRate; - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder - */ - private $custom; - /** * @var null|Money|MoneyBuilder @@ -107,6 +101,14 @@ final class LineItemDraftBuilder implements Builder /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

    id of the Product.

    + * + * @return null|string */ public function getProductId() @@ -115,6 +117,9 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * @return null|int */ @@ -124,6 +129,8 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + * * @return null|string */ @@ -133,8 +140,7 @@ public function getSku() } /** - *

    The amount of a LineItemin the cart. - * Must be a positive integer.

    + *

    Number of Product Variants to add to the Cart.

    * * @return null|int @@ -145,8 +151,9 @@ public function getQuantity() } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * @return null|DateTimeImmutable @@ -157,10 +164,8 @@ public function getAddedAt() } /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have - * the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -171,8 +176,10 @@ public function getSupplyChannel() } /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * @return null|ChannelResourceIdentifier @@ -183,7 +190,7 @@ public function getDistributionChannel() } /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft @@ -194,18 +201,7 @@ public function getExternalTaxRate() } /** - *

    The custom fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; - } - - /** - *

    Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -216,7 +212,7 @@ public function getExternalPrice() } /** - *

    Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

    + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    * * @return null|ExternalLineItemTotalPrice @@ -227,8 +223,8 @@ public function getExternalTotalPrice() } /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

    + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    * * @return null|string @@ -239,7 +235,7 @@ public function getInventoryMode() } /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft @@ -249,6 +245,17 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } + /** + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?string $productId * @return $this @@ -337,17 +344,6 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } - /** - * @param ?CustomFieldsDraft $custom - * @return $this - */ - public function withCustom(?CustomFieldsDraft $custom) - { - $this->custom = $custom; - - return $this; - } - /** * @param ?Money $externalPrice * @return $this @@ -392,6 +388,17 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) return $this; } + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withSupplyChannel() instead * @return $this @@ -425,17 +432,6 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa return $this; } - /** - * @deprecated use withCustom() instead - * @return $this - */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) - { - $this->custom = $custom; - - return $this; - } - /** * @deprecated use withExternalPrice() instead * @return $this @@ -469,6 +465,17 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): LineItemDraft { return new LineItemDraftModel( @@ -480,11 +487,11 @@ public function build(): LineItemDraft $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, $this->inventoryMode, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php index c5fdd3ac811..cc46e61bead 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php @@ -74,12 +74,6 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft */ protected $externalTaxRate; - /** - * - * @var ?CustomFieldsDraft - */ - protected $custom; - /** * * @var ?Money @@ -104,6 +98,12 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft */ protected $shippingDetails; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -117,11 +117,11 @@ public function __construct( ?ChannelResourceIdentifier $supplyChannel = null, ?ChannelResourceIdentifier $distributionChannel = null, ?ExternalTaxRateDraft $externalTaxRate = null, - ?CustomFieldsDraft $custom = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, ?string $inventoryMode = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?CustomFieldsDraft $custom = null ) { $this->productId = $productId; $this->variantId = $variantId; @@ -131,14 +131,16 @@ public function __construct( $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; $this->externalTaxRate = $externalTaxRate; - $this->custom = $custom; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; + $this->custom = $custom; } /** + *

    id of the Product.

    + * * * @return null|string */ @@ -157,6 +159,9 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * * @return null|int */ @@ -175,6 +180,8 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + * * * @return null|string */ @@ -193,8 +200,7 @@ public function getSku() } /** - *

    The amount of a LineItemin the cart. - * Must be a positive integer.

    + *

    Number of Product Variants to add to the Cart.

    * * * @return null|int @@ -214,8 +220,9 @@ public function getQuantity() } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * * @return null|DateTimeImmutable @@ -239,10 +246,8 @@ public function getAddedAt() } /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have - * the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier @@ -263,8 +268,10 @@ public function getSupplyChannel() } /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * * @return null|ChannelResourceIdentifier @@ -285,7 +292,7 @@ public function getDistributionChannel() } /** - *

    An external tax rate can be set if the cart has the External TaxMode.

    + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    * * * @return null|ExternalTaxRateDraft @@ -306,28 +313,7 @@ public function getExternalTaxRate() } /** - *

    The custom fields.

    - * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); - if (is_null($data)) { - return null; - } - - $this->custom = CustomFieldsDraftModel::of($data); - } - - return $this->custom; - } - - /** - *

    Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -348,7 +334,7 @@ public function getExternalPrice() } /** - *

    Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

    + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    * * * @return null|ExternalLineItemTotalPrice @@ -369,8 +355,8 @@ public function getExternalTotalPrice() } /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

    + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    * * * @return null|string @@ -390,7 +376,7 @@ public function getInventoryMode() } /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * * @return null|ItemShippingDetailsDraft @@ -410,6 +396,27 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *

    Custom Fields for the Line Item.

    + * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + /** * @param ?string $productId @@ -475,14 +482,6 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void $this->externalTaxRate = $externalTaxRate; } - /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void - { - $this->custom = $custom; - } - /** * @param ?Money $externalPrice */ @@ -515,6 +514,14 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): $this->shippingDetails = $shippingDetails; } + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Cart/LineItemModel.php b/lib/commercetools-api/src/Models/Cart/LineItemModel.php index 62d41b591fb..7ad8d86b1f2 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemModel.php @@ -10,12 +10,12 @@ use Commercetools\Api\Models\Channel\ChannelReference; use Commercetools\Api\Models\Channel\ChannelReferenceModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\Price; use Commercetools\Api\Models\Common\PriceModel; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\Product\ProductVariant; use Commercetools\Api\Models\Product\ProductVariantModel; @@ -87,33 +87,33 @@ final class LineItemModel extends JsonObjectModel implements LineItem /** * - * @var ?TaxedItemPrice + * @var ?int */ - protected $taxedPrice; + protected $quantity; /** * - * @var ?MethodTaxedPriceCollection + * @var ?CentPrecisionMoney */ - protected $taxedPricePortions; + protected $totalPrice; /** * - * @var ?TypedMoney + * @var ?DiscountedLineItemPriceForQuantityCollection */ - protected $totalPrice; + protected $discountedPricePerQuantity; /** * - * @var ?int + * @var ?TaxedItemPrice */ - protected $quantity; + protected $taxedPrice; /** * - * @var ?DateTimeImmutable + * @var ?MethodTaxedPriceCollection */ - protected $addedAt; + protected $taxedPricePortions; /** * @@ -147,39 +147,39 @@ final class LineItemModel extends JsonObjectModel implements LineItem /** * - * @var ?DiscountedLineItemPriceForQuantityCollection + * @var ?string */ - protected $discountedPricePerQuantity; + protected $priceMode; /** * * @var ?string */ - protected $priceMode; + protected $lineItemMode; /** * * @var ?string */ - protected $lineItemMode; + protected $inventoryMode; /** * - * @var ?CustomFields + * @var ?ItemShippingDetails */ - protected $custom; + protected $shippingDetails; /** * - * @var ?string + * @var ?CustomFields */ - protected $inventoryMode; + protected $custom; /** * - * @var ?ItemShippingDetails + * @var ?DateTimeImmutable */ - protected $shippingDetails; + protected $addedAt; /** * @@ -200,22 +200,22 @@ public function __construct( ?ProductTypeReference $productType = null, ?ProductVariant $variant = null, ?Price $price = null, + ?int $quantity = null, + ?CentPrecisionMoney $totalPrice = null, + ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?TaxedItemPrice $taxedPrice = null, ?MethodTaxedPriceCollection $taxedPricePortions = null, - ?TypedMoney $totalPrice = null, - ?int $quantity = null, - ?DateTimeImmutable $addedAt = null, ?ItemStateCollection $state = null, ?TaxRate $taxRate = null, ?MethodTaxRateCollection $perMethodTaxRate = null, ?ChannelReference $supplyChannel = null, ?ChannelReference $distributionChannel = null, - ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?string $priceMode = null, ?string $lineItemMode = null, - ?CustomFields $custom = null, ?string $inventoryMode = null, ?ItemShippingDetails $shippingDetails = null, + ?CustomFields $custom = null, + ?DateTimeImmutable $addedAt = null, ?DateTimeImmutable $lastModifiedAt = null ) { $this->id = $id; @@ -226,27 +226,27 @@ public function __construct( $this->productType = $productType; $this->variant = $variant; $this->price = $price; + $this->quantity = $quantity; + $this->totalPrice = $totalPrice; + $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->taxedPrice = $taxedPrice; $this->taxedPricePortions = $taxedPricePortions; - $this->totalPrice = $totalPrice; - $this->quantity = $quantity; - $this->addedAt = $addedAt; $this->state = $state; $this->taxRate = $taxRate; $this->perMethodTaxRate = $perMethodTaxRate; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->priceMode = $priceMode; $this->lineItemMode = $lineItemMode; - $this->custom = $custom; $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; + $this->custom = $custom; + $this->addedAt = $addedAt; $this->lastModifiedAt = $lastModifiedAt; } /** - *

    Unique identifier of the LineItem.

    + *

    Unique identifier of the Line Item.

    * * * @return null|string @@ -266,6 +266,8 @@ public function getId() } /** + *

    id of the Product the Line Item is based on.

    + * * * @return null|string */ @@ -284,8 +286,13 @@ public function getProductId() } /** - *

    User-defined unique identifier of the Product. - * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

    + *

    key of the Product.

    + *

    This field is only present on:

    + *
      + *
    • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
    • + *
    • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
    • + *
    + *

    Present on resources created or updated after 3 December 2021.

    * * * @return null|string @@ -305,7 +312,7 @@ public function getProductKey() } /** - *

    The product name.

    + *

    Name of the Product.

    * * * @return null|LocalizedString @@ -326,10 +333,8 @@ public function getName() } /** - *

    The slug of a product is inserted on the fly. - * It is always up-to-date and can therefore be used to link to the product detail page of the product. - * It is empty if the product has been deleted. - * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

    + *

    slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. + * The productSlug field of LineItem is not expanded when using Reference Expansion.

    * * * @return null|LocalizedString @@ -350,6 +355,8 @@ public function getProductSlug() } /** + *

    Product Type of the Product.

    + * * * @return null|ProductTypeReference */ @@ -369,8 +376,9 @@ public function getProductType() } /** - *

    The variant data is saved when the variant is added to the cart, and not updated automatically. - * It can manually be updated with the Recalculate update action.

    + *

    Holds the data of the Product Variant added to the Cart.

    + *

    The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. + * Must be updated using the Recalculate update action.

    * * * @return null|ProductVariant @@ -391,8 +399,7 @@ public function getVariant() } /** - *

    The price of a line item is selected from the product variant according to the Product's priceMode value. - * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    + *

    Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

    * * * @return null|Price @@ -413,117 +420,111 @@ public function getPrice() } /** - *

    Set once the taxRate is set.

    + *

    Number of Line Items of the given Product Variant present in the Cart.

    * * - * @return null|TaxedItemPrice + * @return null|int */ - public function getTaxedPrice() + public function getQuantity() { - if (is_null($this->taxedPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_TAXED_PRICE); + if (is_null($this->quantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_QUANTITY); if (is_null($data)) { return null; } - - $this->taxedPrice = TaxedItemPriceModel::of($data); + $this->quantity = (int) $data; } - return $this->taxedPrice; + return $this->quantity; } /** - *

    Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

    + *

    Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. + * Includes taxes if the TaxRate includedInPrice is true.

    * * - * @return null|MethodTaxedPriceCollection + * @return null|CentPrecisionMoney */ - public function getTaxedPricePortions() + public function getTotalPrice() { - if (is_null($this->taxedPricePortions)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); + if (is_null($this->totalPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TOTAL_PRICE); if (is_null($data)) { return null; } - $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); + + $this->totalPrice = CentPrecisionMoneyModel::of($data); } - return $this->taxedPricePortions; + return $this->totalPrice; } /** - *

    The total price of this line item. - * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. - * Otherwise the total price is the product price multiplied by the quantity. - * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

    + *

    Discounted price of a single quantity of the Line Item.

    * * - * @return null|TypedMoney + * @return null|DiscountedLineItemPriceForQuantityCollection */ - public function getTotalPrice() + public function getDiscountedPricePerQuantity() { - if (is_null($this->totalPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_TOTAL_PRICE); + if (is_null($this->discountedPricePerQuantity)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNTED_PRICE_PER_QUANTITY); if (is_null($data)) { return null; } - - $this->totalPrice = TypedMoneyModel::of($data); + $this->discountedPricePerQuantity = DiscountedLineItemPriceForQuantityCollection::fromArray($data); } - return $this->totalPrice; + return $this->discountedPricePerQuantity; } /** - *

    The amount of a LineItem in the cart. - * Must be a positive integer.

    + *

    Automatically set after taxRate is set.

    * * - * @return null|int + * @return null|TaxedItemPrice */ - public function getQuantity() + public function getTaxedPrice() { - if (is_null($this->quantity)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_QUANTITY); + if (is_null($this->taxedPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE); if (is_null($data)) { return null; } - $this->quantity = (int) $data; + + $this->taxedPrice = TaxedItemPriceModel::of($data); } - return $this->quantity; + return $this->taxedPrice; } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

    * * - * @return null|DateTimeImmutable + * @return null|MethodTaxedPriceCollection */ - public function getAddedAt() + public function getTaxedPricePortions() { - if (is_null($this->addedAt)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ADDED_AT); + if (is_null($this->taxedPricePortions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); if (is_null($data)) { return null; } - $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); - if (false === $data) { - return null; - } - $this->addedAt = $data; + $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); } - return $this->addedAt; + return $this->taxedPricePortions; } /** + *

    State of the Line Item in the Cart.

    + * * * @return null|ItemStateCollection */ @@ -542,8 +543,10 @@ public function getState() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *
      + *
    • For a Cart with Platform TaxMode, the taxRate of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address.
    • + *
    • For a Cart with External TaxMode, the taxRate of Line Items can be set using ExternalTaxRateDraft.
    • + *
    * * * @return null|TaxRate @@ -564,8 +567,8 @@ public function getTaxRate() } /** - *

    Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

    - *

    For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    + *

    Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. + * For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

    * * * @return null|MethodTaxRateCollection @@ -585,9 +588,7 @@ public function getPerMethodTaxRate() } /** - *

    The supply channel identifies the inventory entries that should be reserved. - * The channel has - * the role InventorySupply.

    + *

    Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelReference @@ -608,8 +609,7 @@ public function getSupplyChannel() } /** - *

    The distribution channel is used to select a ProductPrice. - * The channel has the role ProductDistribution.

    + *

    Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.

    * * * @return null|ChannelReference @@ -630,24 +630,8 @@ public function getDistributionChannel() } /** + *

    Indicates how the Price for the Line Item is set.

    * - * @return null|DiscountedLineItemPriceForQuantityCollection - */ - public function getDiscountedPricePerQuantity() - { - if (is_null($this->discountedPricePerQuantity)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_DISCOUNTED_PRICE_PER_QUANTITY); - if (is_null($data)) { - return null; - } - $this->discountedPricePerQuantity = DiscountedLineItemPriceForQuantityCollection::fromArray($data); - } - - return $this->discountedPricePerQuantity; - } - - /** * * @return null|string */ @@ -666,6 +650,8 @@ public function getPriceMode() } /** + *

    Indicates how the Line Item is added to the Cart.

    + * * * @return null|string */ @@ -684,27 +670,8 @@ public function getLineItemMode() } /** - * - * @return null|CustomFields - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); - if (is_null($data)) { - return null; - } - - $this->custom = CustomFieldsModel::of($data); - } - - return $this->custom; - } - - /** - *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Only present if inventory mode is different from the inventoryMode specified on the Cart.

    + *

    Inventory mode specific to this Line Item only, and valid for the entire quantity of the Line Item. + * Only present if the inventory mode is different from the inventoryMode specified on the Cart.

    * * * @return null|string @@ -724,7 +691,7 @@ public function getInventoryMode() } /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * * @return null|ItemShippingDetails @@ -745,9 +712,52 @@ public function getShippingDetails() } /** - *

    The date when the LineItem was last modified by one of the following actions - * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. - * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

    + *

    Custom Fields of the Line Item.

    + * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

    Date and time (UTC) the Line Item was added to the Cart.

    + * + * + * @return null|DateTimeImmutable + */ + public function getAddedAt() + { + if (is_null($this->addedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->addedAt = $data; + } + + return $this->addedAt; + } + + /** + *

    Date and time (UTC) the Line Item was last updated.

    * * * @return null|DateTimeImmutable @@ -836,43 +846,43 @@ public function setPrice(?Price $price): void } /** - * @param ?TaxedItemPrice $taxedPrice + * @param ?int $quantity */ - public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void + public function setQuantity(?int $quantity): void { - $this->taxedPrice = $taxedPrice; + $this->quantity = $quantity; } /** - * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @param ?CentPrecisionMoney $totalPrice */ - public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void + public function setTotalPrice(?CentPrecisionMoney $totalPrice): void { - $this->taxedPricePortions = $taxedPricePortions; + $this->totalPrice = $totalPrice; } /** - * @param ?TypedMoney $totalPrice + * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ - public function setTotalPrice(?TypedMoney $totalPrice): void + public function setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity): void { - $this->totalPrice = $totalPrice; + $this->discountedPricePerQuantity = $discountedPricePerQuantity; } /** - * @param ?int $quantity + * @param ?TaxedItemPrice $taxedPrice */ - public function setQuantity(?int $quantity): void + public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void { - $this->quantity = $quantity; + $this->taxedPrice = $taxedPrice; } /** - * @param ?DateTimeImmutable $addedAt + * @param ?MethodTaxedPriceCollection $taxedPricePortions */ - public function setAddedAt(?DateTimeImmutable $addedAt): void + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void { - $this->addedAt = $addedAt; + $this->taxedPricePortions = $taxedPricePortions; } /** @@ -915,14 +925,6 @@ public function setDistributionChannel(?ChannelReference $distributionChannel): $this->distributionChannel = $distributionChannel; } - /** - * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity - */ - public function setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity): void - { - $this->discountedPricePerQuantity = $discountedPricePerQuantity; - } - /** * @param ?string $priceMode */ @@ -939,14 +941,6 @@ public function setLineItemMode(?string $lineItemMode): void $this->lineItemMode = $lineItemMode; } - /** - * @param ?CustomFields $custom - */ - public function setCustom(?CustomFields $custom): void - { - $this->custom = $custom; - } - /** * @param ?string $inventoryMode */ @@ -963,6 +957,22 @@ public function setShippingDetails(?ItemShippingDetails $shippingDetails): void $this->shippingDetails = $shippingDetails; } + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void + { + $this->addedAt = $addedAt; + } + /** * @param ?DateTimeImmutable $lastModifiedAt */ diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php index ce2d37fa056..09ca6377ba0 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php @@ -18,13 +18,15 @@ interface ReplicaCartDraft extends JsonObject public const FIELD_KEY = 'key'; /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|mixed */ public function getReference(); /** - *

    User-specific unique identifier of the cart.

    + *

    User-defined unique identifier for the Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php index eab032bac96..9fbfbd42176 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php @@ -33,6 +33,8 @@ final class ReplicaCartDraftBuilder implements Builder private $key; /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|JsonObject */ @@ -42,7 +44,7 @@ public function getReference() } /** - *

    User-specific unique identifier of the cart.

    + *

    User-defined unique identifier for the Cart.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php index 332afa6dd94..f075028e3d9 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php @@ -46,6 +46,8 @@ public function __construct( } /** + *

    Reference to a Cart or Order that is replicated.

    + * * * @return ?mixed */ @@ -64,7 +66,7 @@ public function getReference() } /** - *

    User-specific unique identifier of the cart.

    + *

    User-defined unique identifier for the Cart.

    * * * @return null|string @@ -84,6 +86,8 @@ public function getKey() } /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|CartReference */ public function getReferenceAsCartReference() @@ -98,6 +102,8 @@ public function getReferenceAsCartReference() } /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|OrderReference */ public function getReferenceAsOrderReference() diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php index 5a6174bf153..b83f4082a83 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php @@ -16,6 +16,8 @@ interface ScoreShippingRateInput extends ShippingRateInput public const FIELD_SCORE = 'score'; /** + *

    Abstract value for categorizing a Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php index f6e6b3778b5..0b6dfbb50f0 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php @@ -27,6 +27,8 @@ final class ScoreShippingRateInputBuilder implements Builder private $score; /** + *

    Abstract value for categorizing a Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php index 7cc0fc10815..5f612b3eeee 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php @@ -16,6 +16,8 @@ interface ScoreShippingRateInputDraft extends ShippingRateInputDraft public const FIELD_SCORE = 'score'; /** + *

    Abstract value for categorizing a Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php index 8c2e2cf8b58..eef0698179e 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php @@ -27,6 +27,8 @@ final class ScoreShippingRateInputDraftBuilder implements Builder private $score; /** + *

    Abstract value for categorizing a Cart.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php index 1221b1112f9..b7165c551ab 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php @@ -63,6 +63,8 @@ public function getType() } /** + *

    Abstract value for categorizing a Cart.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php index ae98d05d4e1..690b3d41eed 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php @@ -63,6 +63,8 @@ public function getType() } /** + *

    Abstract value for categorizing a Cart.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Cart/Shipping.php b/lib/commercetools-api/src/Models/Cart/Shipping.php index 121d27fef2e..9f60e9c5223 100644 --- a/lib/commercetools-api/src/Models/Cart/Shipping.php +++ b/lib/commercetools-api/src/Models/Cart/Shipping.php @@ -22,7 +22,7 @@ interface Shipping extends JsonObject public const FIELD_SHIPPING_CUSTOM_FIELDS = 'shippingCustomFields'; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping in a Cart with Multiple ShippingMode.

    * * @return null|string @@ -38,7 +38,7 @@ public function getShippingKey(); public function getShippingInfo(); /** - *

    Determines the shipping rates and Tax Rates of the associated Line Item quantities.

    + *

    Determines the shipping rates and Tax Rates of associated Line Items.

    * * @return null|Address @@ -46,10 +46,12 @@ public function getShippingInfo(); public function getShippingAddress(); /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * * diff --git a/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php index 5d4772ca324..f7c3e6d5043 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php @@ -55,7 +55,7 @@ final class ShippingBuilder implements Builder private $shippingCustomFields; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping in a Cart with Multiple ShippingMode.

    * * @return null|string @@ -77,7 +77,7 @@ public function getShippingInfo() } /** - *

    Determines the shipping rates and Tax Rates of the associated Line Item quantities.

    + *

    Determines the shipping rates and Tax Rates of associated Line Items.

    * * @return null|Address @@ -88,10 +88,12 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * * diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraft.php b/lib/commercetools-api/src/Models/Cart/ShippingDraft.php index adc925fc2fe..6f174e2c6f4 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraft.php @@ -9,8 +9,9 @@ namespace Commercetools\Api\Models\Cart; use Commercetools\Api\Models\Common\BaseAddress; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -25,7 +26,7 @@ interface ShippingDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

    * * @return null|string @@ -49,12 +50,13 @@ public function getShippingMethod(); public function getShippingAddress(); /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -65,15 +67,15 @@ public function getShippingRateInput(); *

    Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** - *

    Holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries(); @@ -81,7 +83,7 @@ public function getDeliveries(); *

    Custom Fields for Shipping.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -106,17 +108,17 @@ public function setShippingAddress(?BaseAddress $shippingAddress): void; public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void; + public function setDeliveries(?DeliveryDraftCollection $deliveries): void; /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php index 0fea58d858b..f997aac4784 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php @@ -10,9 +10,11 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -51,24 +53,24 @@ final class ShippingDraftBuilder implements Builder /** - * @var ?string + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ private $deliveries; /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

    * * @return null|string @@ -101,12 +103,13 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * @return null|ShippingRateInputDraft @@ -120,18 +123,18 @@ public function getShippingRateInput() *

    Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

    * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { - return $this->externalTaxRate; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - *

    Holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the Shipping Method.

    * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -142,11 +145,11 @@ public function getDeliveries() *

    Custom Fields for Shipping.

    * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { - return $this->custom; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -194,10 +197,10 @@ public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withExternalTaxRate(?string $externalTaxRate) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { $this->externalTaxRate = $externalTaxRate; @@ -205,10 +208,10 @@ public function withExternalTaxRate(?string $externalTaxRate) } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries * @return $this */ - public function withDeliveries(?DeliveryCollection $deliveries) + public function withDeliveries(?DeliveryDraftCollection $deliveries) { $this->deliveries = $deliveries; @@ -216,10 +219,10 @@ public function withDeliveries(?DeliveryCollection $deliveries) } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withCustom(?string $custom) + public function withCustom(?CustomFieldsDraft $custom) { $this->custom = $custom; @@ -259,6 +262,28 @@ public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shi return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): ShippingDraft { return new ShippingDraftModel( @@ -266,9 +291,9 @@ public function build(): ShippingDraft $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod, $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, - $this->externalTaxRate, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->deliveries, - $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php index 4fcd30537d3..48cdce125ee 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php @@ -10,9 +10,11 @@ use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressModel; -use Commercetools\Api\Models\Order\DeliveryCollection; +use Commercetools\Api\Models\Order\DeliveryDraftCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -50,19 +52,19 @@ final class ShippingDraftModel extends JsonObjectModel implements ShippingDraft /** * - * @var ?string + * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** * - * @var ?DeliveryCollection + * @var ?DeliveryDraftCollection */ protected $deliveries; /** * - * @var ?string + * @var ?CustomFieldsDraft */ protected $custom; @@ -75,9 +77,9 @@ public function __construct( ?ShippingMethodReference $shippingMethod = null, ?BaseAddress $shippingAddress = null, ?ShippingRateInputDraft $shippingRateInput = null, - ?string $externalTaxRate = null, - ?DeliveryCollection $deliveries = null, - ?string $custom = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?DeliveryDraftCollection $deliveries = null, + ?CustomFieldsDraft $custom = null ) { $this->key = $key; $this->shippingMethod = $shippingMethod; @@ -89,7 +91,7 @@ public function __construct( } /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

    * * * @return null|string @@ -151,12 +153,13 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * - *

    The shippingRateInput cannot be set on the Cart if CartValueType is defined.

    * * * @return null|ShippingRateInputDraft @@ -180,27 +183,28 @@ public function getShippingRateInput() *

    Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

    * * - * @return null|string + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() { if (is_null($this->externalTaxRate)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->externalTaxRate = (string) $data; + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } return $this->externalTaxRate; } /** - *

    Holds information on how items are delivered to customers.

    + *

    Deliveries to be shipped with the Shipping Method.

    * * - * @return null|DeliveryCollection + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -210,7 +214,7 @@ public function getDeliveries() if (is_null($data)) { return null; } - $this->deliveries = DeliveryCollection::fromArray($data); + $this->deliveries = DeliveryDraftCollection::fromArray($data); } return $this->deliveries; @@ -220,17 +224,18 @@ public function getDeliveries() *

    Custom Fields for Shipping.

    * * - * @return null|string + * @return null|CustomFieldsDraft */ public function getCustom() { if (is_null($this->custom)) { - /** @psalm-var ?string $data */ + /** @psalm-var stdClass|array|null $data */ $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->custom = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } return $this->custom; @@ -270,25 +275,25 @@ public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput) } /** - * @param ?string $externalTaxRate + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setExternalTaxRate(?string $externalTaxRate): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void + public function setDeliveries(?DeliveryDraftCollection $deliveries): void { $this->deliveries = $deliveries; } /** - * @param ?string $custom + * @param ?CustomFieldsDraft $custom */ - public function setCustom(?string $custom): void + public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfo.php b/lib/commercetools-api/src/Models/Cart/ShippingInfo.php index 33a4043070a..3f94401db8e 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfo.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfo.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Order\DeliveryCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; use Commercetools\Api\Models\ShippingMethod\ShippingRate; @@ -31,21 +31,23 @@ interface ShippingInfo extends JsonObject public const FIELD_SHIPPING_METHOD_STATE = 'shippingMethodState'; /** + *

    Name of the Shipping Method.

    + * * @return null|string */ public function getShippingMethodName(); /** - *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    + *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getPrice(); /** - *

    The shipping rate used to determine the price.

    + *

    Used to determine the price.

    * * @return null|ShippingRate @@ -53,7 +55,7 @@ public function getPrice(); public function getShippingRate(); /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * @return null|TaxedItemPrice @@ -61,8 +63,8 @@ public function getShippingRate(); public function getTaxedPrice(); /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *

    Automatically set in the Platform TaxMode after the shipping address is set.

    + *

    For the External TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.

    * * @return null|TaxRate @@ -70,13 +72,15 @@ public function getTaxedPrice(); public function getTaxRate(); /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * @return null|TaxCategoryReference */ public function getTaxCategory(); /** - *

    Not set if custom shipping method is used.

    + *

    Not set if a custom Shipping Method is used.

    * * @return null|ShippingMethodReference @@ -84,7 +88,7 @@ public function getTaxCategory(); public function getShippingMethod(); /** - *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    + *

    Information on how items are delivered to customers.

    * * @return null|DeliveryCollection @@ -92,13 +96,15 @@ public function getShippingMethod(); public function getDeliveries(); /** + *

    Discounted price of the Shipping Method.

    + * * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice(); /** - *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

    + *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.

    * * @return null|string @@ -111,9 +117,9 @@ public function getShippingMethodState(); public function setShippingMethodName(?string $shippingMethodName): void; /** - * @param ?TypedMoney $price + * @param ?CentPrecisionMoney $price */ - public function setPrice(?TypedMoney $price): void; + public function setPrice(?CentPrecisionMoney $price): void; /** * @param ?ShippingRate $shippingRate diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php index 40da58fbae1..57c66db20ba 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Order\DeliveryCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder; @@ -39,7 +39,7 @@ final class ShippingInfoBuilder implements Builder /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $price; @@ -92,6 +92,8 @@ final class ShippingInfoBuilder implements Builder private $shippingMethodState; /** + *

    Name of the Shipping Method.

    + * * @return null|string */ @@ -101,18 +103,18 @@ public function getShippingMethodName() } /** - *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    + *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getPrice() { - return $this->price instanceof TypedMoneyBuilder ? $this->price->build() : $this->price; + return $this->price instanceof CentPrecisionMoneyBuilder ? $this->price->build() : $this->price; } /** - *

    The shipping rate used to determine the price.

    + *

    Used to determine the price.

    * * @return null|ShippingRate @@ -123,7 +125,7 @@ public function getShippingRate() } /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * @return null|TaxedItemPrice @@ -134,8 +136,8 @@ public function getTaxedPrice() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *

    Automatically set in the Platform TaxMode after the shipping address is set.

    + *

    For the External TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.

    * * @return null|TaxRate @@ -146,6 +148,8 @@ public function getTaxRate() } /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * @return null|TaxCategoryReference */ @@ -155,7 +159,7 @@ public function getTaxCategory() } /** - *

    Not set if custom shipping method is used.

    + *

    Not set if a custom Shipping Method is used.

    * * @return null|ShippingMethodReference @@ -166,7 +170,7 @@ public function getShippingMethod() } /** - *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    + *

    Information on how items are delivered to customers.

    * * @return null|DeliveryCollection @@ -177,6 +181,8 @@ public function getDeliveries() } /** + *

    Discounted price of the Shipping Method.

    + * * @return null|DiscountedLineItemPrice */ @@ -186,7 +192,7 @@ public function getDiscountedPrice() } /** - *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

    + *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.

    * * @return null|string @@ -208,10 +214,10 @@ public function withShippingMethodName(?string $shippingMethodName) } /** - * @param ?TypedMoney $price + * @param ?CentPrecisionMoney $price * @return $this */ - public function withPrice(?TypedMoney $price) + public function withPrice(?CentPrecisionMoney $price) { $this->price = $price; @@ -310,7 +316,7 @@ public function withShippingMethodState(?string $shippingMethodState) * @deprecated use withPrice() instead * @return $this */ - public function withPriceBuilder(?TypedMoneyBuilder $price) + public function withPriceBuilder(?CentPrecisionMoneyBuilder $price) { $this->price = $price; @@ -387,7 +393,7 @@ public function build(): ShippingInfo { return new ShippingInfoModel( $this->shippingMethodName, - $this->price instanceof TypedMoneyBuilder ? $this->price->build() : $this->price, + $this->price instanceof CentPrecisionMoneyBuilder ? $this->price->build() : $this->price, $this->shippingRate instanceof ShippingRateBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php b/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php index 89853689ec5..a5d5fbfaf54 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Order\DeliveryCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReference; use Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceModel; @@ -38,7 +38,7 @@ final class ShippingInfoModel extends JsonObjectModel implements ShippingInfo /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $price; @@ -96,7 +96,7 @@ final class ShippingInfoModel extends JsonObjectModel implements ShippingInfo */ public function __construct( ?string $shippingMethodName = null, - ?TypedMoney $price = null, + ?CentPrecisionMoney $price = null, ?ShippingRate $shippingRate = null, ?TaxedItemPrice $taxedPrice = null, ?TaxRate $taxRate = null, @@ -119,6 +119,8 @@ public function __construct( } /** + *

    Name of the Shipping Method.

    + * * * @return null|string */ @@ -137,10 +139,10 @@ public function getShippingMethodName() } /** - *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    + *

    Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getPrice() { @@ -151,14 +153,14 @@ public function getPrice() return null; } - $this->price = TypedMoneyModel::of($data); + $this->price = CentPrecisionMoneyModel::of($data); } return $this->price; } /** - *

    The shipping rate used to determine the price.

    + *

    Used to determine the price.

    * * * @return null|ShippingRate @@ -179,7 +181,7 @@ public function getShippingRate() } /** - *

    Set once the taxRate is set.

    + *

    Automatically set after the taxRate is set.

    * * * @return null|TaxedItemPrice @@ -200,8 +202,8 @@ public function getTaxedPrice() } /** - *

    Will be set automatically in the Platform TaxMode once the shipping address is set is set. - * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

    + *

    Automatically set in the Platform TaxMode after the shipping address is set.

    + *

    For the External TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.

    * * * @return null|TaxRate @@ -222,6 +224,8 @@ public function getTaxRate() } /** + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode.

    + * * * @return null|TaxCategoryReference */ @@ -241,7 +245,7 @@ public function getTaxCategory() } /** - *

    Not set if custom shipping method is used.

    + *

    Not set if a custom Shipping Method is used.

    * * * @return null|ShippingMethodReference @@ -262,7 +266,7 @@ public function getShippingMethod() } /** - *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    + *

    Information on how items are delivered to customers.

    * * * @return null|DeliveryCollection @@ -282,6 +286,8 @@ public function getDeliveries() } /** + *

    Discounted price of the Shipping Method.

    + * * * @return null|DiscountedLineItemPrice */ @@ -301,7 +307,7 @@ public function getDiscountedPrice() } /** - *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

    + *

    Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.

    * * * @return null|string @@ -330,9 +336,9 @@ public function setShippingMethodName(?string $shippingMethodName): void } /** - * @param ?TypedMoney $price + * @param ?CentPrecisionMoney $price */ - public function setPrice(?TypedMoney $price): void + public function setPrice(?CentPrecisionMoney $price): void { $this->price = $price; } diff --git a/lib/commercetools-api/src/Models/Cart/ShippingModel.php b/lib/commercetools-api/src/Models/Cart/ShippingModel.php index 22923d095f9..23e56b29ace 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingModel.php @@ -72,7 +72,7 @@ public function __construct( } /** - *

    User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

    + *

    User-defined unique identifier of the Shipping in a Cart with Multiple ShippingMode.

    * * * @return null|string @@ -113,7 +113,7 @@ public function getShippingInfo() } /** - *

    Determines the shipping rates and Tax Rates of the associated Line Item quantities.

    + *

    Determines the shipping rates and Tax Rates of associated Line Items.

    * * * @return null|Address @@ -134,10 +134,12 @@ public function getShippingAddress() } /** - *

    Used as an input to select a ShippingRatePriceTier.

    + *

    Used as an input to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    * * * diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortion.php b/lib/commercetools-api/src/Models/Cart/TaxPortion.php index 83ebb9187f3..cb4d81c7f2b 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortion.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortion.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,13 +19,15 @@ interface TaxPortion extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + *

    Name of the tax portion.

    + * * @return null|string */ public function getName(); /** - *

    A number in the range [0..1]

    + *

    A number in the range 0-1.

    * * @return null|float @@ -33,8 +35,10 @@ public function getName(); public function getRate(); /** + *

    Money value of the tax portion.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getAmount(); @@ -49,7 +53,7 @@ public function setName(?string $name): void; public function setRate(?float $rate): void; /** - * @param ?TypedMoney $amount + * @param ?CentPrecisionMoney $amount */ - public function setAmount(?TypedMoney $amount): void; + public function setAmount(?CentPrecisionMoney $amount): void; } diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php index 17374eb0d1e..badd6011890 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -36,11 +36,13 @@ final class TaxPortionBuilder implements Builder /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $amount; /** + *

    Name of the tax portion.

    + * * @return null|string */ @@ -50,7 +52,7 @@ public function getName() } /** - *

    A number in the range [0..1]

    + *

    A number in the range 0-1.

    * * @return null|float @@ -61,12 +63,14 @@ public function getRate() } /** + *

    Money value of the tax portion.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getAmount() { - return $this->amount instanceof TypedMoneyBuilder ? $this->amount->build() : $this->amount; + return $this->amount instanceof CentPrecisionMoneyBuilder ? $this->amount->build() : $this->amount; } /** @@ -92,10 +96,10 @@ public function withRate(?float $rate) } /** - * @param ?TypedMoney $amount + * @param ?CentPrecisionMoney $amount * @return $this */ - public function withAmount(?TypedMoney $amount) + public function withAmount(?CentPrecisionMoney $amount) { $this->amount = $amount; @@ -106,7 +110,7 @@ public function withAmount(?TypedMoney $amount) * @deprecated use withAmount() instead * @return $this */ - public function withAmountBuilder(?TypedMoneyBuilder $amount) + public function withAmountBuilder(?CentPrecisionMoneyBuilder $amount) { $this->amount = $amount; @@ -118,7 +122,7 @@ public function build(): TaxPortion return new TaxPortionModel( $this->name, $this->rate, - $this->amount instanceof TypedMoneyBuilder ? $this->amount->build() : $this->amount + $this->amount instanceof CentPrecisionMoneyBuilder ? $this->amount->build() : $this->amount ); } diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php index 6a8b2509e43..25bfc428217 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php @@ -19,20 +19,23 @@ interface TaxPortionDraft extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + *

    Name of the tax portion.

    + * * @return null|string */ public function getName(); /** + *

    A number in the range 0-1.

    + * * @return null|float */ public function getRate(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Money value for the tax portion.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php index c3ccead37fb..c0b7681d3b7 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php @@ -41,6 +41,8 @@ final class TaxPortionDraftBuilder implements Builder private $amount; /** + *

    Name of the tax portion.

    + * * @return null|string */ @@ -50,6 +52,8 @@ public function getName() } /** + *

    A number in the range 0-1.

    + * * @return null|float */ @@ -59,8 +63,7 @@ public function getRate() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Money value for the tax portion.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php index e7220234a3e..15a0db68bcf 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php @@ -54,6 +54,8 @@ public function __construct( } /** + *

    Name of the tax portion.

    + * * * @return null|string */ @@ -72,6 +74,8 @@ public function getName() } /** + *

    A number in the range 0-1.

    + * * * @return null|float */ @@ -90,8 +94,7 @@ public function getRate() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Money value for the tax portion.

    * * * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php b/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php index 13017937b41..ba121bc557a 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -35,7 +35,7 @@ final class TaxPortionModel extends JsonObjectModel implements TaxPortion /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $amount; @@ -46,7 +46,7 @@ final class TaxPortionModel extends JsonObjectModel implements TaxPortion public function __construct( ?string $name = null, ?float $rate = null, - ?TypedMoney $amount = null + ?CentPrecisionMoney $amount = null ) { $this->name = $name; $this->rate = $rate; @@ -54,6 +54,8 @@ public function __construct( } /** + *

    Name of the tax portion.

    + * * * @return null|string */ @@ -72,7 +74,7 @@ public function getName() } /** - *

    A number in the range [0..1]

    + *

    A number in the range 0-1.

    * * * @return null|float @@ -92,8 +94,10 @@ public function getRate() } /** + *

    Money value of the tax portion.

    + * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getAmount() { @@ -104,7 +108,7 @@ public function getAmount() return null; } - $this->amount = TypedMoneyModel::of($data); + $this->amount = CentPrecisionMoneyModel::of($data); } return $this->amount; @@ -128,9 +132,9 @@ public function setRate(?float $rate): void } /** - * @param ?TypedMoney $amount + * @param ?CentPrecisionMoney $amount */ - public function setAmount(?TypedMoney $amount): void + public function setAmount(?CentPrecisionMoney $amount): void { $this->amount = $amount; } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php index 7961a68cf32..ad7aef9c6af 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,39 +19,42 @@ interface TaxedItemPrice extends JsonObject public const FIELD_TOTAL_TAX = 'totalTax'; /** + *

    Total net amount of the Line Item or Custom Line Item.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalNet(); /** - *

    TaxedItemPrice fields can not be used in query predicates.

    + *

    Total gross amount of the Line Item or Custom Line Item.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross(); /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Line Item or Custom Line Item. + * Automatically calculated as the difference between the totalGross and totalNet values.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax(); /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet */ - public function setTotalNet(?TypedMoney $totalNet): void; + public function setTotalNet(?CentPrecisionMoney $totalNet): void; /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross */ - public function setTotalGross(?TypedMoney $totalGross): void; + public function setTotalGross(?CentPrecisionMoney $totalGross): void; /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax */ - public function setTotalTax(?TypedMoney $totalTax): void; + public function setTotalTax(?CentPrecisionMoney $totalTax): void; } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php index 254e13dc0a6..44c1ded4038 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -24,58 +24,61 @@ final class TaxedItemPriceBuilder implements Builder { /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalNet; /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalGross; /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalTax; /** + *

    Total net amount of the Line Item or Custom Line Item.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalNet() { - return $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet; + return $this->totalNet instanceof CentPrecisionMoneyBuilder ? $this->totalNet->build() : $this->totalNet; } /** - *

    TaxedItemPrice fields can not be used in query predicates.

    + *

    Total gross amount of the Line Item or Custom Line Item.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross() { - return $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross; + return $this->totalGross instanceof CentPrecisionMoneyBuilder ? $this->totalGross->build() : $this->totalGross; } /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Line Item or Custom Line Item. + * Automatically calculated as the difference between the totalGross and totalNet values.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax() { - return $this->totalTax instanceof TypedMoneyBuilder ? $this->totalTax->build() : $this->totalTax; + return $this->totalTax instanceof CentPrecisionMoneyBuilder ? $this->totalTax->build() : $this->totalTax; } /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet * @return $this */ - public function withTotalNet(?TypedMoney $totalNet) + public function withTotalNet(?CentPrecisionMoney $totalNet) { $this->totalNet = $totalNet; @@ -83,10 +86,10 @@ public function withTotalNet(?TypedMoney $totalNet) } /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross * @return $this */ - public function withTotalGross(?TypedMoney $totalGross) + public function withTotalGross(?CentPrecisionMoney $totalGross) { $this->totalGross = $totalGross; @@ -94,10 +97,10 @@ public function withTotalGross(?TypedMoney $totalGross) } /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax * @return $this */ - public function withTotalTax(?TypedMoney $totalTax) + public function withTotalTax(?CentPrecisionMoney $totalTax) { $this->totalTax = $totalTax; @@ -108,7 +111,7 @@ public function withTotalTax(?TypedMoney $totalTax) * @deprecated use withTotalNet() instead * @return $this */ - public function withTotalNetBuilder(?TypedMoneyBuilder $totalNet) + public function withTotalNetBuilder(?CentPrecisionMoneyBuilder $totalNet) { $this->totalNet = $totalNet; @@ -119,7 +122,7 @@ public function withTotalNetBuilder(?TypedMoneyBuilder $totalNet) * @deprecated use withTotalGross() instead * @return $this */ - public function withTotalGrossBuilder(?TypedMoneyBuilder $totalGross) + public function withTotalGrossBuilder(?CentPrecisionMoneyBuilder $totalGross) { $this->totalGross = $totalGross; @@ -130,7 +133,7 @@ public function withTotalGrossBuilder(?TypedMoneyBuilder $totalGross) * @deprecated use withTotalTax() instead * @return $this */ - public function withTotalTaxBuilder(?TypedMoneyBuilder $totalTax) + public function withTotalTaxBuilder(?CentPrecisionMoneyBuilder $totalTax) { $this->totalTax = $totalTax; @@ -140,9 +143,9 @@ public function withTotalTaxBuilder(?TypedMoneyBuilder $totalTax) public function build(): TaxedItemPrice { return new TaxedItemPriceModel( - $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet, - $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross, - $this->totalTax instanceof TypedMoneyBuilder ? $this->totalTax->build() : $this->totalTax + $this->totalNet instanceof CentPrecisionMoneyBuilder ? $this->totalNet->build() : $this->totalNet, + $this->totalGross instanceof CentPrecisionMoneyBuilder ? $this->totalGross->build() : $this->totalGross, + $this->totalTax instanceof CentPrecisionMoneyBuilder ? $this->totalTax->build() : $this->totalTax ); } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php index 0587d550f0e..17b15a67b75 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -23,19 +23,19 @@ final class TaxedItemPriceModel extends JsonObjectModel implements TaxedItemPric { /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalNet; /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalGross; /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalTax; @@ -44,9 +44,9 @@ final class TaxedItemPriceModel extends JsonObjectModel implements TaxedItemPric * @psalm-suppress MissingParamType */ public function __construct( - ?TypedMoney $totalNet = null, - ?TypedMoney $totalGross = null, - ?TypedMoney $totalTax = null + ?CentPrecisionMoney $totalNet = null, + ?CentPrecisionMoney $totalGross = null, + ?CentPrecisionMoney $totalTax = null ) { $this->totalNet = $totalNet; $this->totalGross = $totalGross; @@ -54,8 +54,10 @@ public function __construct( } /** + *

    Total net amount of the Line Item or Custom Line Item.

    * - * @return null|TypedMoney + * + * @return null|CentPrecisionMoney */ public function getTotalNet() { @@ -66,17 +68,17 @@ public function getTotalNet() return null; } - $this->totalNet = TypedMoneyModel::of($data); + $this->totalNet = CentPrecisionMoneyModel::of($data); } return $this->totalNet; } /** - *

    TaxedItemPrice fields can not be used in query predicates.

    + *

    Total gross amount of the Line Item or Custom Line Item.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross() { @@ -87,17 +89,18 @@ public function getTotalGross() return null; } - $this->totalGross = TypedMoneyModel::of($data); + $this->totalGross = CentPrecisionMoneyModel::of($data); } return $this->totalGross; } /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Line Item or Custom Line Item. + * Automatically calculated as the difference between the totalGross and totalNet values.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax() { @@ -108,7 +111,7 @@ public function getTotalTax() return null; } - $this->totalTax = TypedMoneyModel::of($data); + $this->totalTax = CentPrecisionMoneyModel::of($data); } return $this->totalTax; @@ -116,25 +119,25 @@ public function getTotalTax() /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet */ - public function setTotalNet(?TypedMoney $totalNet): void + public function setTotalNet(?CentPrecisionMoney $totalNet): void { $this->totalNet = $totalNet; } /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross */ - public function setTotalGross(?TypedMoney $totalGross): void + public function setTotalGross(?CentPrecisionMoney $totalGross): void { $this->totalGross = $totalGross; } /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax */ - public function setTotalTax(?TypedMoney $totalTax): void + public function setTotalTax(?CentPrecisionMoney $totalTax): void { $this->totalTax = $totalTax; } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPrice.php b/lib/commercetools-api/src/Models/Cart/TaxedPrice.php index 887686be75e..657a21a9af3 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPrice.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPrice.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -20,19 +20,24 @@ interface TaxedPrice extends JsonObject public const FIELD_TOTAL_TAX = 'totalTax'; /** + *

    Total net price of the Cart or Order.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalNet(); /** + *

    Total gross price of the Cart or Order.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross(); /** - *

    TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

    + *

    Taxable portions added to the total net price.

    + *

    Calculated from the TaxRates.

    * * @return null|TaxPortionCollection @@ -40,22 +45,23 @@ public function getTotalGross(); public function getTaxPortions(); /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Cart or Order.

    + *

    Automatically calculated as the difference between the totalGross and totalNet values.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax(); /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet */ - public function setTotalNet(?TypedMoney $totalNet): void; + public function setTotalNet(?CentPrecisionMoney $totalNet): void; /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross */ - public function setTotalGross(?TypedMoney $totalGross): void; + public function setTotalGross(?CentPrecisionMoney $totalGross): void; /** * @param ?TaxPortionCollection $taxPortions @@ -63,7 +69,7 @@ public function setTotalGross(?TypedMoney $totalGross): void; public function setTaxPortions(?TaxPortionCollection $taxPortions): void; /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax */ - public function setTotalTax(?TypedMoney $totalTax): void; + public function setTotalTax(?CentPrecisionMoney $totalTax): void; } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php index 4fde5eafa5e..45142ae87a6 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -24,13 +24,13 @@ final class TaxedPriceBuilder implements Builder { /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalNet; /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalGross; @@ -42,30 +42,35 @@ final class TaxedPriceBuilder implements Builder /** - * @var null|TypedMoney|TypedMoneyBuilder + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $totalTax; /** + *

    Total net price of the Cart or Order.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalNet() { - return $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet; + return $this->totalNet instanceof CentPrecisionMoneyBuilder ? $this->totalNet->build() : $this->totalNet; } /** + *

    Total gross price of the Cart or Order.

    + * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross() { - return $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross; + return $this->totalGross instanceof CentPrecisionMoneyBuilder ? $this->totalGross->build() : $this->totalGross; } /** - *

    TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

    + *

    Taxable portions added to the total net price.

    + *

    Calculated from the TaxRates.

    * * @return null|TaxPortionCollection @@ -76,21 +81,22 @@ public function getTaxPortions() } /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Cart or Order.

    + *

    Automatically calculated as the difference between the totalGross and totalNet values.

    * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax() { - return $this->totalTax instanceof TypedMoneyBuilder ? $this->totalTax->build() : $this->totalTax; + return $this->totalTax instanceof CentPrecisionMoneyBuilder ? $this->totalTax->build() : $this->totalTax; } /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet * @return $this */ - public function withTotalNet(?TypedMoney $totalNet) + public function withTotalNet(?CentPrecisionMoney $totalNet) { $this->totalNet = $totalNet; @@ -98,10 +104,10 @@ public function withTotalNet(?TypedMoney $totalNet) } /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross * @return $this */ - public function withTotalGross(?TypedMoney $totalGross) + public function withTotalGross(?CentPrecisionMoney $totalGross) { $this->totalGross = $totalGross; @@ -120,10 +126,10 @@ public function withTaxPortions(?TaxPortionCollection $taxPortions) } /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax * @return $this */ - public function withTotalTax(?TypedMoney $totalTax) + public function withTotalTax(?CentPrecisionMoney $totalTax) { $this->totalTax = $totalTax; @@ -134,7 +140,7 @@ public function withTotalTax(?TypedMoney $totalTax) * @deprecated use withTotalNet() instead * @return $this */ - public function withTotalNetBuilder(?TypedMoneyBuilder $totalNet) + public function withTotalNetBuilder(?CentPrecisionMoneyBuilder $totalNet) { $this->totalNet = $totalNet; @@ -145,7 +151,7 @@ public function withTotalNetBuilder(?TypedMoneyBuilder $totalNet) * @deprecated use withTotalGross() instead * @return $this */ - public function withTotalGrossBuilder(?TypedMoneyBuilder $totalGross) + public function withTotalGrossBuilder(?CentPrecisionMoneyBuilder $totalGross) { $this->totalGross = $totalGross; @@ -156,7 +162,7 @@ public function withTotalGrossBuilder(?TypedMoneyBuilder $totalGross) * @deprecated use withTotalTax() instead * @return $this */ - public function withTotalTaxBuilder(?TypedMoneyBuilder $totalTax) + public function withTotalTaxBuilder(?CentPrecisionMoneyBuilder $totalTax) { $this->totalTax = $totalTax; @@ -166,10 +172,10 @@ public function withTotalTaxBuilder(?TypedMoneyBuilder $totalTax) public function build(): TaxedPrice { return new TaxedPriceModel( - $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet, - $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross, + $this->totalNet instanceof CentPrecisionMoneyBuilder ? $this->totalNet->build() : $this->totalNet, + $this->totalGross instanceof CentPrecisionMoneyBuilder ? $this->totalGross->build() : $this->totalGross, $this->taxPortions, - $this->totalTax instanceof TypedMoneyBuilder ? $this->totalTax->build() : $this->totalTax + $this->totalTax instanceof CentPrecisionMoneyBuilder ? $this->totalTax->build() : $this->totalTax ); } diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php index 6d74b5ae51a..8bcdfe20415 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php @@ -19,8 +19,7 @@ interface TaxedPriceDraft extends JsonObject public const FIELD_TAX_PORTIONS = 'taxPortions'; /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total net price of the Line Item or Custom Line Item.

    * * @return null|Money @@ -28,8 +27,7 @@ interface TaxedPriceDraft extends JsonObject public function getTotalNet(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total gross price of the Line Item or Custom Line Item.

    * * @return null|Money @@ -37,6 +35,9 @@ public function getTotalNet(); public function getTotalGross(); /** + *

    Taxable portions added to the totalGross.

    + *

    Calculated from the TaxRates.

    + * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php index 8a281d0530f..e837dfe4a52 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php @@ -41,8 +41,7 @@ final class TaxedPriceDraftBuilder implements Builder private $taxPortions; /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total net price of the Line Item or Custom Line Item.

    * * @return null|Money @@ -53,8 +52,7 @@ public function getTotalNet() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total gross price of the Line Item or Custom Line Item.

    * * @return null|Money @@ -65,6 +63,9 @@ public function getTotalGross() } /** + *

    Taxable portions added to the totalGross.

    + *

    Calculated from the TaxRates.

    + * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php index c6703d03aed..635633565fc 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php @@ -54,8 +54,7 @@ public function __construct( } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total net price of the Line Item or Custom Line Item.

    * * * @return null|Money @@ -76,8 +75,7 @@ public function getTotalNet() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total gross price of the Line Item or Custom Line Item.

    * * * @return null|Money @@ -98,6 +96,9 @@ public function getTotalGross() } /** + *

    Taxable portions added to the totalGross.

    + *

    Calculated from the TaxRates.

    + * * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php index bc9ad0e4d1b..3ec6f1ad522 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Cart; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -23,13 +23,13 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice { /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalNet; /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalGross; @@ -41,7 +41,7 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice /** * - * @var ?TypedMoney + * @var ?CentPrecisionMoney */ protected $totalTax; @@ -50,10 +50,10 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice * @psalm-suppress MissingParamType */ public function __construct( - ?TypedMoney $totalNet = null, - ?TypedMoney $totalGross = null, + ?CentPrecisionMoney $totalNet = null, + ?CentPrecisionMoney $totalGross = null, ?TaxPortionCollection $taxPortions = null, - ?TypedMoney $totalTax = null + ?CentPrecisionMoney $totalTax = null ) { $this->totalNet = $totalNet; $this->totalGross = $totalGross; @@ -62,8 +62,10 @@ public function __construct( } /** + *

    Total net price of the Cart or Order.

    * - * @return null|TypedMoney + * + * @return null|CentPrecisionMoney */ public function getTotalNet() { @@ -74,15 +76,17 @@ public function getTotalNet() return null; } - $this->totalNet = TypedMoneyModel::of($data); + $this->totalNet = CentPrecisionMoneyModel::of($data); } return $this->totalNet; } /** + *

    Total gross price of the Cart or Order.

    + * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalGross() { @@ -93,14 +97,15 @@ public function getTotalGross() return null; } - $this->totalGross = TypedMoneyModel::of($data); + $this->totalGross = CentPrecisionMoneyModel::of($data); } return $this->totalGross; } /** - *

    TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

    + *

    Taxable portions added to the total net price.

    + *

    Calculated from the TaxRates.

    * * * @return null|TaxPortionCollection @@ -120,10 +125,11 @@ public function getTaxPortions() } /** - *

    Calculated automatically as the subtraction of totalGross - totalNet.

    + *

    Total tax applicable for the Cart or Order.

    + *

    Automatically calculated as the difference between the totalGross and totalNet values.

    * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getTotalTax() { @@ -134,7 +140,7 @@ public function getTotalTax() return null; } - $this->totalTax = TypedMoneyModel::of($data); + $this->totalTax = CentPrecisionMoneyModel::of($data); } return $this->totalTax; @@ -142,17 +148,17 @@ public function getTotalTax() /** - * @param ?TypedMoney $totalNet + * @param ?CentPrecisionMoney $totalNet */ - public function setTotalNet(?TypedMoney $totalNet): void + public function setTotalNet(?CentPrecisionMoney $totalNet): void { $this->totalNet = $totalNet; } /** - * @param ?TypedMoney $totalGross + * @param ?CentPrecisionMoney $totalGross */ - public function setTotalGross(?TypedMoney $totalGross): void + public function setTotalGross(?CentPrecisionMoney $totalGross): void { $this->totalGross = $totalGross; } @@ -166,9 +172,9 @@ public function setTaxPortions(?TaxPortionCollection $taxPortions): void } /** - * @param ?TypedMoney $totalTax + * @param ?CentPrecisionMoney $totalTax */ - public function setTotalTax(?TypedMoney $totalTax): void + public function setTotalTax(?CentPrecisionMoney $totalTax): void { $this->totalTax = $totalTax; } diff --git a/lib/commercetools-api/src/Models/Common/ClientLogging.php b/lib/commercetools-api/src/Models/Common/ClientLogging.php index 3a3271e598a..3340e99edec 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLogging.php +++ b/lib/commercetools-api/src/Models/Common/ClientLogging.php @@ -44,7 +44,7 @@ public function getExternalUserId(); public function getCustomer(); /** - *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    + *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php index c2dbbc989fe..c79e13d0d9d 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php @@ -80,7 +80,7 @@ public function getCustomer() } /** - *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    + *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php index f570170714a..dab05dd84ad 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php @@ -123,7 +123,7 @@ public function getCustomer() } /** - *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    + *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/CreatedBy.php b/lib/commercetools-api/src/Models/Common/CreatedBy.php index 90fe56bfb40..6742848e5e5 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedBy.php +++ b/lib/commercetools-api/src/Models/Common/CreatedBy.php @@ -39,7 +39,7 @@ public function getExternalUserId(); public function getCustomer(); /** - *

    Indicates the anonymous session during which the resource was created.

    + *

    Indicates the anonymous session during which the resource was created.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php index d5095fb0297..6a452aecaa0 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php @@ -80,7 +80,7 @@ public function getCustomer() } /** - *

    Indicates the anonymous session during which the resource was created.

    + *

    Indicates the anonymous session during which the resource was created.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/CreatedByModel.php b/lib/commercetools-api/src/Models/Common/CreatedByModel.php index 75c443a1668..6052824c470 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByModel.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByModel.php @@ -123,7 +123,7 @@ public function getCustomer() } /** - *

    Indicates the anonymous session during which the resource was created.

    + *

    Indicates the anonymous session during which the resource was created.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php index efcd6ebbcf2..77973ce26eb 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php @@ -39,7 +39,7 @@ public function getExternalUserId(); public function getCustomer(); /** - *

    Indicates the anonymous session during which the resource was modified.

    + *

    Indicates the anonymous session during which the resource was modified.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php index e537fa304ea..6850b861881 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php @@ -80,7 +80,7 @@ public function getCustomer() } /** - *

    Indicates the anonymous session during which the resource was modified.

    + *

    Indicates the anonymous session during which the resource was modified.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php index 660ef209eb7..abef32579e4 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php @@ -123,7 +123,7 @@ public function getCustomer() } /** - *

    Indicates the anonymous session during which the resource was modified.

    + *

    Indicates the anonymous session during which the resource was modified.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/Price.php b/lib/commercetools-api/src/Models/Common/Price.php index 1a607bb5005..9f895e659db 100644 --- a/lib/commercetools-api/src/Models/Common/Price.php +++ b/lib/commercetools-api/src/Models/Common/Price.php @@ -95,8 +95,8 @@ public function getValidUntil(); /** *

    Is set if a ProductDiscount has been applied. - * If set, the API uses the DiscountedPrice value for the LineItem Price selection. - * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    + * If set, the API uses the DiscountedPrice value for the Line Item Price selection. + * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

    * * @return null|DiscountedPrice diff --git a/lib/commercetools-api/src/Models/Common/PriceBuilder.php b/lib/commercetools-api/src/Models/Common/PriceBuilder.php index 932e6017cfb..9b067c181d3 100644 --- a/lib/commercetools-api/src/Models/Common/PriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PriceBuilder.php @@ -183,8 +183,8 @@ public function getValidUntil() /** *

    Is set if a ProductDiscount has been applied. - * If set, the API uses the DiscountedPrice value for the LineItem Price selection. - * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    + * If set, the API uses the DiscountedPrice value for the Line Item Price selection. + * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

    * * @return null|DiscountedPrice diff --git a/lib/commercetools-api/src/Models/Common/PriceModel.php b/lib/commercetools-api/src/Models/Common/PriceModel.php index f59cf09eefc..ebed165116c 100644 --- a/lib/commercetools-api/src/Models/Common/PriceModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceModel.php @@ -295,8 +295,8 @@ public function getValidUntil() /** *

    Is set if a ProductDiscount has been applied. - * If set, the API uses the DiscountedPrice value for the LineItem Price selection. - * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    + * If set, the API uses the DiscountedPrice value for the Line Item Price selection. + * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

    * * * @return null|DiscountedPrice diff --git a/lib/commercetools-api/src/Models/Common/ScopedPrice.php b/lib/commercetools-api/src/Models/Common/ScopedPrice.php index 84bf1f6def7..0352edf2714 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPrice.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPrice.php @@ -93,7 +93,7 @@ public function getValidFrom(); public function getValidUntil(); /** - *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    * diff --git a/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php b/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php index 3d061743912..d7b78a10b44 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php @@ -176,7 +176,7 @@ public function getValidUntil() } /** - *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    * diff --git a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php index 974665535e9..31777607a38 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php @@ -287,7 +287,7 @@ public function getValidUntil() } /** - *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    * * diff --git a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStore.php b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreError.php similarity index 95% rename from lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStore.php rename to lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreError.php index d161c50831b..4a31c4cd16e 100644 --- a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStore.php +++ b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreError.php @@ -11,7 +11,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface CountryNotConfiguredInStore extends ErrorObject +interface CountryNotConfiguredInStoreError extends ErrorObject { public const FIELD_STORE_COUNTRIES = 'storeCountries'; public const FIELD_COUNTRY = 'country'; diff --git a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreBuilder.php b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorBuilder.php similarity index 85% rename from lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreBuilder.php rename to lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorBuilder.php index d5d5776f744..17277b1cbe0 100644 --- a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreBuilder.php +++ b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorBuilder.php @@ -16,9 +16,9 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class CountryNotConfiguredInStoreBuilder implements Builder +final class CountryNotConfiguredInStoreErrorBuilder implements Builder { /** @@ -105,16 +105,16 @@ public function withCountry(?string $country) } - public function build(): CountryNotConfiguredInStore + public function build(): CountryNotConfiguredInStoreError { - return new CountryNotConfiguredInStoreModel( + return new CountryNotConfiguredInStoreErrorModel( $this->message, $this->storeCountries, $this->country ); } - public static function of(): CountryNotConfiguredInStoreBuilder + public static function of(): CountryNotConfiguredInStoreErrorBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreCollection.php b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorCollection.php similarity index 50% rename from lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreCollection.php rename to lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorCollection.php index eefaad5c00c..6a63a10c5b8 100644 --- a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreCollection.php +++ b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorCollection.php @@ -13,23 +13,23 @@ use stdClass; /** - * @extends ErrorObjectCollection - * @method CountryNotConfiguredInStore current() - * @method CountryNotConfiguredInStore end() - * @method CountryNotConfiguredInStore at($offset) + * @extends ErrorObjectCollection + * @method CountryNotConfiguredInStoreError current() + * @method CountryNotConfiguredInStoreError end() + * @method CountryNotConfiguredInStoreError at($offset) */ -class CountryNotConfiguredInStoreCollection extends ErrorObjectCollection +class CountryNotConfiguredInStoreErrorCollection extends ErrorObjectCollection { /** - * @psalm-assert CountryNotConfiguredInStore $value - * @psalm-param CountryNotConfiguredInStore|stdClass $value + * @psalm-assert CountryNotConfiguredInStoreError $value + * @psalm-param CountryNotConfiguredInStoreError|stdClass $value * @throws InvalidArgumentException * - * @return CountryNotConfiguredInStoreCollection + * @return CountryNotConfiguredInStoreErrorCollection */ public function add($value) { - if (!$value instanceof CountryNotConfiguredInStore) { + if (!$value instanceof CountryNotConfiguredInStoreError) { throw new InvalidArgumentException(); } $this->store($value); @@ -38,15 +38,15 @@ public function add($value) } /** - * @psalm-return callable(int):?CountryNotConfiguredInStore + * @psalm-return callable(int):?CountryNotConfiguredInStoreError */ protected function mapper() { - return function (?int $index): ?CountryNotConfiguredInStore { + return function (?int $index): ?CountryNotConfiguredInStoreError { $data = $this->get($index); if ($data instanceof stdClass) { - /** @var CountryNotConfiguredInStore $data */ - $data = CountryNotConfiguredInStoreModel::of($data); + /** @var CountryNotConfiguredInStoreError $data */ + $data = CountryNotConfiguredInStoreErrorModel::of($data); $this->set($data, $index); } diff --git a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreModel.php b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorModel.php similarity index 96% rename from lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreModel.php rename to lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorModel.php index 50b8e603427..7412bde779b 100644 --- a/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreModel.php +++ b/lib/commercetools-api/src/Models/Error/CountryNotConfiguredInStoreErrorModel.php @@ -17,7 +17,7 @@ /** * @internal */ -final class CountryNotConfiguredInStoreModel extends JsonObjectModel implements CountryNotConfiguredInStore +final class CountryNotConfiguredInStoreErrorModel extends JsonObjectModel implements CountryNotConfiguredInStoreError { public const DISCRIMINATOR_VALUE = 'CountryNotConfiguredInStore'; /** diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php index 7d863b6b05b..2082794cd52 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php @@ -43,7 +43,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'AttributeNameDoesNotExist' => AttributeNameDoesNotExistErrorModel::class, 'BadGateway' => BadGatewayErrorModel::class, 'ConcurrentModification' => ConcurrentModificationErrorModel::class, - 'CountryNotConfiguredInStore' => CountryNotConfiguredInStoreModel::class, + 'CountryNotConfiguredInStore' => CountryNotConfiguredInStoreErrorModel::class, 'DiscountCodeNonApplicable' => DiscountCodeNonApplicableErrorModel::class, 'DuplicateAttributeValue' => DuplicateAttributeValueErrorModel::class, 'DuplicateAttributeValues' => DuplicateAttributeValuesErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php index e74f9d94c22..e01ef9cc608 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php @@ -16,6 +16,8 @@ interface MyCartAddDiscountCodeAction extends MyCartUpdateAction public const FIELD_CODE = 'code'; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php index 19d6bbc4025..65800118d76 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php @@ -27,6 +27,8 @@ final class MyCartAddDiscountCodeActionBuilder implements Builder private $code; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php index 237c5b3a96c..0cd06476136 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    code of a DiscountCode.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php index 1cf31e327c1..94335ef8e53 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php @@ -17,9 +17,8 @@ interface MyCartAddItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new address must have a key that is unique accross this Cart.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php index 9164839b65e..e49507d216b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class MyCartAddItemShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new address must have a key that is unique accross this Cart.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php index 445a46f601e..a41811dde82 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses.

    + *

    The new address must have a key that is unique accross this Cart.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php index f617c4457c5..8dbace2ca54 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php @@ -20,67 +20,68 @@ interface MyCartAddLineItemAction extends MyCartUpdateAction { - public const FIELD_CUSTOM = 'custom'; - public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; + public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; + public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_ADDED_AT = 'addedAt'; + public const FIELD_CUSTOM = 'custom'; /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom(); - - /** - *

    ResourceIdentifier to a Channel.

    + *

    id of the Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel(); - - /** - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate(); - - /** - * @return null|string */ public function getProductId(); /** + *

    id of the ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ public function getVariantId(); /** + *

    sku of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ public function getSku(); /** + *

    Number of Line Items to add to the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel(); + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -88,8 +89,7 @@ public function getQuantity(); public function getSupplyChannel(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -97,37 +97,46 @@ public function getSupplyChannel(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * + + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate(); + + /** + *

    Container for Line Item-specific addresses.

    + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * @return null|DateTimeImmutable */ public function getAddedAt(); /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void; - - /** - * @param ?ChannelResourceIdentifier $distributionChannel - */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + *

    Custom Fields for the Line Item.

    + * - /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @return null|CustomFieldsDraft */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function getCustom(); /** * @param ?string $productId @@ -149,6 +158,11 @@ public function setSku(?string $sku): void; */ public function setQuantity(?int $quantity): void; + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -164,6 +178,11 @@ public function setExternalPrice(?Money $externalPrice): void; */ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -173,4 +192,9 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): * @param ?DateTimeImmutable $addedAt */ public function setAddedAt(?DateTimeImmutable $addedAt): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php index 0b3d0247b6d..6b55a6c72e4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php @@ -33,24 +33,6 @@ */ final class MyCartAddLineItemActionBuilder implements Builder { - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder - */ - private $custom; - - /** - - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder - */ - private $distributionChannel; - - /** - - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder - */ - private $externalTaxRate; - /** * @var ?string @@ -75,6 +57,12 @@ final class MyCartAddLineItemActionBuilder implements Builder */ private $quantity; + /** + + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + */ + private $distributionChannel; + /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder @@ -93,6 +81,12 @@ final class MyCartAddLineItemActionBuilder implements Builder */ private $externalTotalPrice; + /** + + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + */ + private $externalTaxRate; + /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -106,38 +100,16 @@ final class MyCartAddLineItemActionBuilder implements Builder private $addedAt; /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - * @return null|CustomFieldsDraft + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - public function getCustom() - { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; - } + private $custom; /** - *

    ResourceIdentifier to a Channel.

    + *

    id of the Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel() - { - return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; - } - - /** - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; - } - - /** - * @return null|string */ public function getProductId() @@ -146,6 +118,10 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ @@ -155,6 +131,9 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ @@ -164,6 +143,8 @@ public function getSku() } /** + *

    Number of Line Items to add to the Cart.

    + * * @return null|int */ @@ -173,7 +154,21 @@ public function getQuantity() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -184,8 +179,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -196,6 +190,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -205,6 +201,19 @@ public function getExternalTotalPrice() } /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * + + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + } + + /** + *

    Container for Line Item-specific addresses.

    + * * @return null|ItemShippingDetailsDraft */ @@ -214,6 +223,10 @@ public function getShippingDetails() } /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * @return null|DateTimeImmutable */ @@ -223,36 +236,14 @@ public function getAddedAt() } /** - * @param ?CustomFieldsDraft $custom - * @return $this - */ - public function withCustom(?CustomFieldsDraft $custom) - { - $this->custom = $custom; - - return $this; - } - - /** - * @param ?ChannelResourceIdentifier $distributionChannel - * @return $this - */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) - { - $this->distributionChannel = $distributionChannel; - - return $this; - } + *

    Custom Fields for the Line Item.

    + * - /** - * @param ?ExternalTaxRateDraft $externalTaxRate - * @return $this + * @return null|CustomFieldsDraft */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function getCustom() { - $this->externalTaxRate = $externalTaxRate; - - return $this; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -299,6 +290,17 @@ public function withQuantity(?int $quantity) return $this; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + * @return $this + */ + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + { + $this->distributionChannel = $distributionChannel; + + return $this; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel * @return $this @@ -332,6 +334,17 @@ public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTota return $this; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -355,10 +368,10 @@ public function withAddedAt(?DateTimeImmutable $addedAt) } /** - * @deprecated use withCustom() instead + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withCustom(?CustomFieldsDraft $custom) { $this->custom = $custom; @@ -376,17 +389,6 @@ public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder return $this; } - /** - * @deprecated use withExternalTaxRate() instead - * @return $this - */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) - { - $this->externalTaxRate = $externalTaxRate; - - return $this; - } - /** * @deprecated use withSupplyChannel() instead * @return $this @@ -420,6 +422,17 @@ public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @deprecated use withShippingDetails() instead * @return $this @@ -431,21 +444,32 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): MyCartAddLineItemAction { return new MyCartAddLineItemActionModel( - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->productId, $this->variantId, $this->sku, $this->quantity, + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, - $this->addedAt + $this->addedAt, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php index 541551466ad..5f9953e1ca2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php @@ -39,24 +39,6 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa */ protected $action; - /** - * - * @var ?CustomFieldsDraft - */ - protected $custom; - - /** - * - * @var ?ChannelResourceIdentifier - */ - protected $distributionChannel; - - /** - * - * @var ?ExternalTaxRateDraft - */ - protected $externalTaxRate; - /** * * @var ?string @@ -81,6 +63,12 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa */ protected $quantity; + /** + * + * @var ?ChannelResourceIdentifier + */ + protected $distributionChannel; + /** * * @var ?ChannelResourceIdentifier @@ -99,6 +87,12 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa */ protected $externalTotalPrice; + /** + * + * @var ?ExternalTaxRateDraft + */ + protected $externalTaxRate; + /** * * @var ?ItemShippingDetailsDraft @@ -111,37 +105,43 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa */ protected $addedAt; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFieldsDraft $custom = null, - ?ChannelResourceIdentifier $distributionChannel = null, - ?ExternalTaxRateDraft $externalTaxRate = null, ?string $productId = null, ?int $variantId = null, ?string $sku = null, ?int $quantity = null, + ?ChannelResourceIdentifier $distributionChannel = null, ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?ExternalTaxRateDraft $externalTaxRate = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?DateTimeImmutable $addedAt = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { - $this->custom = $custom; - $this->distributionChannel = $distributionChannel; - $this->externalTaxRate = $externalTaxRate; $this->productId = $productId; $this->variantId = $variantId; $this->sku = $sku; $this->quantity = $quantity; + $this->distributionChannel = $distributionChannel; $this->supplyChannel = $supplyChannel; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; + $this->externalTaxRate = $externalTaxRate; $this->shippingDetails = $shippingDetails; $this->addedAt = $addedAt; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -164,67 +164,9 @@ public function getAction() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); - if (is_null($data)) { - return null; - } - - $this->custom = CustomFieldsDraftModel::of($data); - } - - return $this->custom; - } - - /** - *

    ResourceIdentifier to a Channel.

    - * - * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel() - { - if (is_null($this->distributionChannel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); - if (is_null($data)) { - return null; - } - - $this->distributionChannel = ChannelResourceIdentifierModel::of($data); - } - - return $this->distributionChannel; - } - - /** + *

    id of the Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - if (is_null($this->externalTaxRate)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); - if (is_null($data)) { - return null; - } - - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); - } - - return $this->externalTaxRate; - } - - /** * * @return null|string */ @@ -243,6 +185,10 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product.

    + *

    If not given, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|int */ @@ -261,6 +207,9 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|string */ @@ -279,6 +228,8 @@ public function getSku() } /** + *

    Number of Line Items to add to the Cart.

    + * * * @return null|int */ @@ -297,7 +248,31 @@ public function getQuantity() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + * + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + if (is_null($this->distributionChannel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); + if (is_null($data)) { + return null; + } + + $this->distributionChannel = ChannelResourceIdentifierModel::of($data); + } + + return $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier @@ -318,8 +293,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -340,6 +314,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -359,6 +335,29 @@ public function getExternalTotalPrice() } /** + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    + * + * + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + } + + return $this->externalTaxRate; + } + + /** + *

    Container for Line Item-specific addresses.

    + * * * @return null|ItemShippingDetailsDraft */ @@ -378,6 +377,10 @@ public function getShippingDetails() } /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * * @return null|DateTimeImmutable */ @@ -399,31 +402,28 @@ public function getAddedAt() return $this->addedAt; } - /** - * @param ?CustomFieldsDraft $custom + *

    Custom Fields for the Line Item.

    + * + * + * @return null|CustomFieldsDraft */ - public function setCustom(?CustomFieldsDraft $custom): void + public function getCustom() { - $this->custom = $custom; - } + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } - /** - * @param ?ChannelResourceIdentifier $distributionChannel - */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void - { - $this->distributionChannel = $distributionChannel; - } + $this->custom = CustomFieldsDraftModel::of($data); + } - /** - * @param ?ExternalTaxRateDraft $externalTaxRate - */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void - { - $this->externalTaxRate = $externalTaxRate; + return $this->custom; } + /** * @param ?string $productId */ @@ -456,6 +456,14 @@ public function setQuantity(?int $quantity): void $this->quantity = $quantity; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + { + $this->distributionChannel = $distributionChannel; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -480,6 +488,14 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal $this->externalTotalPrice = $externalTotalPrice; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -496,6 +512,14 @@ public function setAddedAt(?DateTimeImmutable $addedAt): void $this->addedAt = $addedAt; } + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php index cabd41dae59..07be773193f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php @@ -17,7 +17,8 @@ interface MyCartAddPaymentAction extends MyCartUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php index 7c984f07d03..4de69a4bae2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php @@ -29,7 +29,8 @@ final class MyCartAddPaymentActionBuilder implements Builder private $payment; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php index 438408a19aa..a13172b13c3 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php @@ -65,7 +65,8 @@ public function getAction() } /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the Cart. + * Must not be assigned to another Order or active Cart already.

    * * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php index 2d91178a78d..da3c1686e18 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php @@ -18,12 +18,16 @@ interface MyCartApplyDeltaToLineItemShippingDetailsTargetsAction extends MyCartU public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php index 2323de34bbc..5dd04c3fa73 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php @@ -34,6 +34,8 @@ final class MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder implem private $targetsDelta; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -43,6 +45,8 @@ public function getLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php index 5090bd93773..a66f3409c75 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php @@ -72,6 +72,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -90,6 +92,8 @@ public function getLineItemId() } /** + *

    Using positive or negative quantities increases or decreases the number of items shipped to an address.

    + * * * @return null|ItemShippingTargetCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php index c633cf04725..1be41e316e2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php @@ -21,20 +21,25 @@ interface MyCartChangeLineItemQuantityAction extends MyCartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -42,6 +47,8 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php index 6bf5ab656cf..197a799d566 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php @@ -49,6 +49,8 @@ final class MyCartChangeLineItemQuantityActionBuilder implements Builder private $externalTotalPrice; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -58,6 +60,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ @@ -67,8 +72,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -79,6 +84,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php index 4ead2c52220..10a3de8bd97 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php @@ -91,6 +91,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -109,6 +111,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * * @return null|int */ @@ -127,8 +132,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * * @return null|Money @@ -149,6 +154,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php index 4840ce16b89..8560158ed8e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php @@ -16,6 +16,8 @@ interface MyCartChangeTaxModeAction extends MyCartUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + *

    The new TaxMode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php index 481ad75da3e..c52c7a2ceae 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php @@ -27,6 +27,8 @@ final class MyCartChangeTaxModeActionBuilder implements Builder private $taxMode; /** + *

    The new TaxMode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php index f567c1ef2c8..a4dd23c053c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    The new TaxMode.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraft.php b/lib/commercetools-api/src/Models/Me/MyCartDraft.php index 76019d58d8c..c9f411ebf55 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraft.php @@ -8,11 +8,11 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; -use Commercetools\Api\Models\Store\StoreKeyReference; +use Commercetools\Api\Models\Store\StoreResourceIdentifier; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -21,23 +21,23 @@ interface MyCartDraft extends JsonObject { public const FIELD_CURRENCY = 'currency'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; - public const FIELD_COUNTRY = 'country'; - public const FIELD_INVENTORY_MODE = 'inventoryMode'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; + public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; - public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_TAX_MODE = 'taxMode'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; public const FIELD_SHIPPING_METHOD = 'shippingMethod'; - public const FIELD_CUSTOM = 'custom'; - public const FIELD_LOCALE = 'locale'; - public const FIELD_TAX_MODE = 'taxMode'; - public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; - public const FIELD_BUSINESS_UNIT = 'businessUnit'; - public const FIELD_STORE = 'store'; public const FIELD_DISCOUNT_CODES = 'discountCodes'; + public const FIELD_COUNTRY = 'country'; + public const FIELD_LOCALE = 'locale'; + public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; + public const FIELD_CUSTOM = 'custom'; /** - *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    + *

    Currency the Cart uses.

    * * @return null|string @@ -45,114 +45,130 @@ interface MyCartDraft extends JsonObject public function getCurrency(); /** + *

    Email address of the Customer the Cart belongs to.

    + * * @return null|string */ public function getCustomerEmail(); /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * - * @return null|string + * @return null|BusinessUnitResourceIdentifier */ - public function getCountry(); + public function getBusinessUnit(); /** - *

    Default inventory mode is None.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * - * @return null|string + * @return null|StoreResourceIdentifier */ - public function getInventoryMode(); + public function getStore(); /** + *

    Line Items to add to the Cart.

    + * * @return null|MyLineItemDraftCollection */ public function getLineItems(); /** + *

    Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

    + * - * @return null|BaseAddress + * @return null|string */ - public function getShippingAddress(); + public function getTaxMode(); /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    + * - * @return null|BaseAddress + * @return null|string */ - public function getBillingAddress(); + public function getInventoryMode(); /** + *

    Billing address associated with the Cart.

    + * - * @return null|ShippingMethodResourceIdentifier + * @return null|BaseAddress */ - public function getShippingMethod(); + public function getBillingAddress(); /** - *

    The custom fields.

    + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * - * @return null|CustomFieldsDraft + * @return null|BaseAddress */ - public function getCustom(); + public function getShippingAddress(); /** + *

    Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    + * - * @return null|string + * @return null|ShippingMethodResourceIdentifier */ - public function getLocale(); + public function getShippingMethod(); /** - *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

    * - * @return null|string + * @return null|BaseAddressCollection */ - public function getTaxMode(); + public function getItemShippingAddresses(); /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    code of the existing DiscountCodes to add to the Cart.

    * - * @return null|int + * @return null|array */ - public function getDeleteDaysAfterLastModification(); + public function getDiscountCodes(); /** - *

    Contains addresses for orders with multiple shipping addresses. - * Each address must contain a key which is unique in this cart.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses(); + public function getCountry(); /** - *

    The BusinessUnit the cart will belong to.

    + *

    Languages of the Cart. + * Can only contain languages supported by the Project.

    * - * @return null|BusinessUnitKeyReference + * @return null|string */ - public function getBusinessUnit(); + public function getLocale(); /** - *

    Reference to a Store by its key.

    + *

    Number of days after which a Cart with Active CartState is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * - * @return null|StoreKeyReference + * @return null|int */ - public function getStore(); + public function getDeleteDaysAfterLastModification(); /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes(); + public function getCustom(); /** * @param ?string $currency @@ -165,14 +181,14 @@ public function setCurrency(?string $currency): void; public function setCustomerEmail(?string $customerEmail): void; /** - * @param ?string $country + * @param ?BusinessUnitResourceIdentifier $businessUnit */ - public function setCountry(?string $country): void; + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; /** - * @param ?string $inventoryMode + * @param ?StoreResourceIdentifier $store */ - public function setInventoryMode(?string $inventoryMode): void; + public function setStore(?StoreResourceIdentifier $store): void; /** * @param ?MyLineItemDraftCollection $lineItems @@ -180,57 +196,57 @@ public function setInventoryMode(?string $inventoryMode): void; public function setLineItems(?MyLineItemDraftCollection $lineItems): void; /** - * @param ?BaseAddress $shippingAddress + * @param ?string $taxMode */ - public function setShippingAddress(?BaseAddress $shippingAddress): void; + public function setTaxMode(?string $taxMode): void; /** - * @param ?BaseAddress $billingAddress + * @param ?string $inventoryMode */ - public function setBillingAddress(?BaseAddress $billingAddress): void; + public function setInventoryMode(?string $inventoryMode): void; /** - * @param ?ShippingMethodResourceIdentifier $shippingMethod + * @param ?BaseAddress $billingAddress */ - public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void; + public function setBillingAddress(?BaseAddress $billingAddress): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?BaseAddress $shippingAddress */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setShippingAddress(?BaseAddress $shippingAddress): void; /** - * @param ?string $locale + * @param ?ShippingMethodResourceIdentifier $shippingMethod */ - public function setLocale(?string $locale): void; + public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void; /** - * @param ?string $taxMode + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setTaxMode(?string $taxMode): void; + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; /** - * @param ?int $deleteDaysAfterLastModification + * @param ?array $discountCodes */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; + public function setDiscountCodes(?array $discountCodes): void; /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; + public function setCountry(?string $country): void; /** - * @param ?BusinessUnitKeyReference $businessUnit + * @param ?string $locale */ - public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; + public function setLocale(?string $locale): void; /** - * @param ?StoreKeyReference $store + * @param ?int $deleteDaysAfterLastModification */ - public function setStore(?StoreKeyReference $store): void; + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom */ - public function setDiscountCodes(?array $discountCodes): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php index 8ece2de7952..97381c65cbb 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php @@ -8,15 +8,15 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; -use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierBuilder; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder; -use Commercetools\Api\Models\Store\StoreKeyReference; -use Commercetools\Api\Models\Store\StoreKeyReferenceBuilder; +use Commercetools\Api\Models\Store\StoreResourceIdentifier; +use Commercetools\Api\Models\Store\StoreResourceIdentifierBuilder; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -45,15 +45,15 @@ final class MyCartDraftBuilder implements Builder /** - * @var ?string + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder */ - private $country; + private $businessUnit; /** - * @var ?string + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ - private $inventoryMode; + private $store; /** @@ -63,72 +63,72 @@ final class MyCartDraftBuilder implements Builder /** - * @var null|BaseAddress|BaseAddressBuilder + * @var ?string */ - private $shippingAddress; + private $taxMode; /** - * @var null|BaseAddress|BaseAddressBuilder + * @var ?string */ - private $billingAddress; + private $inventoryMode; /** - * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder + * @var null|BaseAddress|BaseAddressBuilder */ - private $shippingMethod; + private $billingAddress; /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var null|BaseAddress|BaseAddressBuilder */ - private $custom; + private $shippingAddress; /** - * @var ?string + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ - private $locale; + private $shippingMethod; /** - * @var ?string + * @var ?BaseAddressCollection */ - private $taxMode; + private $itemShippingAddresses; /** - * @var ?int + * @var ?array */ - private $deleteDaysAfterLastModification; + private $discountCodes; /** - * @var ?BaseAddressCollection + * @var ?string */ - private $itemShippingAddresses; + private $country; /** - * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + * @var ?string */ - private $businessUnit; + private $locale; /** - * @var null|StoreKeyReference|StoreKeyReferenceBuilder + * @var ?int */ - private $store; + private $deleteDaysAfterLastModification; /** - * @var ?array + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - private $discountCodes; + private $custom; /** - *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    + *

    Currency the Cart uses.

    * * @return null|string @@ -139,6 +139,8 @@ public function getCurrency() } /** + *

    Email address of the Customer the Cart belongs to.

    + * * @return null|string */ @@ -148,28 +150,30 @@ public function getCustomerEmail() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * - * @return null|string + * @return null|BusinessUnitResourceIdentifier */ - public function getCountry() + public function getBusinessUnit() { - return $this->country; + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; } /** - *

    Default inventory mode is None.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * - * @return null|string + * @return null|StoreResourceIdentifier */ - public function getInventoryMode() + public function getStore() { - return $this->inventoryMode; + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; } /** + *

    Line Items to add to the Cart.

    + * * @return null|MyLineItemDraftCollection */ @@ -179,118 +183,130 @@ public function getLineItems() } /** + *

    Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

    + * - * @return null|BaseAddress + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->taxMode; } /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    + * - * @return null|BaseAddress + * @return null|string */ - public function getBillingAddress() + public function getInventoryMode() { - return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->inventoryMode; } /** + *

    Billing address associated with the Cart.

    + * - * @return null|ShippingMethodResourceIdentifier + * @return null|BaseAddress */ - public function getShippingMethod() + public function getBillingAddress() { - return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod; + return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** - *

    The custom fields.

    + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * - * @return null|CustomFieldsDraft + * @return null|BaseAddress */ - public function getCustom() + public function getShippingAddress() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; } /** + *

    Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    + * - * @return null|string + * @return null|ShippingMethodResourceIdentifier */ - public function getLocale() + public function getShippingMethod() { - return $this->locale; + return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod; } /** - *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

    * - * @return null|string + * @return null|BaseAddressCollection */ - public function getTaxMode() + public function getItemShippingAddresses() { - return $this->taxMode; + return $this->itemShippingAddresses; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    code of the existing DiscountCodes to add to the Cart.

    * - * @return null|int + * @return null|array */ - public function getDeleteDaysAfterLastModification() + public function getDiscountCodes() { - return $this->deleteDaysAfterLastModification; + return $this->discountCodes; } /** - *

    Contains addresses for orders with multiple shipping addresses. - * Each address must contain a key which is unique in this cart.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses() + public function getCountry() { - return $this->itemShippingAddresses; + return $this->country; } /** - *

    The BusinessUnit the cart will belong to.

    + *

    Languages of the Cart. + * Can only contain languages supported by the Project.

    * - * @return null|BusinessUnitKeyReference + * @return null|string */ - public function getBusinessUnit() + public function getLocale() { - return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + return $this->locale; } /** - *

    Reference to a Store by its key.

    + *

    Number of days after which a Cart with Active CartState is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * - * @return null|StoreKeyReference + * @return null|int */ - public function getStore() + public function getDeleteDaysAfterLastModification() { - return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + return $this->deleteDaysAfterLastModification; } /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes() + public function getCustom() { - return $this->discountCodes; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -316,23 +332,23 @@ public function withCustomerEmail(?string $customerEmail) } /** - * @param ?string $country + * @param ?BusinessUnitResourceIdentifier $businessUnit * @return $this */ - public function withCountry(?string $country) + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) { - $this->country = $country; + $this->businessUnit = $businessUnit; return $this; } /** - * @param ?string $inventoryMode + * @param ?StoreResourceIdentifier $store * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withStore(?StoreResourceIdentifier $store) { - $this->inventoryMode = $inventoryMode; + $this->store = $store; return $this; } @@ -349,188 +365,188 @@ public function withLineItems(?MyLineItemDraftCollection $lineItems) } /** - * @param ?BaseAddress $shippingAddress + * @param ?string $taxMode * @return $this */ - public function withShippingAddress(?BaseAddress $shippingAddress) + public function withTaxMode(?string $taxMode) { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; return $this; } /** - * @param ?BaseAddress $billingAddress + * @param ?string $inventoryMode * @return $this */ - public function withBillingAddress(?BaseAddress $billingAddress) + public function withInventoryMode(?string $inventoryMode) { - $this->billingAddress = $billingAddress; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?ShippingMethodResourceIdentifier $shippingMethod + * @param ?BaseAddress $billingAddress * @return $this */ - public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod) + public function withBillingAddress(?BaseAddress $billingAddress) { - $this->shippingMethod = $shippingMethod; + $this->billingAddress = $billingAddress; return $this; } /** - * @param ?CustomFieldsDraft $custom + * @param ?BaseAddress $shippingAddress * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withShippingAddress(?BaseAddress $shippingAddress) { - $this->custom = $custom; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @param ?string $locale + * @param ?ShippingMethodResourceIdentifier $shippingMethod * @return $this */ - public function withLocale(?string $locale) + public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod) { - $this->locale = $locale; + $this->shippingMethod = $shippingMethod; return $this; } /** - * @param ?string $taxMode + * @param ?BaseAddressCollection $itemShippingAddresses * @return $this */ - public function withTaxMode(?string $taxMode) + public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) { - $this->taxMode = $taxMode; + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } /** - * @param ?int $deleteDaysAfterLastModification + * @param ?array $discountCodes * @return $this */ - public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) + public function withDiscountCodes(?array $discountCodes) { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->discountCodes = $discountCodes; return $this; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country * @return $this */ - public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) + public function withCountry(?string $country) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->country = $country; return $this; } /** - * @param ?BusinessUnitKeyReference $businessUnit + * @param ?string $locale * @return $this */ - public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + public function withLocale(?string $locale) { - $this->businessUnit = $businessUnit; + $this->locale = $locale; return $this; } /** - * @param ?StoreKeyReference $store + * @param ?int $deleteDaysAfterLastModification * @return $this */ - public function withStore(?StoreKeyReference $store) + public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) { - $this->store = $store; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; return $this; } /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withDiscountCodes(?array $discountCodes) + public function withCustom(?CustomFieldsDraft $custom) { - $this->discountCodes = $discountCodes; + $this->custom = $custom; return $this; } /** - * @deprecated use withShippingAddress() instead + * @deprecated use withBusinessUnit() instead * @return $this */ - public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) { - $this->shippingAddress = $shippingAddress; + $this->businessUnit = $businessUnit; return $this; } /** - * @deprecated use withBillingAddress() instead + * @deprecated use withStore() instead * @return $this */ - public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress) + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) { - $this->billingAddress = $billingAddress; + $this->store = $store; return $this; } /** - * @deprecated use withShippingMethod() instead + * @deprecated use withBillingAddress() instead * @return $this */ - public function withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod) + public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress) { - $this->shippingMethod = $shippingMethod; + $this->billingAddress = $billingAddress; return $this; } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingAddress() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) { - $this->custom = $custom; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @deprecated use withBusinessUnit() instead + * @deprecated use withShippingMethod() instead * @return $this */ - public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + public function withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod) { - $this->businessUnit = $businessUnit; + $this->shippingMethod = $shippingMethod; return $this; } /** - * @deprecated use withStore() instead + * @deprecated use withCustom() instead * @return $this */ - public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->store = $store; + $this->custom = $custom; return $this; } @@ -540,20 +556,20 @@ public function build(): MyCartDraft return new MyCartDraftModel( $this->currency, $this->customerEmail, - $this->country, - $this->inventoryMode, + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, $this->lineItems, - $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->taxMode, + $this->inventoryMode, $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->itemShippingAddresses, + $this->discountCodes, + $this->country, $this->locale, - $this->taxMode, $this->deleteDaysAfterLastModification, - $this->itemShippingAddresses, - $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, - $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, - $this->discountCodes + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php b/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php index a79a488fd74..6c08d27ff73 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php @@ -8,15 +8,15 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; -use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierModel; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\Common\BaseAddressModel; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierModel; -use Commercetools\Api\Models\Store\StoreKeyReference; -use Commercetools\Api\Models\Store\StoreKeyReferenceModel; +use Commercetools\Api\Models\Store\StoreResourceIdentifier; +use Commercetools\Api\Models\Store\StoreResourceIdentifierModel; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -44,15 +44,15 @@ final class MyCartDraftModel extends JsonObjectModel implements MyCartDraft /** * - * @var ?string + * @var ?BusinessUnitResourceIdentifier */ - protected $country; + protected $businessUnit; /** * - * @var ?string + * @var ?StoreResourceIdentifier */ - protected $inventoryMode; + protected $store; /** * @@ -62,69 +62,69 @@ final class MyCartDraftModel extends JsonObjectModel implements MyCartDraft /** * - * @var ?BaseAddress + * @var ?string */ - protected $shippingAddress; + protected $taxMode; /** * - * @var ?BaseAddress + * @var ?string */ - protected $billingAddress; + protected $inventoryMode; /** * - * @var ?ShippingMethodResourceIdentifier + * @var ?BaseAddress */ - protected $shippingMethod; + protected $billingAddress; /** * - * @var ?CustomFieldsDraft + * @var ?BaseAddress */ - protected $custom; + protected $shippingAddress; /** * - * @var ?string + * @var ?ShippingMethodResourceIdentifier */ - protected $locale; + protected $shippingMethod; /** * - * @var ?string + * @var ?BaseAddressCollection */ - protected $taxMode; + protected $itemShippingAddresses; /** * - * @var ?int + * @var ?array */ - protected $deleteDaysAfterLastModification; + protected $discountCodes; /** * - * @var ?BaseAddressCollection + * @var ?string */ - protected $itemShippingAddresses; + protected $country; /** * - * @var ?BusinessUnitKeyReference + * @var ?string */ - protected $businessUnit; + protected $locale; /** * - * @var ?StoreKeyReference + * @var ?int */ - protected $store; + protected $deleteDaysAfterLastModification; /** * - * @var ?array + * @var ?CustomFieldsDraft */ - protected $discountCodes; + protected $custom; /** @@ -133,41 +133,41 @@ final class MyCartDraftModel extends JsonObjectModel implements MyCartDraft public function __construct( ?string $currency = null, ?string $customerEmail = null, - ?string $country = null, - ?string $inventoryMode = null, + ?BusinessUnitResourceIdentifier $businessUnit = null, + ?StoreResourceIdentifier $store = null, ?MyLineItemDraftCollection $lineItems = null, - ?BaseAddress $shippingAddress = null, + ?string $taxMode = null, + ?string $inventoryMode = null, ?BaseAddress $billingAddress = null, + ?BaseAddress $shippingAddress = null, ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?CustomFieldsDraft $custom = null, + ?BaseAddressCollection $itemShippingAddresses = null, + ?array $discountCodes = null, + ?string $country = null, ?string $locale = null, - ?string $taxMode = null, ?int $deleteDaysAfterLastModification = null, - ?BaseAddressCollection $itemShippingAddresses = null, - ?BusinessUnitKeyReference $businessUnit = null, - ?StoreKeyReference $store = null, - ?array $discountCodes = null + ?CustomFieldsDraft $custom = null ) { $this->currency = $currency; $this->customerEmail = $customerEmail; - $this->country = $country; - $this->inventoryMode = $inventoryMode; + $this->businessUnit = $businessUnit; + $this->store = $store; $this->lineItems = $lineItems; - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; + $this->inventoryMode = $inventoryMode; $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; $this->shippingMethod = $shippingMethod; - $this->custom = $custom; - $this->locale = $locale; - $this->taxMode = $taxMode; - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; $this->itemShippingAddresses = $itemShippingAddresses; - $this->businessUnit = $businessUnit; - $this->store = $store; $this->discountCodes = $discountCodes; + $this->country = $country; + $this->locale = $locale; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->custom = $custom; } /** - *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    + *

    Currency the Cart uses.

    * * * @return null|string @@ -187,6 +187,8 @@ public function getCurrency() } /** + *

    Email address of the Customer the Cart belongs to.

    + * * * @return null|string */ @@ -205,46 +207,50 @@ public function getCustomerEmail() } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2.

    + *

    ResourceIdentifier to the Business Unit the Cart should belong to.

    * * - * @return null|string + * @return null|BusinessUnitResourceIdentifier */ - public function getCountry() + public function getBusinessUnit() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); if (is_null($data)) { return null; } - $this->country = (string) $data; + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); } - return $this->country; + return $this->businessUnit; } /** - *

    Default inventory mode is None.

    + *

    ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

    * * - * @return null|string + * @return null|StoreResourceIdentifier */ - public function getInventoryMode() + public function getStore() { - if (is_null($this->inventoryMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + + $this->store = StoreResourceIdentifierModel::of($data); } - return $this->inventoryMode; + return $this->store; } /** + *

    Line Items to add to the Cart.

    + * * * @return null|MyLineItemDraftCollection */ @@ -263,223 +269,233 @@ public function getLineItems() } /** + *

    Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

    * - * @return null|BaseAddress + * + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - if (is_null($this->shippingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($this->taxMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_MODE); if (is_null($data)) { return null; } - - $this->shippingAddress = BaseAddressModel::of($data); + $this->taxMode = (string) $data; } - return $this->shippingAddress; + return $this->taxMode; } /** + *

    Determines how stock quantities are tracked for Line Items in the Cart.

    * - * @return null|BaseAddress + * + * @return null|string */ - public function getBillingAddress() + public function getInventoryMode() { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - - $this->billingAddress = BaseAddressModel::of($data); + $this->inventoryMode = (string) $data; } - return $this->billingAddress; + return $this->inventoryMode; } /** + *

    Billing address associated with the Cart.

    * - * @return null|ShippingMethodResourceIdentifier + * + * @return null|BaseAddress */ - public function getShippingMethod() + public function getBillingAddress() { - if (is_null($this->shippingMethod)) { + if (is_null($this->billingAddress)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_METHOD); + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->shippingMethod = ShippingMethodResourceIdentifierModel::of($data); + $this->billingAddress = BaseAddressModel::of($data); } - return $this->shippingMethod; + return $this->billingAddress; } /** - *

    The custom fields.

    + *

    Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * * - * @return null|CustomFieldsDraft + * @return null|BaseAddress */ - public function getCustom() + public function getShippingAddress() { - if (is_null($this->custom)) { + if (is_null($this->shippingAddress)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); if (is_null($data)) { return null; } - $this->custom = CustomFieldsDraftModel::of($data); + $this->shippingAddress = BaseAddressModel::of($data); } - return $this->custom; + return $this->shippingAddress; } /** + *

    Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

    * - * @return null|string + * + * @return null|ShippingMethodResourceIdentifier */ - public function getLocale() + public function getShippingMethod() { - if (is_null($this->locale)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_LOCALE); + if (is_null($this->shippingMethod)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD); if (is_null($data)) { return null; } - $this->locale = (string) $data; + + $this->shippingMethod = ShippingMethodResourceIdentifierModel::of($data); } - return $this->locale; + return $this->shippingMethod; } /** - *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    + *

    Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. + * The keys are used by LineItems to reference these addresses under their shippingDetails.

    + *

    Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

    * * - * @return null|string + * @return null|BaseAddressCollection */ - public function getTaxMode() + public function getItemShippingAddresses() { - if (is_null($this->taxMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_MODE); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - $this->taxMode = (string) $data; + $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); } - return $this->taxMode; + return $this->itemShippingAddresses; } /** - *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. - * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    + *

    code of the existing DiscountCodes to add to the Cart.

    * * - * @return null|int + * @return null|array */ - public function getDeleteDaysAfterLastModification() + public function getDiscountCodes() { - if (is_null($this->deleteDaysAfterLastModification)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); + if (is_null($this->discountCodes)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNT_CODES); if (is_null($data)) { return null; } - $this->deleteDaysAfterLastModification = (int) $data; + $this->discountCodes = $data; } - return $this->deleteDaysAfterLastModification; + return $this->discountCodes; } /** - *

    Contains addresses for orders with multiple shipping addresses. - * Each address must contain a key which is unique in this cart.

    + *

    Used for LineItem Price selection. + * If used for Create Cart in Store, the provided country must be one of the Store's countries.

    * * - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses() + public function getCountry() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->country)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); + $this->country = (string) $data; } - return $this->itemShippingAddresses; + return $this->country; } /** - *

    The BusinessUnit the cart will belong to.

    + *

    Languages of the Cart. + * Can only contain languages supported by the Project.

    * * - * @return null|BusinessUnitKeyReference + * @return null|string */ - public function getBusinessUnit() + public function getLocale() { - if (is_null($this->businessUnit)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($this->locale)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LOCALE); if (is_null($data)) { return null; } - - $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + $this->locale = (string) $data; } - return $this->businessUnit; + return $this->locale; } /** - *

    Reference to a Store by its key.

    + *

    Number of days after which a Cart with Active CartState is deleted since its last modification. + * If not provided, the default value for this field configured in Project settings is assigned.

    + *

    Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

    * * - * @return null|StoreKeyReference + * @return null|int */ - public function getStore() + public function getDeleteDaysAfterLastModification() { - if (is_null($this->store)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_STORE); + if (is_null($this->deleteDaysAfterLastModification)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); if (is_null($data)) { return null; } - - $this->store = StoreKeyReferenceModel::of($data); + $this->deleteDaysAfterLastModification = (int) $data; } - return $this->store; + return $this->deleteDaysAfterLastModification; } /** - *

    The code of existing DiscountCodes.

    + *

    Custom Fields for the Cart.

    * * - * @return null|array + * @return null|CustomFieldsDraft */ - public function getDiscountCodes() + public function getCustom() { - if (is_null($this->discountCodes)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_DISCOUNT_CODES); + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->discountCodes = $data; + + $this->custom = CustomFieldsDraftModel::of($data); } - return $this->discountCodes; + return $this->custom; } @@ -500,19 +516,19 @@ public function setCustomerEmail(?string $customerEmail): void } /** - * @param ?string $country + * @param ?BusinessUnitResourceIdentifier $businessUnit */ - public function setCountry(?string $country): void + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void { - $this->country = $country; + $this->businessUnit = $businessUnit; } /** - * @param ?string $inventoryMode + * @param ?StoreResourceIdentifier $store */ - public function setInventoryMode(?string $inventoryMode): void + public function setStore(?StoreResourceIdentifier $store): void { - $this->inventoryMode = $inventoryMode; + $this->store = $store; } /** @@ -524,90 +540,90 @@ public function setLineItems(?MyLineItemDraftCollection $lineItems): void } /** - * @param ?BaseAddress $shippingAddress + * @param ?string $taxMode */ - public function setShippingAddress(?BaseAddress $shippingAddress): void + public function setTaxMode(?string $taxMode): void { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; } /** - * @param ?BaseAddress $billingAddress + * @param ?string $inventoryMode */ - public function setBillingAddress(?BaseAddress $billingAddress): void + public function setInventoryMode(?string $inventoryMode): void { - $this->billingAddress = $billingAddress; + $this->inventoryMode = $inventoryMode; } /** - * @param ?ShippingMethodResourceIdentifier $shippingMethod + * @param ?BaseAddress $billingAddress */ - public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void + public function setBillingAddress(?BaseAddress $billingAddress): void { - $this->shippingMethod = $shippingMethod; + $this->billingAddress = $billingAddress; } /** - * @param ?CustomFieldsDraft $custom + * @param ?BaseAddress $shippingAddress */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setShippingAddress(?BaseAddress $shippingAddress): void { - $this->custom = $custom; + $this->shippingAddress = $shippingAddress; } /** - * @param ?string $locale + * @param ?ShippingMethodResourceIdentifier $shippingMethod */ - public function setLocale(?string $locale): void + public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void { - $this->locale = $locale; + $this->shippingMethod = $shippingMethod; } /** - * @param ?string $taxMode + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setTaxMode(?string $taxMode): void + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void { - $this->taxMode = $taxMode; + $this->itemShippingAddresses = $itemShippingAddresses; } /** - * @param ?int $deleteDaysAfterLastModification + * @param ?array $discountCodes */ - public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void + public function setDiscountCodes(?array $discountCodes): void { - $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + $this->discountCodes = $discountCodes; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void + public function setCountry(?string $country): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->country = $country; } /** - * @param ?BusinessUnitKeyReference $businessUnit + * @param ?string $locale */ - public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + public function setLocale(?string $locale): void { - $this->businessUnit = $businessUnit; + $this->locale = $locale; } /** - * @param ?StoreKeyReference $store + * @param ?int $deleteDaysAfterLastModification */ - public function setStore(?StoreKeyReference $store): void + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void { - $this->store = $store; + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; } /** - * @param ?array $discountCodes + * @param ?CustomFieldsDraft $custom */ - public function setDiscountCodes(?array $discountCodes): void + public function setCustom(?CustomFieldsDraft $custom): void { - $this->discountCodes = $discountCodes; + $this->custom = $custom; } } diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php index b21d6b6f5c0..437e9e34993 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php @@ -16,6 +16,11 @@ interface MyCartRecalculateAction extends MyCartUpdateAction public const FIELD_UPDATE_PRODUCT_DATA = 'updateProductData'; /** + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    + * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php index 4aeb2ea6ef9..9b87108eb43 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php @@ -27,6 +27,11 @@ final class MyCartRecalculateActionBuilder implements Builder private $updateProductData; /** + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    + * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php index 99a90078215..59eb676cc0b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php @@ -63,6 +63,11 @@ public function getAction() } /** + *
      + *
    • Leave empty or set to false to only update the Prices and TaxRates of the Line Items.
    • + *
    • Set to true to update the Line Items' product data (like name, variant and productType) also.
    • + *
    + * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php index c9e5a1978de..a49d093784c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php @@ -17,7 +17,7 @@ interface MyCartRemoveDiscountCodeAction extends MyCartUpdateAction public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php index 7eab60a608b..e4d34bc4bd5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php @@ -29,7 +29,7 @@ final class MyCartRemoveDiscountCodeActionBuilder implements Builder private $discountCode; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php index 58eabe3f7b6..1d645aa9a42 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php index f47f1ba1af9..dab7c6cacc7 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php @@ -16,6 +16,8 @@ interface MyCartRemoveItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php index 503b86c73b5..9fe21ad6c8c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php @@ -27,6 +27,8 @@ final class MyCartRemoveItemShippingAddressActionBuilder implements Builder private $addressKey; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php index 5295ce5e0c6..4024c6ef8ab 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php index a7687340fc3..cc01d917478 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php @@ -23,20 +23,24 @@ interface MyCartRemoveLineItemAction extends MyCartUpdateAction public const FIELD_SHIPPING_DETAILS_TO_REMOVE = 'shippingDetailsToRemove'; /** + *

    id of the Line Item to remove.

    + * * @return null|string */ public function getLineItemId(); /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -44,12 +48,16 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + *

    Container for Line Item-specific addresses to remove.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php index 9b5dde43a11..45175f284b8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php @@ -57,6 +57,8 @@ final class MyCartRemoveLineItemActionBuilder implements Builder private $shippingDetailsToRemove; /** + *

    id of the Line Item to remove.

    + * * @return null|string */ @@ -66,6 +68,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * @return null|int */ @@ -75,8 +80,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -87,6 +91,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -96,6 +102,8 @@ public function getExternalTotalPrice() } /** + *

    Container for Line Item-specific addresses to remove.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php index 3491e7f1b65..1e4781d84b6 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php @@ -101,6 +101,8 @@ public function getAction() } /** + *

    id of the Line Item to remove.

    + * * * @return null|string */ @@ -119,6 +121,9 @@ public function getLineItemId() } /** + *

    New value to set.

    + *

    If 0, the Line Item is removed from the Cart.

    + * * * @return null|int */ @@ -137,8 +142,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -159,6 +163,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -178,6 +184,8 @@ public function getExternalTotalPrice() } /** + *

    Container for Line Item-specific addresses to remove.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php index f5280703207..f6e11194746 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php @@ -17,7 +17,7 @@ interface MyCartRemovePaymentAction extends MyCartUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the Cart.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php index 2d0f389c6a9..0a19771f162 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php @@ -29,7 +29,7 @@ final class MyCartRemovePaymentActionBuilder implements Builder private $payment; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the Cart.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php index 88521f72b15..c4cf6b7f471 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the Cart.

    * * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php index a3c6a69ce0f..9792784411c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php @@ -17,9 +17,8 @@ interface MyCartSetBillingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php index 49aafe4ffbb..a187f725390 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class MyCartSetBillingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php index 691dbd6151e..29e6d7dec2a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitAction.php new file mode 100644 index 00000000000..cebfc5325f7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitAction.php @@ -0,0 +1,32 @@ +New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart. + * Additionally, the authenticated user must have Buyer access to the Business Unit.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit(); + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionBuilder.php new file mode 100644 index 00000000000..25c843b1556 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionBuilder.php @@ -0,0 +1,76 @@ + + */ +final class MyCartSetBusinessUnitActionBuilder implements Builder +{ + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $businessUnit; + + /** + *

    New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart. + * Additionally, the authenticated user must have Buyer access to the Business Unit.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + public function build(): MyCartSetBusinessUnitAction + { + return new MyCartSetBusinessUnitActionModel( + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit + ); + } + + public static function of(): MyCartSetBusinessUnitActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionCollection.php b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionCollection.php new file mode 100644 index 00000000000..cb3c70f7cf0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyCartSetBusinessUnitAction current() + * @method MyCartSetBusinessUnitAction end() + * @method MyCartSetBusinessUnitAction at($offset) + */ +class MyCartSetBusinessUnitActionCollection extends MyCartUpdateActionCollection +{ + /** + * @psalm-assert MyCartSetBusinessUnitAction $value + * @psalm-param MyCartSetBusinessUnitAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyCartSetBusinessUnitActionCollection + */ + public function add($value) + { + if (!$value instanceof MyCartSetBusinessUnitAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyCartSetBusinessUnitAction + */ + protected function mapper() + { + return function (?int $index): ?MyCartSetBusinessUnitAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyCartSetBusinessUnitAction $data */ + $data = MyCartSetBusinessUnitActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionModel.php new file mode 100644 index 00000000000..48888f96c13 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBusinessUnitActionModel.php @@ -0,0 +1,97 @@ +businessUnit = $businessUnit; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart. + * Additionally, the authenticated user must have Buyer access to the Business Unit.

    + * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->businessUnit; + } + + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + { + $this->businessUnit = $businessUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php index 09d9e715d93..aa210073d80 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php @@ -16,7 +16,10 @@ interface MyCartSetCountryAction extends MyCartUpdateAction public const FIELD_COUNTRY = 'country'; /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php index 591f0d3be47..cc226f84a60 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php @@ -27,7 +27,10 @@ final class MyCartSetCountryActionBuilder implements Builder private $country; /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php index 44ddfe423ba..73013a8f26c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php @@ -63,7 +63,10 @@ public function getAction() } /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php index e52799b887c..0bffbd6935f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php @@ -19,8 +19,8 @@ interface MyCartSetCustomTypeAction extends MyCartUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

    Defines the Type that extends the MyCart with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the MyCart.

    + *

    Defines the Type that extends the Cart with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Cart.

    * * @return null|TypeResourceIdentifier @@ -28,7 +28,7 @@ interface MyCartSetCustomTypeAction extends MyCartUpdateAction public function getType(); /** - *

    Sets the Custom Fields fields for the MyCart.

    + *

    Sets the Custom Fields fields for the Cart.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php index 333ef2068f6..183b000268e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php @@ -37,8 +37,8 @@ final class MyCartSetCustomTypeActionBuilder implements Builder private $fields; /** - *

    Defines the Type that extends the MyCart with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the MyCart.

    + *

    Defines the Type that extends the Cart with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Cart.

    * * @return null|TypeResourceIdentifier @@ -49,7 +49,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the MyCart.

    + *

    Sets the Custom Fields fields for the Cart.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php index 45a84f226b2..97b8f246c38 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php @@ -75,8 +75,8 @@ public function getAction() } /** - *

    Defines the Type that extends the MyCart with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the MyCart.

    + *

    Defines the Type that extends the Cart with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Cart.

    * * * @return null|TypeResourceIdentifier @@ -97,7 +97,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the MyCart.

    + *

    Sets the Custom Fields fields for the Cart.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php index ff7efd284c7..b14b58c429b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php @@ -16,6 +16,9 @@ interface MyCartSetCustomerEmailAction extends MyCartUpdateAction public const FIELD_EMAIL = 'email'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php index 1abbff87064..067784628f1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php @@ -27,6 +27,9 @@ final class MyCartSetCustomerEmailActionBuilder implements Builder private $email; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php index e4b720f13ff..f4db7aa01e8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php index c31d6c95644..fc2912baf9b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,9 @@ interface MyCartSetDeleteDaysAfterLastModificationAction extends MyCartUpdateAct public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php index 2e856d4c629..7eb9b6b9703 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php @@ -27,6 +27,9 @@ final class MyCartSetDeleteDaysAfterLastModificationActionBuilder implements Bui private $deleteDaysAfterLastModification; /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php index b09bfc03304..40534a98492 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

    Value to set. + * If not provided, the default value for this field configured in Project settings is assigned.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php index 0c4adf92c2d..4de39189928 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php @@ -18,6 +18,8 @@ interface MyCartSetLineItemCustomFieldAction extends MyCartUpdateAction public const FIELD_VALUE = 'value'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php index 4351ece5dfe..8d01050996c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class MyCartSetLineItemCustomFieldActionBuilder implements Builder private $value; /** + *

    id of the LineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php index 5b92a62bf14..f4dad37d0a1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php index 0e7d84a6bf9..344dc0b429e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php @@ -20,6 +20,8 @@ interface MyCartSetLineItemCustomTypeAction extends MyCartUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -27,7 +29,7 @@ public function getLineItemId(); /** *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * @return null|TypeResourceIdentifier @@ -35,7 +37,7 @@ public function getLineItemId(); public function getType(); /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php index f07e13a7953..36ca404da8b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class MyCartSetLineItemCustomTypeActionBuilder implements Builder private $fields; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -53,7 +55,7 @@ public function getLineItemId() /** *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * @return null|TypeResourceIdentifier @@ -64,7 +66,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php index b1b088bd92f..f7954d1040b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -102,7 +104,7 @@ public function getLineItemId() /** *

    Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

    + * If absent, any existing Type and Custom Fields are removed from the Line Item.

    * * * @return null|TypeResourceIdentifier @@ -123,7 +125,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the LineItem.

    + *

    Sets the Custom Fields fields for the Line Item.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php index db0215a9a87..6b4476d01a4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php @@ -18,13 +18,19 @@ interface MyCartSetLineItemDistributionChannelAction extends MyCartUpdateAction public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php index 205152bf2a9..7460bb3721e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php @@ -35,6 +35,8 @@ final class MyCartSetLineItemDistributionChannelActionBuilder implements Builder private $distributionChannel; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,7 +46,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php index a1110b7b220..38edb010887 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,7 +93,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
    • + *
    * * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php index d95908de315..d48d40f4395 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php @@ -18,12 +18,17 @@ interface MyCartSetLineItemShippingDetailsAction extends MyCartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php index f2df0770070..e3d4127cc04 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php @@ -35,6 +35,8 @@ final class MyCartSetLineItemShippingDetailsActionBuilder implements Builder private $shippingDetails; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,6 +46,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php index 91f754f7b32..65c9cf730b9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,6 +93,9 @@ public function getLineItemId() } /** + *

    Value to set. + * If empty, the existing value is removed.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php index 5f2d65d0811..f24d5f82b71 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php @@ -18,13 +18,19 @@ interface MyCartSetLineItemSupplyChannelAction extends MyCartUpdateAction public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php index 8dbfdd0eacc..7296e91f304 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php @@ -35,6 +35,8 @@ final class MyCartSetLineItemSupplyChannelActionBuilder implements Builder private $supplyChannel; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -44,7 +46,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php index 91c22991bf9..4e590093c73 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -91,7 +93,11 @@ public function getLineItemId() } /** - *

    ResourceIdentifier to a Channel.

    + *
      + *
    • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
    • + *
    • If not present, the current Reference to a supply channel will be removed from the LineItem specified by lineItemId. + * The Channel must have the InventorySupply ChannelRoleEnum.
    • + *
    * * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php index 478c2948133..7903f267b81 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php @@ -16,6 +16,10 @@ interface MyCartSetLocaleAction extends MyCartUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php index 4a68a561ddb..c6a866c7f29 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php @@ -27,6 +27,10 @@ final class MyCartSetLocaleActionBuilder implements Builder private $locale; /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php index 23bbab7ec8d..fdc54bdd49f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php @@ -63,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * Must be one of the Project's languages. + * If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php index 38bab918d1a..cd2803152e5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php @@ -17,9 +17,8 @@ interface MyCartSetShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php index 034865bf26b..f635e5b2209 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class MyCartSetShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php index e3498ea8a4b..795e164883b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php index f534d969137..db9b5e8d445 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php @@ -19,7 +19,9 @@ interface MyCartSetShippingMethodAction extends MyCartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * @return null|ShippingMethodResourceIdentifier @@ -27,6 +29,8 @@ interface MyCartSetShippingMethodAction extends MyCartUpdateAction public function getShippingMethod(); /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php index e09c164fb98..5fed588a921 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php @@ -37,7 +37,9 @@ final class MyCartSetShippingMethodActionBuilder implements Builder private $externalTaxRate; /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * @return null|ShippingMethodResourceIdentifier @@ -48,6 +50,8 @@ public function getShippingMethod() } /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php index 47254b24d19..7206fb59148 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php @@ -75,7 +75,9 @@ public function getAction() } /** - *

    ResourceIdentifier to a ShippingMethod.

    + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

    * * * @return null|ShippingMethodResourceIdentifier @@ -96,6 +98,8 @@ public function getShippingMethod() } /** + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdate.php b/lib/commercetools-api/src/Models/Me/MyCartUpdate.php index 41fc903e3b8..07e0cb5537a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdate.php @@ -17,12 +17,17 @@ interface MyCartUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Cart on which the changes apply. + * If it does not match the actual version, a 409 Conflict error is returned.

    + * * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Cart.

    + * * @return null|MyCartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php index d1ee2a8e256..28b570caef8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php @@ -44,6 +44,7 @@ final class MyCartUpdateActionModel extends JsonObjectModel implements MyCartUpd 'removeLineItem' => MyCartRemoveLineItemActionModel::class, 'removePayment' => MyCartRemovePaymentActionModel::class, 'setBillingAddress' => MyCartSetBillingAddressActionModel::class, + 'setBusinessUnit' => MyCartSetBusinessUnitActionModel::class, 'setCountry' => MyCartSetCountryActionModel::class, 'setCustomField' => MyCartSetCustomFieldActionModel::class, 'setCustomType' => MyCartSetCustomTypeActionModel::class, diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php index 834929576f0..553af459ade 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php @@ -33,6 +33,9 @@ final class MyCartUpdateBuilder implements Builder private $actions; /** + *

    Expected version of the Cart on which the changes apply. + * If it does not match the actual version, a 409 Conflict error is returned.

    + * * @return null|int */ @@ -42,6 +45,8 @@ public function getVersion() } /** + *

    Update actions to be performed on the Cart.

    + * * @return null|MyCartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php index e69f84d21e4..a615abef280 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php @@ -17,9 +17,7 @@ interface MyCartUpdateItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php index a64242ce94f..ebcf7bcc813 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php @@ -29,9 +29,7 @@ final class MyCartUpdateItemShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php index d2e76b4971b..6ac5a25115b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php @@ -65,9 +65,7 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    The new Address with the same key as the Address it will replace.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php index 68b62136636..657cb95f1d1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php @@ -44,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Cart on which the changes apply. + * If it does not match the actual version, a 409 Conflict error is returned.

    + * * * @return null|int */ @@ -62,6 +65,8 @@ public function getVersion() } /** + *

    Update actions to be performed on the Cart.

    + * * * @return null|MyCartUpdateActionCollection */ diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php index 551f31c0f94..f06ed9dba8d 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php @@ -19,35 +19,51 @@ interface MyLineItemDraft extends JsonObject { public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; + public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; - public const FIELD_SKU = 'sku'; + public const FIELD_CUSTOM = 'custom'; /** + *

    id of the Product.

    + * * @return null|string */ public function getProductId(); /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * @return null|int */ public function getVariantId(); /** + *

    sku of the ProductVariant.

    + * + + * @return null|string + */ + public function getSku(); + + /** + *

    Number of Product Variants to add to the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * @return null|DateTimeImmutable @@ -55,9 +71,8 @@ public function getQuantity(); public function getAddedAt(); /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -65,8 +80,10 @@ public function getAddedAt(); public function getSupplyChannel(); /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * @return null|ChannelResourceIdentifier @@ -74,15 +91,7 @@ public function getSupplyChannel(); public function getDistributionChannel(); /** - *

    The custom fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom(); - - /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft @@ -90,10 +99,12 @@ public function getCustom(); public function getShippingDetails(); /** + *

    Custom Fields for the Cart.

    + * - * @return null|string + * @return null|CustomFieldsDraft */ - public function getSku(); + public function getCustom(); /** * @param ?string $productId @@ -105,6 +116,11 @@ public function setProductId(?string $productId): void; */ public function setVariantId(?int $variantId): void; + /** + * @param ?string $sku + */ + public function setSku(?string $sku): void; + /** * @param ?int $quantity */ @@ -125,18 +141,13 @@ public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): voi */ public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; - /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void; - /** * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; /** - * @param ?string $sku + * @param ?CustomFieldsDraft $custom */ - public function setSku(?string $sku): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php index 4cef978700d..d84b7c768c1 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php @@ -39,6 +39,12 @@ final class MyLineItemDraftBuilder implements Builder */ private $variantId; + /** + + * @var ?string + */ + private $sku; + /** * @var ?int @@ -63,12 +69,6 @@ final class MyLineItemDraftBuilder implements Builder */ private $distributionChannel; - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder - */ - private $custom; - /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -77,11 +77,13 @@ final class MyLineItemDraftBuilder implements Builder /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - private $sku; + private $custom; /** + *

    id of the Product.

    + * * @return null|string */ @@ -91,6 +93,9 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * @return null|int */ @@ -100,6 +105,19 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + * + + * @return null|string + */ + public function getSku() + { + return $this->sku; + } + + /** + *

    Number of Product Variants to add to the Cart.

    + * * @return null|int */ @@ -109,8 +127,9 @@ public function getQuantity() } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * @return null|DateTimeImmutable @@ -121,9 +140,8 @@ public function getAddedAt() } /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -134,8 +152,10 @@ public function getSupplyChannel() } /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * @return null|ChannelResourceIdentifier @@ -146,18 +166,7 @@ public function getDistributionChannel() } /** - *

    The custom fields.

    - * - - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; - } - - /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * @return null|ItemShippingDetailsDraft @@ -168,12 +177,14 @@ public function getShippingDetails() } /** + *

    Custom Fields for the Cart.

    + * - * @return null|string + * @return null|CustomFieldsDraft */ - public function getSku() + public function getCustom() { - return $this->sku; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -198,6 +209,17 @@ public function withVariantId(?int $variantId) return $this; } + /** + * @param ?string $sku + * @return $this + */ + public function withSku(?string $sku) + { + $this->sku = $sku; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -242,17 +264,6 @@ public function withDistributionChannel(?ChannelResourceIdentifier $distribution return $this; } - /** - * @param ?CustomFieldsDraft $custom - * @return $this - */ - public function withCustom(?CustomFieldsDraft $custom) - { - $this->custom = $custom; - - return $this; - } - /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -265,12 +276,12 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) } /** - * @param ?string $sku + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withSku(?string $sku) + public function withCustom(?CustomFieldsDraft $custom) { - $this->sku = $sku; + $this->custom = $custom; return $this; } @@ -298,23 +309,23 @@ public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withShippingDetails() instead + * @deprecated use withCustom() instead * @return $this */ - public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->shippingDetails = $shippingDetails; + $this->custom = $custom; return $this; } @@ -324,13 +335,13 @@ public function build(): MyLineItemDraft return new MyLineItemDraftModel( $this->productId, $this->variantId, + $this->sku, $this->quantity, $this->addedAt, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, - $this->sku + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php index 816d21a3b86..0fd843296f8 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php @@ -38,6 +38,12 @@ final class MyLineItemDraftModel extends JsonObjectModel implements MyLineItemDr */ protected $variantId; + /** + * + * @var ?string + */ + protected $sku; + /** * * @var ?int @@ -62,12 +68,6 @@ final class MyLineItemDraftModel extends JsonObjectModel implements MyLineItemDr */ protected $distributionChannel; - /** - * - * @var ?CustomFieldsDraft - */ - protected $custom; - /** * * @var ?ItemShippingDetailsDraft @@ -76,9 +76,9 @@ final class MyLineItemDraftModel extends JsonObjectModel implements MyLineItemDr /** * - * @var ?string + * @var ?CustomFieldsDraft */ - protected $sku; + protected $custom; /** @@ -87,26 +87,28 @@ final class MyLineItemDraftModel extends JsonObjectModel implements MyLineItemDr public function __construct( ?string $productId = null, ?int $variantId = null, + ?string $sku = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, ?ChannelResourceIdentifier $supplyChannel = null, ?ChannelResourceIdentifier $distributionChannel = null, - ?CustomFieldsDraft $custom = null, ?ItemShippingDetailsDraft $shippingDetails = null, - ?string $sku = null + ?CustomFieldsDraft $custom = null ) { $this->productId = $productId; $this->variantId = $variantId; + $this->sku = $sku; $this->quantity = $quantity; $this->addedAt = $addedAt; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->custom = $custom; $this->shippingDetails = $shippingDetails; - $this->sku = $sku; + $this->custom = $custom; } /** + *

    id of the Product.

    + * * * @return null|string */ @@ -125,6 +127,9 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + * * * @return null|int */ @@ -143,6 +148,28 @@ public function getVariantId() } /** + *

    sku of the ProductVariant.

    + * + * + * @return null|string + */ + public function getSku() + { + if (is_null($this->sku)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SKU); + if (is_null($data)) { + return null; + } + $this->sku = (string) $data; + } + + return $this->sku; + } + + /** + *

    Number of Product Variants to add to the Cart.

    + * * * @return null|int */ @@ -161,8 +188,9 @@ public function getQuantity() } /** - *

    When the line item was added to the cart. Optional for backwards - * compatibility reasons only.

    + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    * * * @return null|DateTimeImmutable @@ -186,9 +214,8 @@ public function getAddedAt() } /** - *

    By providing supply channel information, you can unique identify - * inventory entries that should be reserved. - * The provided channel should have the InventorySupply role.

    + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier @@ -209,8 +236,10 @@ public function getSupplyChannel() } /** - *

    The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    + *

    If the Cart is bound to a Store with distributionChannels set, + * the Channel must match one of the Store's distribution channels.

    * * * @return null|ChannelResourceIdentifier @@ -231,28 +260,7 @@ public function getDistributionChannel() } /** - *

    The custom fields.

    - * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); - if (is_null($data)) { - return null; - } - - $this->custom = CustomFieldsDraftModel::of($data); - } - - return $this->custom; - } - - /** - *

    Container for line item specific address(es).

    + *

    Container for Line Item-specific addresses.

    * * * @return null|ItemShippingDetailsDraft @@ -273,21 +281,24 @@ public function getShippingDetails() } /** + *

    Custom Fields for the Cart.

    * - * @return null|string + * + * @return null|CustomFieldsDraft */ - public function getSku() + public function getCustom() { - if (is_null($this->sku)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SKU); + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->sku = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } - return $this->sku; + return $this->custom; } @@ -307,6 +318,14 @@ public function setVariantId(?int $variantId): void $this->variantId = $variantId; } + /** + * @param ?string $sku + */ + public function setSku(?string $sku): void + { + $this->sku = $sku; + } + /** * @param ?int $quantity */ @@ -339,14 +358,6 @@ public function setDistributionChannel(?ChannelResourceIdentifier $distributionC $this->distributionChannel = $distributionChannel; } - /** - * @param ?CustomFieldsDraft $custom - */ - public function setCustom(?CustomFieldsDraft $custom): void - { - $this->custom = $custom; - } - /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -356,11 +367,11 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): } /** - * @param ?string $sku + * @param ?CustomFieldsDraft $custom */ - public function setSku(?string $sku): void + public function setCustom(?CustomFieldsDraft $custom): void { - $this->sku = $sku; + $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php new file mode 100644 index 00000000000..a8d1d4ba4ff --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php @@ -0,0 +1,58 @@ +Unique identifier of the Quote from which the Order is created.

    + * + + * @return null|string + */ + public function getId(); + + /** + *

    version of the Quote from which the Order is created.

    + * + + * @return null|int + */ + public function getVersion(); + + /** + *

    Set to true, if the quoteState of the referenced Quote should be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteStateToAccepted(); + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?bool $quoteStateToAccepted + */ + public function setQuoteStateToAccepted(?bool $quoteStateToAccepted): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php new file mode 100644 index 00000000000..252f76783f0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php @@ -0,0 +1,121 @@ + + */ +final class MyOrderFromQuoteDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?bool + */ + private $quoteStateToAccepted; + + /** + *

    Unique identifier of the Quote from which the Order is created.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    version of the Quote from which the Order is created.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Set to true, if the quoteState of the referenced Quote should be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteStateToAccepted() + { + return $this->quoteStateToAccepted; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?bool $quoteStateToAccepted + * @return $this + */ + public function withQuoteStateToAccepted(?bool $quoteStateToAccepted) + { + $this->quoteStateToAccepted = $quoteStateToAccepted; + + return $this; + } + + + public function build(): MyOrderFromQuoteDraft + { + return new MyOrderFromQuoteDraftModel( + $this->id, + $this->version, + $this->quoteStateToAccepted + ); + } + + public static function of(): MyOrderFromQuoteDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftCollection.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftCollection.php new file mode 100644 index 00000000000..4757d3be93c --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftCollection.php @@ -0,0 +1,56 @@ + + * @method MyOrderFromQuoteDraft current() + * @method MyOrderFromQuoteDraft end() + * @method MyOrderFromQuoteDraft at($offset) + */ +class MyOrderFromQuoteDraftCollection extends MapperSequence +{ + /** + * @psalm-assert MyOrderFromQuoteDraft $value + * @psalm-param MyOrderFromQuoteDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return MyOrderFromQuoteDraftCollection + */ + public function add($value) + { + if (!$value instanceof MyOrderFromQuoteDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyOrderFromQuoteDraft + */ + protected function mapper() + { + return function (?int $index): ?MyOrderFromQuoteDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyOrderFromQuoteDraft $data */ + $data = MyOrderFromQuoteDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php new file mode 100644 index 00000000000..e0d19a693c5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php @@ -0,0 +1,138 @@ +id = $id; + $this->version = $version; + $this->quoteStateToAccepted = $quoteStateToAccepted; + } + + /** + *

    Unique identifier of the Quote from which the Order is created.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    version of the Quote from which the Order is created.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Set to true, if the quoteState of the referenced Quote should be set to Accepted.

    + * + * + * @return null|bool + */ + public function getQuoteStateToAccepted() + { + if (is_null($this->quoteStateToAccepted)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_QUOTE_STATE_TO_ACCEPTED); + if (is_null($data)) { + return null; + } + $this->quoteStateToAccepted = (bool) $data; + } + + return $this->quoteStateToAccepted; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?bool $quoteStateToAccepted + */ + public function setQuoteStateToAccepted(?bool $quoteStateToAccepted): void + { + $this->quoteStateToAccepted = $quoteStateToAccepted; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyPayment.php b/lib/commercetools-api/src/Models/Me/MyPayment.php index 73885c7d327..f43dc9dff0d 100644 --- a/lib/commercetools-api/src/Models/Me/MyPayment.php +++ b/lib/commercetools-api/src/Models/Me/MyPayment.php @@ -52,7 +52,7 @@ public function getVersion(); public function getCustomer(); /** - *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    + *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php index 288c9fa83df..16dd8d63e90 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php @@ -111,7 +111,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    + *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentModel.php index ae017e7a7dc..017ed4fb8dd 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentModel.php @@ -162,7 +162,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    + *

    Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either customer or anonymousId is present.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php index f7e4fe26d1d..41ba2400bff 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php @@ -18,6 +18,8 @@ interface ReplicaMyCartDraft extends JsonObject public const FIELD_REFERENCE = 'reference'; /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|mixed */ diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php index e65a70fedd7..13ce718a443 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php @@ -27,6 +27,8 @@ final class ReplicaMyCartDraftBuilder implements Builder private $reference; /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|JsonObject */ diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php index 0ba6da88eab..3d8f56824d8 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php @@ -40,6 +40,8 @@ public function __construct( } /** + *

    Reference to a Cart or Order that is replicated.

    + * * * @return ?mixed */ @@ -58,6 +60,8 @@ public function getReference() } /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|CartReference */ public function getReferenceAsCartReference() @@ -72,6 +76,8 @@ public function getReferenceAsCartReference() } /** + *

    Reference to a Cart or Order that is replicated.

    + * * @return null|OrderReference */ public function getReferenceAsOrderReference() diff --git a/lib/commercetools-api/src/Models/Order/Order.php b/lib/commercetools-api/src/Models/Order/Order.php index 15107a9fc2e..2f0a85e56ad 100644 --- a/lib/commercetools-api/src/Models/Order/Order.php +++ b/lib/commercetools-api/src/Models/Order/Order.php @@ -403,7 +403,13 @@ public function getOrigin(); public function getTaxCalculationMode(); /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * @return null|ShippingRateInput diff --git a/lib/commercetools-api/src/Models/Order/OrderBuilder.php b/lib/commercetools-api/src/Models/Order/OrderBuilder.php index 9fe5f6275a0..d692dff1a2f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderBuilder.php @@ -796,7 +796,13 @@ public function getTaxCalculationMode() } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * @return null|ShippingRateInput diff --git a/lib/commercetools-api/src/Models/Order/OrderModel.php b/lib/commercetools-api/src/Models/Order/OrderModel.php index fc42cb03207..867d86e48a6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderModel.php @@ -1321,7 +1321,13 @@ public function getTaxCalculationMode() } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * * @return null|ShippingRateInput diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php index ad30911a378..3565bb3510a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php @@ -24,6 +24,8 @@ interface OrderSetCustomLineItemShippingDetailsAction extends OrderUpdateAction public function getCustomLineItemId(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php index 1dead66df8b..a2b83b26dbe 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -44,6 +44,8 @@ public function getCustomLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php index 3f49aff1156..bcbf8177ca9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php @@ -91,6 +91,8 @@ public function getCustomLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php index fdd73c3f4c0..d0f87c0c18b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php @@ -24,6 +24,8 @@ interface OrderSetLineItemShippingDetailsAction extends OrderUpdateAction public function getLineItemId(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php index 1d6ec8c9ed3..a173328b392 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php @@ -44,6 +44,8 @@ public function getLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php index 11e36ee24fb..1169edfa289 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php @@ -91,6 +91,8 @@ public function getLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php index fb4aefdf3f6..6b747fa999b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php @@ -74,6 +74,8 @@ public function getTaxCategory(); public function getCustom(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php index 040258a41ac..5cb5d8491a5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php @@ -144,6 +144,8 @@ public function getCustom() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php index c64306a55ce..343ddb97143 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php @@ -252,6 +252,8 @@ public function getCustom() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php index 22a31e3ddc0..f43abff9226 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php @@ -51,6 +51,8 @@ public function getCustom(); public function getDistributionChannel(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ @@ -110,6 +112,8 @@ public function getExternalPrice(); public function getExternalTotalPrice(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php index 273a14c58fc..036e64ce7c9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php @@ -130,6 +130,8 @@ public function getDistributionChannel() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ @@ -216,6 +218,8 @@ public function getExternalTotalPrice() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php index b5e89d65598..c2108ae14b9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php @@ -208,6 +208,8 @@ public function getDistributionChannel() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ @@ -383,6 +385,8 @@ public function getExternalTotalPrice() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php index 15885133b04..332efda9fac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php @@ -798,7 +798,13 @@ public function getTaxCalculationMode() } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * @return null|ShippingRateInput diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php index 892831fc72e..782d626f32b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangeTaxCalculationModeAction extends StagedOrderUpdateAct public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; /** + *

    Determines in which Tax calculation mode taxed prices are calculated.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php index e0f2390a938..2cf2eed242c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangeTaxCalculationModeActionBuilder implements Builder private $taxCalculationMode; /** + *

    Determines in which Tax calculation mode taxed prices are calculated.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php index 84ed950128c..0acb6b71b37 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    Determines in which Tax calculation mode taxed prices are calculated.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php index b9efd19cc52..04dd4a1befa 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangeTaxModeAction extends StagedOrderUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + *

    Indicates how taxes are set on the Cart.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php index f7f7b4f8eed..80b68f8ae48 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangeTaxModeActionBuilder implements Builder private $taxMode; /** + *

    Indicates how taxes are set on the Cart.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php index 6c6afc6035f..897d02b4b9b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    Indicates how taxes are set on the Cart.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php index 29487269b0b..851b04ab326 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangeTaxRoundingModeAction extends StagedOrderUpdateAction public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; /** + *

    Determines how monetary values are rounded.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php index e8c6d276076..12f4024f783 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangeTaxRoundingModeActionBuilder implements Builder private $taxRoundingMode; /** + *

    Determines how monetary values are rounded.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php index 1266b74f67a..898e2f337b2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    Determines how monetary values are rounded.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php index f746587e58f..30b9afbfbc6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php @@ -1323,7 +1323,13 @@ public function getTaxCalculationMode() } /** - *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * * @return null|ShippingRateInput diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php index e7372367ac7..0d98dcc2a48 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php @@ -51,6 +51,8 @@ public function getExternalPrice(); public function getExternalTotalPrice(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php index 69e18c1eae0..8c91919f843 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php @@ -98,6 +98,8 @@ public function getExternalTotalPrice() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php index cc1f6c425dd..1be1a7a828c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php @@ -180,6 +180,8 @@ public function getExternalTotalPrice() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php index 97167fa474b..0c699fa4aa2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php @@ -25,6 +25,8 @@ interface StagedOrderSetCustomLineItemShippingDetailsAction extends StagedOrderU public function getCustomLineItemId(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php index 974e669c74f..5762f34ffd1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -46,6 +46,8 @@ public function getCustomLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php index a0910a2eb21..75936345cc9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php @@ -93,6 +93,8 @@ public function getCustomLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php index 3e9db629329..0f462bf11b1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php @@ -25,6 +25,13 @@ interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateA public function getCustomLineItemId(); /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php index cdc1beef9cd..c2adfbe494d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php @@ -46,6 +46,13 @@ public function getCustomLineItemId() } /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php index b6cbec56061..34e7133f119 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php @@ -93,6 +93,13 @@ public function getCustomLineItemId() } /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php index 3d480f0167e..3a8855ec3d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php @@ -25,6 +25,8 @@ interface StagedOrderSetCustomLineItemTaxRateAction extends StagedOrderUpdateAct public function getCustomLineItemId(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php index 80867a2c68e..b4c623143ce 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php @@ -46,6 +46,8 @@ public function getCustomLineItemId() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php index 9de5a0498ba..92760105b66 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php @@ -93,6 +93,8 @@ public function getCustomLineItemId() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php index 605fa01c95e..f1c78a539d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php @@ -43,6 +43,8 @@ public function getShippingRate(); public function getTaxCategory(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php index c2fe92c9217..ab88ccb6a01 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php @@ -82,6 +82,8 @@ public function getTaxCategory() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php index 4df38a3a0ee..b7e362cc062 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php @@ -153,6 +153,8 @@ public function getTaxCategory() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php index 5ae38a5a7b4..79879222283 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php @@ -25,6 +25,8 @@ interface StagedOrderSetLineItemShippingDetailsAction extends StagedOrderUpdateA public function getLineItemId(); /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php index cd6271f6ada..6d7c696f183 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php @@ -46,6 +46,8 @@ public function getLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php index 27fe32dd31f..98f2629773e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php @@ -93,6 +93,8 @@ public function getLineItemId() } /** + *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + * * * @return null|ItemShippingDetailsDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php index 147f391aa32..87203629091 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php @@ -26,6 +26,13 @@ interface StagedOrderSetLineItemTaxAmountAction extends StagedOrderUpdateAction public function getLineItemId(); /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php index 4e3fb75ad54..b93123f84f1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php @@ -52,6 +52,13 @@ public function getLineItemId() } /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php index 7402dac2e20..c515e23d103 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php @@ -101,6 +101,13 @@ public function getLineItemId() } /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php index dbda4593650..cae51c44c99 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php @@ -26,6 +26,8 @@ interface StagedOrderSetLineItemTaxRateAction extends StagedOrderUpdateAction public function getLineItemId(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php index 59c659f83e8..9385b07c0db 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php @@ -52,6 +52,8 @@ public function getLineItemId() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php index f61b5c7e7f2..e344969aa5b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php @@ -101,6 +101,8 @@ public function getLineItemId() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php index e3f9c17d9dc..cc315177e63 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php @@ -55,6 +55,8 @@ public function getShippingRate(); public function getTaxCategory(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php index dd123818407..b2081c7d30f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php @@ -103,6 +103,8 @@ public function getTaxCategory() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php index bf6384dbbf3..166378b9e19 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php @@ -186,6 +186,8 @@ public function getTaxCategory() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php index 8095ac422d4..c83db7d7337 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php @@ -40,6 +40,8 @@ public function getAddress(); public function getShippingMethod(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php index b9530a731a9..f7481ce5a78 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php @@ -71,6 +71,8 @@ public function getShippingMethod() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php index de596d779b2..076269e30ff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php @@ -131,6 +131,8 @@ public function getShippingMethod() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php index 73c21e17dbf..f81b3c70294 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php @@ -28,6 +28,8 @@ interface StagedOrderSetShippingMethodAction extends StagedOrderUpdateAction public function getShippingMethod(); /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php index f87fd1e5c78..ef914ad88a1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php @@ -50,6 +50,8 @@ public function getShippingMethod() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php index 151019dc289..8ef9d9edbde 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php @@ -98,6 +98,8 @@ public function getShippingMethod() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php index cac37d0e019..9eb3914fad2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php @@ -18,6 +18,13 @@ interface StagedOrderSetShippingMethodTaxAmountAction extends StagedOrderUpdateA public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php index 93e7df1f344..176255af76b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php @@ -31,6 +31,13 @@ final class StagedOrderSetShippingMethodTaxAmountActionBuilder implements Builde private $externalTaxAmount; /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php index ecc6df5e50f..03696795054 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php @@ -67,6 +67,13 @@ public function getAction() } /** + *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    + *

    Can only be set by these update actions:

    + * + * * * @return null|ExternalTaxAmountDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php index 4950d9c13bf..cdb28e51406 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php @@ -18,6 +18,8 @@ interface StagedOrderSetShippingMethodTaxRateAction extends StagedOrderUpdateAct public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php index 199f083faaf..04117ea674f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php @@ -31,6 +31,8 @@ final class StagedOrderSetShippingMethodTaxRateActionBuilder implements Builder private $externalTaxRate; /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php index 3cce576314e..924f944853c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php @@ -67,6 +67,8 @@ public function getAction() } /** + *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + * * * @return null|ExternalTaxRateDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php index 3d6eacd1669..aa012d5164d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php @@ -18,6 +18,8 @@ interface StagedOrderSetShippingRateInputAction extends StagedOrderUpdateAction public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; /** + *

    Generic type holding specifc ShippingRateInputDraft types.

    + * * @return null|ShippingRateInputDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php index da94afb071c..60671ac7fd7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php @@ -31,6 +31,8 @@ final class StagedOrderSetShippingRateInputActionBuilder implements Builder private $shippingRateInput; /** + *

    Generic type holding specifc ShippingRateInputDraft types.

    + * * @return null|ShippingRateInputDraft */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php index 80ae410900e..4400b42fc6b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php @@ -67,6 +67,8 @@ public function getAction() } /** + *

    Generic type holding specifc ShippingRateInputDraft types.

    + * * * @return null|ShippingRateInputDraft */ diff --git a/lib/commercetools-api/src/Models/Payment/Payment.php b/lib/commercetools-api/src/Models/Payment/Payment.php index 102ffc9d83f..51a833ec6eb 100644 --- a/lib/commercetools-api/src/Models/Payment/Payment.php +++ b/lib/commercetools-api/src/Models/Payment/Payment.php @@ -97,7 +97,7 @@ public function getCreatedBy(); public function getCustomer(); /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php index e0be7ee5e73..87be4262642 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php @@ -240,7 +240,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php index 9b36f376eee..e0c8fdfd2c0 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php @@ -42,7 +42,7 @@ interface PaymentDraft extends JsonObject public function getCustomer(); /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php index ab4fbf654cf..afca348155e 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php @@ -129,7 +129,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php index 3f2bb0d10f8..367e847f380 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php @@ -176,7 +176,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Payment/PaymentModel.php b/lib/commercetools-api/src/Models/Payment/PaymentModel.php index 81ccd84fe02..97994dac05c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentModel.php @@ -363,7 +363,7 @@ public function getCustomer() } /** - *

    Anonymous session associated with the Payment.

    + *

    Anonymous session associated with the Payment.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/Project/CartsConfiguration.php b/lib/commercetools-api/src/Models/Project/CartsConfiguration.php index 36940af9ac2..916a488090e 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfiguration.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfiguration.php @@ -17,7 +17,9 @@ interface CartsConfiguration extends JsonObject public const FIELD_COUNTRY_TAX_RATE_FALLBACK_ENABLED = 'countryTaxRateFallbackEnabled'; /** - *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    + *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft and MyCartDraft. + * If a ChangeSubscription for Carts exists, a ResourceDeletedDeliveryPayload is sent upon deletion of a Cart.

    + *

    This field may not be present on Projects created before January 2020.

    * * @return null|int diff --git a/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php index d1129b9d601..142acaf409f 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php @@ -33,7 +33,9 @@ final class CartsConfigurationBuilder implements Builder private $countryTaxRateFallbackEnabled; /** - *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    + *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft and MyCartDraft. + * If a ChangeSubscription for Carts exists, a ResourceDeletedDeliveryPayload is sent upon deletion of a Cart.

    + *

    This field may not be present on Projects created before January 2020.

    * * @return null|int diff --git a/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php b/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php index 351757356ef..26ee4ef7234 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php @@ -44,7 +44,9 @@ public function __construct( } /** - *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    + *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft and MyCartDraft. + * If a ChangeSubscription for Carts exists, a ResourceDeletedDeliveryPayload is sent upon deletion of a Cart.

    + *

    This field may not be present on Projects created before January 2020.

    * * * @return null|int diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php index c08be0bd288..d8519892a1c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php @@ -118,7 +118,7 @@ public function getTextLineItems(); public function getDeleteDaysAfterLastModification(); /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php index b5a9d89dd25..9791e51b72d 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php @@ -272,7 +272,7 @@ public function getDeleteDaysAfterLastModification() } /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php index 78f41c17c7b..c7e94fd9a44 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php @@ -72,7 +72,7 @@ public function getKey(); public function getDescription(); /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php index 36358b6e5b9..2e887fbddea 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php @@ -152,7 +152,7 @@ public function getDescription() } /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php index 6a6f7a7deed..0f3ffcda5c1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php @@ -230,7 +230,7 @@ public function getDescription() } /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php index 607f32a0ebb..a577c543807 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php @@ -433,7 +433,7 @@ public function getDeleteDaysAfterLastModification() } /** - *

    Identifies ShoppingLists belonging to an anonymous session.

    + *

    Identifies ShoppingLists belonging to an anonymous session.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php index 43879359857..bc03b8587df 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php @@ -160,7 +160,7 @@ public function getValidUntil(); public function getTiers(); /** - *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. + *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php index 8462670cffd..71c22a0fa86 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php @@ -318,7 +318,7 @@ public function getTiers() } /** - *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. + *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php index 9db5bfbfec0..97fb2629f9f 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php @@ -519,7 +519,7 @@ public function getTiers() } /** - *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. + *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * * From 999f381f3534080449ee51899e1362d405d98fe3 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 3 Mar 2023 16:23:19 +0000 Subject: [PATCH 6/7] TASK: Updating SDK --- changes.md | 53 ++++- .../src/Models/Cart/CartAddLineItemAction.php | 42 +++- .../Cart/CartAddLineItemActionBuilder.php | 72 ++++++- .../Cart/CartAddLineItemActionModel.php | 101 ++++++++- .../src/Models/Cart/LineItemDraft.php | 46 ++-- .../src/Models/Cart/LineItemDraftBuilder.php | 112 +++++----- .../src/Models/Cart/LineItemDraftModel.php | 108 +++++----- .../src/Models/Me/MyCartAddLineItemAction.php | 77 ++----- .../Me/MyCartAddLineItemActionBuilder.php | 182 +++------------- .../Me/MyCartAddLineItemActionModel.php | 199 ++++-------------- .../src/Models/Common/Address.php | 15 ++ .../src/Models/Common/AddressBuilder.php | 43 +++- .../src/Models/Common/AddressModel.php | 41 +++- .../src/Models/Customers/CustomerImport.php | 19 +- .../Customers/CustomerImportBuilder.php | 36 +++- .../Models/Customers/CustomerImportModel.php | 43 +++- .../src/Models/Orders/OrderImport.php | 15 ++ .../src/Models/Orders/OrderImportBuilder.php | 44 +++- .../src/Models/Orders/OrderImportModel.php | 41 +++- 19 files changed, 750 insertions(+), 539 deletions(-) diff --git a/changes.md b/changes.md index e0b1f49abf0..1baca7336e6 100644 --- a/changes.md +++ b/changes.md @@ -1,16 +1,11 @@ **Api changes**
    -Added Resource(s) +Removed Property(s) -- added resource `/{projectKey}/me/orders/quotes` -
    - - -
    -Added Method(s) - -- added method `$apiRoot->withProjectKey()->me()->orders()->quotes()->post()` +- :warning: removed property `externalTaxRate` from type `MyCartAddLineItemAction` +- :warning: removed property `externalPrice` from type `MyCartAddLineItemAction` +- :warning: removed property `externalTotalPrice` from type `MyCartAddLineItemAction`
    @@ -77,6 +72,22 @@ Added Property(s) - added property `shippingDetails` to type `CartAddCustomLineItemAction` +- added property `addedAt` to type `CartAddLineItemAction` +- added property `inventoryMode` to type `CartAddLineItemAction` + + + +
    +Added Resource(s) + +- added resource `/{projectKey}/me/orders/quotes` +
    + + +
    +Added Method(s) + +- added method `$apiRoot->withProjectKey()->me()->orders()->quotes()->post()`
    @@ -113,3 +124,27 @@ - added enum `shipping` to type `ResourceTypeId` +**Import changes** + +
    +Required Property(s) + +- changed property `password` of type `CustomerImport` to be optional +
    + + +
    +Added Property(s) + +- added property `authenticationMode` to type `CustomerImport` +- added property `state` to type `OrderImport` +- added property `custom` to type `Address` +
    + + +
    +Added Type(s) + +- added type `AuthenticationMode` +
    + diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php index f8c69475833..c7f97d75b4d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; +use DateTimeImmutable; interface CartAddLineItemAction extends CartUpdateAction { @@ -20,16 +21,18 @@ interface CartAddLineItemAction extends CartUpdateAction public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; + public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_CUSTOM = 'custom'; /** - *

    ID of an existing Product.

    + *

    id of the published Product.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -38,8 +41,8 @@ interface CartAddLineItemAction extends CartUpdateAction public function getProductId(); /** - *

    ID of an existing ProductVariant in the Product.

    - *

    If not given, the Master Variant is used.

    + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -48,7 +51,7 @@ public function getProductId(); public function getVariantId(); /** - *

    SKU of an existing ProductVariant.

    + *

    SKU of the ProductVariant.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -57,13 +60,23 @@ public function getVariantId(); public function getSku(); /** - *

    Number of Line Items to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * @return null|int */ public function getQuantity(); + /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + + * @return null|DateTimeImmutable + */ + public function getAddedAt(); + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -107,6 +120,15 @@ public function getExternalTotalPrice(); */ public function getExternalTaxRate(); + /** + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + + * @return null|string + */ + public function getInventoryMode(); + /** *

    Container for Line Item-specific addresses.

    * @@ -143,6 +165,11 @@ public function setSku(?string $sku): void; */ public function setQuantity(?int $quantity): void; + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void; + /** * @param ?ChannelResourceIdentifier $distributionChannel */ @@ -168,6 +195,11 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php index f154d980916..b6fea7053fb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php @@ -19,6 +19,7 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use DateTimeImmutable; use stdClass; /** @@ -50,6 +51,12 @@ final class CartAddLineItemActionBuilder implements Builder */ private $quantity; + /** + + * @var ?DateTimeImmutable + */ + private $addedAt; + /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder @@ -80,6 +87,12 @@ final class CartAddLineItemActionBuilder implements Builder */ private $externalTaxRate; + /** + + * @var ?string + */ + private $inventoryMode; + /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -93,7 +106,7 @@ final class CartAddLineItemActionBuilder implements Builder private $custom; /** - *

    ID of an existing Product.

    + *

    id of the published Product.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -105,8 +118,8 @@ public function getProductId() } /** - *

    ID of an existing ProductVariant in the Product.

    - *

    If not given, the Master Variant is used.

    + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -118,7 +131,7 @@ public function getVariantId() } /** - *

    SKU of an existing ProductVariant.

    + *

    SKU of the ProductVariant.

    *

    Either the productId and variantId, or sku must be provided.

    * @@ -130,7 +143,7 @@ public function getSku() } /** - *

    Number of Line Items to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * @return null|int @@ -140,6 +153,19 @@ public function getQuantity() return $this->quantity; } + /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + + * @return null|DateTimeImmutable + */ + public function getAddedAt() + { + return $this->addedAt; + } + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -198,6 +224,18 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + + * @return null|string + */ + public function getInventoryMode() + { + return $this->inventoryMode; + } + /** *

    Container for Line Item-specific addresses.

    * @@ -264,6 +302,17 @@ public function withQuantity(?int $quantity) return $this; } + /** + * @param ?DateTimeImmutable $addedAt + * @return $this + */ + public function withAddedAt(?DateTimeImmutable $addedAt) + { + $this->addedAt = $addedAt; + + return $this; + } + /** * @param ?ChannelResourceIdentifier $distributionChannel * @return $this @@ -319,6 +368,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?string $inventoryMode + * @return $this + */ + public function withInventoryMode(?string $inventoryMode) + { + $this->inventoryMode = $inventoryMode; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -425,11 +485,13 @@ public function build(): CartAddLineItemAction $this->variantId, $this->sku, $this->quantity, + $this->addedAt, $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php index 9181ca98fa9..56e0b8427af 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php @@ -18,6 +18,7 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use DateTimeImmutable; use stdClass; /** @@ -56,6 +57,12 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd */ protected $quantity; + /** + * + * @var ?DateTimeImmutable + */ + protected $addedAt; + /** * * @var ?ChannelResourceIdentifier @@ -86,6 +93,12 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd */ protected $externalTaxRate; + /** + * + * @var ?string + */ + protected $inventoryMode; + /** * * @var ?ItemShippingDetailsDraft @@ -107,11 +120,13 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?int $quantity = null, + ?DateTimeImmutable $addedAt = null, ?ChannelResourceIdentifier $distributionChannel = null, ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?CustomFieldsDraft $custom = null, ?string $action = null @@ -120,11 +135,13 @@ public function __construct( $this->variantId = $variantId; $this->sku = $sku; $this->quantity = $quantity; + $this->addedAt = $addedAt; $this->distributionChannel = $distributionChannel; $this->supplyChannel = $supplyChannel; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->externalTaxRate = $externalTaxRate; + $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -149,7 +166,7 @@ public function getAction() } /** - *

    ID of an existing Product.

    + *

    id of the published Product.

    *

    Either the productId and variantId, or sku must be provided.

    * * @@ -170,8 +187,8 @@ public function getProductId() } /** - *

    ID of an existing ProductVariant in the Product.

    - *

    If not given, the Master Variant is used.

    + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    *

    Either the productId and variantId, or sku must be provided.

    * * @@ -192,7 +209,7 @@ public function getVariantId() } /** - *

    SKU of an existing ProductVariant.

    + *

    SKU of the ProductVariant.

    *

    Either the productId and variantId, or sku must be provided.

    * * @@ -213,7 +230,7 @@ public function getSku() } /** - *

    Number of Line Items to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * * @return null|int @@ -232,6 +249,32 @@ public function getQuantity() return $this->quantity; } + /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + * + * @return null|DateTimeImmutable + */ + public function getAddedAt() + { + if (is_null($this->addedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->addedAt = $data; + } + + return $this->addedAt; + } + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -340,6 +383,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + * + * @return null|string + */ + public function getInventoryMode() + { + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($data)) { + return null; + } + $this->inventoryMode = (string) $data; + } + + return $this->inventoryMode; + } + /** *

    Container for Line Item-specific addresses.

    * @@ -415,6 +479,14 @@ public function setQuantity(?int $quantity): void $this->quantity = $quantity; } + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void + { + $this->addedAt = $addedAt; + } + /** * @param ?ChannelResourceIdentifier $distributionChannel */ @@ -455,6 +527,14 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void $this->externalTaxRate = $externalTaxRate; } + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void + { + $this->inventoryMode = $inventoryMode; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -470,4 +550,15 @@ public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[CartAddLineItemAction::FIELD_ADDED_AT]) && $data[CartAddLineItemAction::FIELD_ADDED_AT] instanceof \DateTimeImmutable) { + $data[CartAddLineItemAction::FIELD_ADDED_AT] = $data[CartAddLineItemAction::FIELD_ADDED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } } diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php index 8a0afb10589..d945d2ffa86 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php @@ -22,17 +22,17 @@ interface LineItemDraft extends JsonObject public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; - public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; + public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_CUSTOM = 'custom'; /** - *

    id of the Product.

    + *

    id of a published Product.

    * * @return null|string @@ -57,7 +57,7 @@ public function getVariantId(); public function getSku(); /** - *

    Number of Product Variants to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * @return null|int @@ -74,15 +74,6 @@ public function getQuantity(); */ public function getAddedAt(); - /** - *

    Used to identify Inventory entries that must be reserved. - * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    - * - - * @return null|ChannelResourceIdentifier - */ - public function getSupplyChannel(); - /** *

    Used to select a Product Price. * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    @@ -95,12 +86,13 @@ public function getSupplyChannel(); public function getDistributionChannel(); /** - *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * - * @return null|ExternalTaxRateDraft + * @return null|ChannelResourceIdentifier */ - public function getExternalTaxRate(); + public function getSupplyChannel(); /** *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    @@ -118,6 +110,14 @@ public function getExternalPrice(); */ public function getExternalTotalPrice(); + /** + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + * + + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate(); + /** *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    @@ -168,20 +168,15 @@ public function setQuantity(?int $quantity): void; */ public function setAddedAt(?DateTimeImmutable $addedAt): void; - /** - * @param ?ChannelResourceIdentifier $supplyChannel - */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; - /** * @param ?ChannelResourceIdentifier $distributionChannel */ public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; /** * @param ?Money $externalPrice @@ -193,6 +188,11 @@ public function setExternalPrice(?Money $externalPrice): void; */ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php index fe3d13bda88..76aa42c4968 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php @@ -57,12 +57,6 @@ final class LineItemDraftBuilder implements Builder */ private $addedAt; - /** - - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder - */ - private $supplyChannel; - /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder @@ -71,9 +65,9 @@ final class LineItemDraftBuilder implements Builder /** - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $externalTaxRate; + private $supplyChannel; /** @@ -87,6 +81,12 @@ final class LineItemDraftBuilder implements Builder */ private $externalTotalPrice; + /** + + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + */ + private $externalTaxRate; + /** * @var ?string @@ -106,7 +106,7 @@ final class LineItemDraftBuilder implements Builder private $custom; /** - *

    id of the Product.

    + *

    id of a published Product.

    * * @return null|string @@ -140,7 +140,7 @@ public function getSku() } /** - *

    Number of Product Variants to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * @return null|int @@ -163,18 +163,6 @@ public function getAddedAt() return $this->addedAt; } - /** - *

    Used to identify Inventory entries that must be reserved. - * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    - * - - * @return null|ChannelResourceIdentifier - */ - public function getSupplyChannel() - { - return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; - } - /** *

    Used to select a Product Price. * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    @@ -190,14 +178,15 @@ public function getDistributionChannel() } /** - *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * - * @return null|ExternalTaxRateDraft + * @return null|ChannelResourceIdentifier */ - public function getExternalTaxRate() + public function getSupplyChannel() { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; } /** @@ -222,6 +211,17 @@ public function getExternalTotalPrice() return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice; } + /** + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + * + + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + } + /** *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    @@ -311,17 +311,6 @@ public function withAddedAt(?DateTimeImmutable $addedAt) return $this; } - /** - * @param ?ChannelResourceIdentifier $supplyChannel - * @return $this - */ - public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) - { - $this->supplyChannel = $supplyChannel; - - return $this; - } - /** * @param ?ChannelResourceIdentifier $distributionChannel * @return $this @@ -334,12 +323,12 @@ public function withDistributionChannel(?ChannelResourceIdentifier $distribution } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ChannelResourceIdentifier $supplyChannel * @return $this */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) { - $this->externalTaxRate = $externalTaxRate; + $this->supplyChannel = $supplyChannel; return $this; } @@ -366,6 +355,17 @@ public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTota return $this; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @param ?string $inventoryMode * @return $this @@ -399,17 +399,6 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } - /** - * @deprecated use withSupplyChannel() instead - * @return $this - */ - public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) - { - $this->supplyChannel = $supplyChannel; - - return $this; - } - /** * @deprecated use withDistributionChannel() instead * @return $this @@ -422,12 +411,12 @@ public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder } /** - * @deprecated use withExternalTaxRate() instead + * @deprecated use withSupplyChannel() instead * @return $this */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) { - $this->externalTaxRate = $externalTaxRate; + $this->supplyChannel = $supplyChannel; return $this; } @@ -454,6 +443,17 @@ public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @deprecated use withShippingDetails() instead * @return $this @@ -484,11 +484,11 @@ public function build(): LineItemDraft $this->sku, $this->quantity, $this->addedAt, - $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php index cc46e61bead..0f036c2a7ec 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php @@ -56,12 +56,6 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft */ protected $addedAt; - /** - * - * @var ?ChannelResourceIdentifier - */ - protected $supplyChannel; - /** * * @var ?ChannelResourceIdentifier @@ -70,9 +64,9 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft /** * - * @var ?ExternalTaxRateDraft + * @var ?ChannelResourceIdentifier */ - protected $externalTaxRate; + protected $supplyChannel; /** * @@ -86,6 +80,12 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft */ protected $externalTotalPrice; + /** + * + * @var ?ExternalTaxRateDraft + */ + protected $externalTaxRate; + /** * * @var ?string @@ -114,11 +114,11 @@ public function __construct( ?string $sku = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, - ?ChannelResourceIdentifier $supplyChannel = null, ?ChannelResourceIdentifier $distributionChannel = null, - ?ExternalTaxRateDraft $externalTaxRate = null, + ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?ExternalTaxRateDraft $externalTaxRate = null, ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?CustomFieldsDraft $custom = null @@ -128,18 +128,18 @@ public function __construct( $this->sku = $sku; $this->quantity = $quantity; $this->addedAt = $addedAt; - $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->externalTaxRate = $externalTaxRate; + $this->supplyChannel = $supplyChannel; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; + $this->externalTaxRate = $externalTaxRate; $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; $this->custom = $custom; } /** - *

    id of the Product.

    + *

    id of a published Product.

    * * * @return null|string @@ -200,7 +200,7 @@ public function getSku() } /** - *

    Number of Product Variants to add to the Cart.

    + *

    Quantity of the Product Variant to add to the Cart.

    * * * @return null|int @@ -245,28 +245,6 @@ public function getAddedAt() return $this->addedAt; } - /** - *

    Used to identify Inventory entries that must be reserved. - * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    - * - * - * @return null|ChannelResourceIdentifier - */ - public function getSupplyChannel() - { - if (is_null($this->supplyChannel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); - if (is_null($data)) { - return null; - } - - $this->supplyChannel = ChannelResourceIdentifierModel::of($data); - } - - return $this->supplyChannel; - } - /** *

    Used to select a Product Price. * The referenced Channel must have the ProductDistribution ChannelRoleEnum.

    @@ -292,24 +270,25 @@ public function getDistributionChannel() } /** - *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + *

    Used to identify Inventory entries that must be reserved. + * The referenced Channel must have the InventorySupply ChannelRoleEnum.

    * * - * @return null|ExternalTaxRateDraft + * @return null|ChannelResourceIdentifier */ - public function getExternalTaxRate() + public function getSupplyChannel() { - if (is_null($this->externalTaxRate)) { + if (is_null($this->supplyChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); if (is_null($data)) { return null; } - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + $this->supplyChannel = ChannelResourceIdentifierModel::of($data); } - return $this->externalTaxRate; + return $this->supplyChannel; } /** @@ -354,6 +333,27 @@ public function getExternalTotalPrice() return $this->externalTotalPrice; } + /** + *

    External Tax Rate for the Line Item if the Cart has the External TaxMode.

    + * + * + * @return null|ExternalTaxRateDraft + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + } + + return $this->externalTaxRate; + } + /** *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    @@ -458,14 +458,6 @@ public function setAddedAt(?DateTimeImmutable $addedAt): void $this->addedAt = $addedAt; } - /** - * @param ?ChannelResourceIdentifier $supplyChannel - */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void - { - $this->supplyChannel = $supplyChannel; - } - /** * @param ?ChannelResourceIdentifier $distributionChannel */ @@ -475,11 +467,11 @@ public function setDistributionChannel(?ChannelResourceIdentifier $distributionC } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void { - $this->externalTaxRate = $externalTaxRate; + $this->supplyChannel = $supplyChannel; } /** @@ -498,6 +490,14 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal $this->externalTotalPrice = $externalTotalPrice; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php index 8dbace2ca54..454f93c01c2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php @@ -8,11 +8,8 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice; -use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; use Commercetools\Api\Models\Channel\ChannelResourceIdentifier; -use Commercetools\Api\Models\Common\Money; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -24,13 +21,10 @@ interface MyCartAddLineItemAction extends MyCartUpdateAction public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; + public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; - public const FIELD_EXTERNAL_PRICE = 'externalPrice'; - public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; - public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; - public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_CUSTOM = 'custom'; /** @@ -69,6 +63,16 @@ public function getSku(); */ public function getQuantity(); + /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + + * @return null|DateTimeImmutable + */ + public function getAddedAt(); + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -88,30 +92,6 @@ public function getDistributionChannel(); */ public function getSupplyChannel(); - /** - *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    - * - - * @return null|Money - */ - public function getExternalPrice(); - - /** - *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    - * - - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice(); - - /** - *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    - * - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate(); - /** *

    Container for Line Item-specific addresses.

    * @@ -120,16 +100,6 @@ public function getExternalTaxRate(); */ public function getShippingDetails(); - /** - *

    Date and time (UTC) the Line Item was added to the Cart. - * If not set, it defaults to the current date and time.

    - *

    Optional for backwards compatibility reasons.

    - * - - * @return null|DateTimeImmutable - */ - public function getAddedAt(); - /** *

    Custom Fields for the Line Item.

    * @@ -158,6 +128,11 @@ public function setSku(?string $sku): void; */ public function setQuantity(?int $quantity): void; + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void; + /** * @param ?ChannelResourceIdentifier $distributionChannel */ @@ -168,31 +143,11 @@ public function setDistributionChannel(?ChannelResourceIdentifier $distributionC */ public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; - /** - * @param ?Money $externalPrice - */ - public function setExternalPrice(?Money $externalPrice): void; - - /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice - */ - public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; - - /** - * @param ?ExternalTaxRateDraft $externalTaxRate - */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; - /** * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; - /** - * @param ?DateTimeImmutable $addedAt - */ - public function setAddedAt(?DateTimeImmutable $addedAt): void; - /** * @param ?CustomFieldsDraft $custom */ diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php index 6b55a6c72e4..db8b4a2b252 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php @@ -8,16 +8,10 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder; -use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; -use Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder; use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder; use Commercetools\Api\Models\Channel\ChannelResourceIdentifier; use Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder; -use Commercetools\Api\Models\Common\Money; -use Commercetools\Api\Models\Common\MoneyBuilder; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -59,33 +53,21 @@ final class MyCartAddLineItemActionBuilder implements Builder /** - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + * @var ?DateTimeImmutable */ - private $distributionChannel; + private $addedAt; /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $supplyChannel; - - /** - - * @var null|Money|MoneyBuilder - */ - private $externalPrice; - - /** - - * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder - */ - private $externalTotalPrice; + private $distributionChannel; /** - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $externalTaxRate; + private $supplyChannel; /** @@ -93,12 +75,6 @@ final class MyCartAddLineItemActionBuilder implements Builder */ private $shippingDetails; - /** - - * @var ?DateTimeImmutable - */ - private $addedAt; - /** * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder @@ -153,6 +129,19 @@ public function getQuantity() return $this->quantity; } + /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + + * @return null|DateTimeImmutable + */ + public function getAddedAt() + { + return $this->addedAt; + } + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -178,39 +167,6 @@ public function getSupplyChannel() return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; } - /** - *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    - * - - * @return null|Money - */ - public function getExternalPrice() - { - return $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice; - } - - /** - *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    - * - - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice() - { - return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice; - } - - /** - *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    - * - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; - } - /** *

    Container for Line Item-specific addresses.

    * @@ -222,19 +178,6 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } - /** - *

    Date and time (UTC) the Line Item was added to the Cart. - * If not set, it defaults to the current date and time.

    - *

    Optional for backwards compatibility reasons.

    - * - - * @return null|DateTimeImmutable - */ - public function getAddedAt() - { - return $this->addedAt; - } - /** *

    Custom Fields for the Line Item.

    * @@ -291,56 +234,34 @@ public function withQuantity(?int $quantity) } /** - * @param ?ChannelResourceIdentifier $distributionChannel - * @return $this - */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) - { - $this->distributionChannel = $distributionChannel; - - return $this; - } - - /** - * @param ?ChannelResourceIdentifier $supplyChannel - * @return $this - */ - public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) - { - $this->supplyChannel = $supplyChannel; - - return $this; - } - - /** - * @param ?Money $externalPrice + * @param ?DateTimeImmutable $addedAt * @return $this */ - public function withExternalPrice(?Money $externalPrice) + public function withAddedAt(?DateTimeImmutable $addedAt) { - $this->externalPrice = $externalPrice; + $this->addedAt = $addedAt; return $this; } /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice + * @param ?ChannelResourceIdentifier $distributionChannel * @return $this */ - public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice) + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) { - $this->externalTotalPrice = $externalTotalPrice; + $this->distributionChannel = $distributionChannel; return $this; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ChannelResourceIdentifier $supplyChannel * @return $this */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) { - $this->externalTaxRate = $externalTaxRate; + $this->supplyChannel = $supplyChannel; return $this; } @@ -356,17 +277,6 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) return $this; } - /** - * @param ?DateTimeImmutable $addedAt - * @return $this - */ - public function withAddedAt(?DateTimeImmutable $addedAt) - { - $this->addedAt = $addedAt; - - return $this; - } - /** * @param ?CustomFieldsDraft $custom * @return $this @@ -400,39 +310,6 @@ public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supp return $this; } - /** - * @deprecated use withExternalPrice() instead - * @return $this - */ - public function withExternalPriceBuilder(?MoneyBuilder $externalPrice) - { - $this->externalPrice = $externalPrice; - - return $this; - } - - /** - * @deprecated use withExternalTotalPrice() instead - * @return $this - */ - public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice) - { - $this->externalTotalPrice = $externalTotalPrice; - - return $this; - } - - /** - * @deprecated use withExternalTaxRate() instead - * @return $this - */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) - { - $this->externalTaxRate = $externalTaxRate; - - return $this; - } - /** * @deprecated use withShippingDetails() instead * @return $this @@ -462,13 +339,10 @@ public function build(): MyCartAddLineItemAction $this->variantId, $this->sku, $this->quantity, + $this->addedAt, $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, - $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, - $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, - $this->addedAt, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php index 5f9953e1ca2..0114a3b8ff8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php @@ -8,16 +8,10 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceModel; -use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; -use Commercetools\Api\Models\Cart\ExternalTaxRateDraftModel; use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftModel; use Commercetools\Api\Models\Channel\ChannelResourceIdentifier; use Commercetools\Api\Models\Channel\ChannelResourceIdentifierModel; -use Commercetools\Api\Models\Common\Money; -use Commercetools\Api\Models\Common\MoneyModel; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -65,33 +59,21 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa /** * - * @var ?ChannelResourceIdentifier + * @var ?DateTimeImmutable */ - protected $distributionChannel; + protected $addedAt; /** * * @var ?ChannelResourceIdentifier */ - protected $supplyChannel; - - /** - * - * @var ?Money - */ - protected $externalPrice; - - /** - * - * @var ?ExternalLineItemTotalPrice - */ - protected $externalTotalPrice; + protected $distributionChannel; /** * - * @var ?ExternalTaxRateDraft + * @var ?ChannelResourceIdentifier */ - protected $externalTaxRate; + protected $supplyChannel; /** * @@ -99,12 +81,6 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa */ protected $shippingDetails; - /** - * - * @var ?DateTimeImmutable - */ - protected $addedAt; - /** * * @var ?CustomFieldsDraft @@ -120,13 +96,10 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?int $quantity = null, + ?DateTimeImmutable $addedAt = null, ?ChannelResourceIdentifier $distributionChannel = null, ?ChannelResourceIdentifier $supplyChannel = null, - ?Money $externalPrice = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ExternalTaxRateDraft $externalTaxRate = null, ?ItemShippingDetailsDraft $shippingDetails = null, - ?DateTimeImmutable $addedAt = null, ?CustomFieldsDraft $custom = null, ?string $action = null ) { @@ -134,13 +107,10 @@ public function __construct( $this->variantId = $variantId; $this->sku = $sku; $this->quantity = $quantity; + $this->addedAt = $addedAt; $this->distributionChannel = $distributionChannel; $this->supplyChannel = $supplyChannel; - $this->externalPrice = $externalPrice; - $this->externalTotalPrice = $externalTotalPrice; - $this->externalTaxRate = $externalTaxRate; $this->shippingDetails = $shippingDetails; - $this->addedAt = $addedAt; $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -247,6 +217,32 @@ public function getQuantity() return $this->quantity; } + /** + *

    Date and time (UTC) the Line Item was added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * + * + * @return null|DateTimeImmutable + */ + public function getAddedAt() + { + if (is_null($this->addedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->addedAt = $data; + } + + return $this->addedAt; + } + /** *

    Used to select a Product Price. * The Channel must have the ProductDistribution ChannelRoleEnum. @@ -292,69 +288,6 @@ public function getSupplyChannel() return $this->supplyChannel; } - /** - *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    - * - * - * @return null|Money - */ - public function getExternalPrice() - { - if (is_null($this->externalPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_PRICE); - if (is_null($data)) { - return null; - } - - $this->externalPrice = MoneyModel::of($data); - } - - return $this->externalPrice; - } - - /** - *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    - * - * - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice() - { - if (is_null($this->externalTotalPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TOTAL_PRICE); - if (is_null($data)) { - return null; - } - - $this->externalTotalPrice = ExternalLineItemTotalPriceModel::of($data); - } - - return $this->externalTotalPrice; - } - - /** - *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    - * - * - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - if (is_null($this->externalTaxRate)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); - if (is_null($data)) { - return null; - } - - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); - } - - return $this->externalTaxRate; - } - /** *

    Container for Line Item-specific addresses.

    * @@ -376,32 +309,6 @@ public function getShippingDetails() return $this->shippingDetails; } - /** - *

    Date and time (UTC) the Line Item was added to the Cart. - * If not set, it defaults to the current date and time.

    - *

    Optional for backwards compatibility reasons.

    - * - * - * @return null|DateTimeImmutable - */ - public function getAddedAt() - { - if (is_null($this->addedAt)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ADDED_AT); - if (is_null($data)) { - return null; - } - $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); - if (false === $data) { - return null; - } - $this->addedAt = $data; - } - - return $this->addedAt; - } - /** *

    Custom Fields for the Line Item.

    * @@ -456,6 +363,14 @@ public function setQuantity(?int $quantity): void $this->quantity = $quantity; } + /** + * @param ?DateTimeImmutable $addedAt + */ + public function setAddedAt(?DateTimeImmutable $addedAt): void + { + $this->addedAt = $addedAt; + } + /** * @param ?ChannelResourceIdentifier $distributionChannel */ @@ -472,30 +387,6 @@ public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): voi $this->supplyChannel = $supplyChannel; } - /** - * @param ?Money $externalPrice - */ - public function setExternalPrice(?Money $externalPrice): void - { - $this->externalPrice = $externalPrice; - } - - /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice - */ - public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void - { - $this->externalTotalPrice = $externalTotalPrice; - } - - /** - * @param ?ExternalTaxRateDraft $externalTaxRate - */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void - { - $this->externalTaxRate = $externalTaxRate; - } - /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -504,14 +395,6 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): $this->shippingDetails = $shippingDetails; } - /** - * @param ?DateTimeImmutable $addedAt - */ - public function setAddedAt(?DateTimeImmutable $addedAt): void - { - $this->addedAt = $addedAt; - } - /** * @param ?CustomFieldsDraft $custom */ diff --git a/lib/commercetools-import/src/Models/Common/Address.php b/lib/commercetools-import/src/Models/Common/Address.php index cac5bd6dc39..e721a9d4b70 100644 --- a/lib/commercetools-import/src/Models/Common/Address.php +++ b/lib/commercetools-import/src/Models/Common/Address.php @@ -10,6 +10,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; +use Commercetools\Import\Models\Customfields\Custom; interface Address extends JsonObject { @@ -38,6 +39,7 @@ interface Address extends JsonObject public const FIELD_FAX = 'fax'; public const FIELD_ADDITIONAL_ADDRESS_INFO = 'additionalAddressInfo'; public const FIELD_EXTERNAL_ID = 'externalId'; + public const FIELD_CUSTOM = 'custom'; /** @@ -191,6 +193,14 @@ public function getAdditionalAddressInfo(); */ public function getExternalId(); + /** + *

    Custom Fields for the address.

    + * + + * @return null|Custom + */ + public function getCustom(); + /** * @param ?string $id */ @@ -315,4 +325,9 @@ public function setAdditionalAddressInfo(?string $additionalAddressInfo): void; * @param ?string $externalId */ public function setExternalId(?string $externalId): void; + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void; } diff --git a/lib/commercetools-import/src/Models/Common/AddressBuilder.php b/lib/commercetools-import/src/Models/Common/AddressBuilder.php index 1866274e783..54389ea1605 100644 --- a/lib/commercetools-import/src/Models/Common/AddressBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AddressBuilder.php @@ -13,6 +13,8 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomBuilder; use stdClass; /** @@ -170,6 +172,12 @@ final class AddressBuilder implements Builder */ private $externalId; + /** + + * @var null|Custom|CustomBuilder + */ + private $custom; + /** * @return null|string @@ -397,6 +405,17 @@ public function getExternalId() return $this->externalId; } + /** + *

    Custom Fields for the address.

    + * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?string $id * @return $this @@ -672,6 +691,27 @@ public function withExternalId(?string $externalId) return $this; } + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } public function build(): Address { @@ -700,7 +740,8 @@ public function build(): Address $this->email, $this->fax, $this->additionalAddressInfo, - $this->externalId + $this->externalId, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-import/src/Models/Common/AddressModel.php b/lib/commercetools-import/src/Models/Common/AddressModel.php index 1afdb84ca6a..593d05ef764 100644 --- a/lib/commercetools-import/src/Models/Common/AddressModel.php +++ b/lib/commercetools-import/src/Models/Common/AddressModel.php @@ -12,6 +12,8 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomModel; use stdClass; /** @@ -169,6 +171,12 @@ final class AddressModel extends JsonObjectModel implements Address */ protected $externalId; + /** + * + * @var ?Custom + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -198,7 +206,8 @@ public function __construct( ?string $email = null, ?string $fax = null, ?string $additionalAddressInfo = null, - ?string $externalId = null + ?string $externalId = null, + ?Custom $custom = null ) { $this->id = $id; $this->key = $key; @@ -225,6 +234,7 @@ public function __construct( $this->fax = $fax; $this->additionalAddressInfo = $additionalAddressInfo; $this->externalId = $externalId; + $this->custom = $custom; } /** @@ -679,6 +689,27 @@ public function getExternalId() return $this->externalId; } + /** + *

    Custom Fields for the address.

    + * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomModel::of($data); + } + + return $this->custom; + } + /** * @param ?string $id @@ -879,4 +910,12 @@ public function setExternalId(?string $externalId): void { $this->externalId = $externalId; } + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImport.php b/lib/commercetools-import/src/Models/Customers/CustomerImport.php index 66eb88956b0..b934c7b3aa5 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImport.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImport.php @@ -40,6 +40,7 @@ interface CustomerImport extends ImportResource public const FIELD_SHIPPING_ADDRESSES = 'shippingAddresses'; public const FIELD_LOCALE = 'locale'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; /** *

    Maps to Customer.customerNumber.

    @@ -211,13 +212,24 @@ public function getShippingAddresses(); public function getLocale(); /** - *

    The custom fields for this Customer.

    + *

    The Custom Fields for this Customer.

    * * @return null|Custom */ public function getCustom(); + /** + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    + * + + * @return null|string + */ + public function getAuthenticationMode(); + /** * @param ?string $customerNumber */ @@ -327,4 +339,9 @@ public function setLocale(?string $locale): void; * @param ?Custom $custom */ public function setCustom(?Custom $custom): void; + + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void; } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php b/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php index da815935da0..d4d34a815d9 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php @@ -166,6 +166,12 @@ final class CustomerImportBuilder implements Builder */ private $custom; + /** + + * @var ?string + */ + private $authenticationMode; + /** *

    User-defined unique identifier.

    * @@ -410,7 +416,7 @@ public function getLocale() } /** - *

    The custom fields for this Customer.

    + *

    The Custom Fields for this Customer.

    * * @return null|Custom @@ -420,6 +426,20 @@ public function getCustom() return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; } + /** + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    + * + + * @return null|string + */ + public function getAuthenticationMode() + { + return $this->authenticationMode; + } + /** * @param ?string $key * @return $this @@ -673,6 +693,17 @@ public function withCustom(?Custom $custom) return $this; } + /** + * @param ?string $authenticationMode + * @return $this + */ + public function withAuthenticationMode(?string $authenticationMode) + { + $this->authenticationMode = $authenticationMode; + + return $this; + } + /** * @deprecated use withCustomerGroup() instead * @return $this @@ -720,7 +751,8 @@ public function build(): CustomerImport $this->defaultShippingAddress, $this->shippingAddresses, $this->locale, - $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom, + $this->authenticationMode ); } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php b/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php index 2483ef87b8e..5ffb394927c 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php @@ -165,6 +165,12 @@ final class CustomerImportModel extends JsonObjectModel implements CustomerImpor */ protected $custom; + /** + * + * @var ?string + */ + protected $authenticationMode; + /** * @psalm-suppress MissingParamType @@ -192,7 +198,8 @@ public function __construct( ?int $defaultShippingAddress = null, ?array $shippingAddresses = null, ?string $locale = null, - ?Custom $custom = null + ?Custom $custom = null, + ?string $authenticationMode = null ) { $this->key = $key; $this->customerNumber = $customerNumber; @@ -217,6 +224,7 @@ public function __construct( $this->shippingAddresses = $shippingAddresses; $this->locale = $locale; $this->custom = $custom; + $this->authenticationMode = $authenticationMode; } /** @@ -666,7 +674,7 @@ public function getLocale() } /** - *

    The custom fields for this Customer.

    + *

    The Custom Fields for this Customer.

    * * * @return null|Custom @@ -686,6 +694,29 @@ public function getCustom() return $this->custom; } + /** + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    + * + * + * @return null|string + */ + public function getAuthenticationMode() + { + if (is_null($this->authenticationMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_AUTHENTICATION_MODE); + if (is_null($data)) { + return null; + } + $this->authenticationMode = (string) $data; + } + + return $this->authenticationMode; + } + /** * @param ?string $key @@ -871,6 +902,14 @@ public function setCustom(?Custom $custom): void $this->custom = $custom; } + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void + { + $this->authenticationMode = $authenticationMode; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-import/src/Models/Orders/OrderImport.php b/lib/commercetools-import/src/Models/Orders/OrderImport.php index c55c9276052..6ac6866dd52 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImport.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImport.php @@ -14,6 +14,7 @@ use Commercetools\Import\Models\Common\AddressCollection; use Commercetools\Import\Models\Common\CustomerGroupKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReference; +use Commercetools\Import\Models\Common\StateKeyReference; use Commercetools\Import\Models\Common\StoreKeyReference; use Commercetools\Import\Models\Common\TypedMoney; use Commercetools\Import\Models\Customfields\Custom; @@ -44,6 +45,7 @@ interface OrderImport extends JsonObject public const FIELD_ORIGIN = 'origin'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_STORE = 'store'; + public const FIELD_STATE = 'state'; /** *

    Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

    @@ -227,6 +229,14 @@ public function getItemShippingAddresses(); */ public function getStore(); + /** + *

    Reference to a State in a custom workflow.

    + * + + * @return null|StateKeyReference + */ + public function getState(); + /** * @param ?string $orderNumber */ @@ -341,4 +351,9 @@ public function setItemShippingAddresses(?AddressCollection $itemShippingAddress * @param ?StoreKeyReference $store */ public function setStore(?StoreKeyReference $store): void; + + /** + * @param ?StateKeyReference $state + */ + public function setState(?StateKeyReference $state): void; } diff --git a/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php b/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php index 6f59a8e22f7..e35e54f3ff2 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php @@ -20,6 +20,8 @@ use Commercetools\Import\Models\Common\CustomerGroupKeyReferenceBuilder; use Commercetools\Import\Models\Common\CustomerKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReferenceBuilder; +use Commercetools\Import\Models\Common\StateKeyReference; +use Commercetools\Import\Models\Common\StateKeyReferenceBuilder; use Commercetools\Import\Models\Common\StoreKeyReference; use Commercetools\Import\Models\Common\StoreKeyReferenceBuilder; use Commercetools\Import\Models\Common\TypedMoney; @@ -172,6 +174,12 @@ final class OrderImportBuilder implements Builder */ private $store; + /** + + * @var null|StateKeyReference|StateKeyReferenceBuilder + */ + private $state; + /** *

    Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

    * @@ -423,6 +431,17 @@ public function getStore() return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; } + /** + *

    Reference to a State in a custom workflow.

    + * + + * @return null|StateKeyReference + */ + public function getState() + { + return $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state; + } + /** * @param ?string $orderNumber * @return $this @@ -676,6 +695,17 @@ public function withStore(?StoreKeyReference $store) return $this; } + /** + * @param ?StateKeyReference $state + * @return $this + */ + public function withState(?StateKeyReference $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withCustomer() instead * @return $this @@ -775,6 +805,17 @@ public function withStoreBuilder(?StoreKeyReferenceBuilder $store) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateKeyReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + public function build(): OrderImport { return new OrderImportModel( @@ -800,7 +841,8 @@ public function build(): OrderImport $this->taxCalculationMode, $this->origin, $this->itemShippingAddresses, - $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, + $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state ); } diff --git a/lib/commercetools-import/src/Models/Orders/OrderImportModel.php b/lib/commercetools-import/src/Models/Orders/OrderImportModel.php index a5d0f5c8c25..b3fbdf6fc91 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImportModel.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImportModel.php @@ -19,6 +19,8 @@ use Commercetools\Import\Models\Common\CustomerGroupKeyReferenceModel; use Commercetools\Import\Models\Common\CustomerKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReferenceModel; +use Commercetools\Import\Models\Common\StateKeyReference; +use Commercetools\Import\Models\Common\StateKeyReferenceModel; use Commercetools\Import\Models\Common\StoreKeyReference; use Commercetools\Import\Models\Common\StoreKeyReferenceModel; use Commercetools\Import\Models\Common\TypedMoney; @@ -171,6 +173,12 @@ final class OrderImportModel extends JsonObjectModel implements OrderImport */ protected $store; + /** + * + * @var ?StateKeyReference + */ + protected $state; + /** * @psalm-suppress MissingParamType @@ -198,7 +206,8 @@ public function __construct( ?string $taxCalculationMode = null, ?string $origin = null, ?AddressCollection $itemShippingAddresses = null, - ?StoreKeyReference $store = null + ?StoreKeyReference $store = null, + ?StateKeyReference $state = null ) { $this->orderNumber = $orderNumber; $this->customer = $customer; @@ -223,6 +232,7 @@ public function __construct( $this->origin = $origin; $this->itemShippingAddresses = $itemShippingAddresses; $this->store = $store; + $this->state = $state; } /** @@ -696,6 +706,27 @@ public function getStore() return $this->store; } + /** + *

    Reference to a State in a custom workflow.

    + * + * + * @return null|StateKeyReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateKeyReferenceModel::of($data); + } + + return $this->state; + } + /** * @param ?string $orderNumber @@ -881,6 +912,14 @@ public function setStore(?StoreKeyReference $store): void $this->store = $store; } + /** + * @param ?StateKeyReference $state + */ + public function setState(?StateKeyReference $state): void + { + $this->state = $state; + } + #[\ReturnTypeWillChange] public function jsonSerialize() From 5d2a6bd16a803637984aa7f38859c1f50d102487 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Mon, 6 Mar 2023 10:36:52 +0100 Subject: [PATCH 7/7] complete prettify output --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b101e008ee3..57632cba39b 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ parallel_generate_history_test: install_deps parallel_test_sdks_bc $(MAKE) -C lib LIB_NAME=history GEN_RAML_FILE=../$(HISTORY_RAML) generate_sdk_test parallel_prettify_sdks: install_deps parallel_gen_sdk_tests - php -dmemory_limit=-1 vendor/bin/ecs check --output-format=summaryOnly --fix + php -dmemory_limit=-1 vendor/bin/ecs check --fix parallel_analyze_sdks: install_deps parallel_prettify_sdks vendor/bin/psalm --threads=$(CPUS)