From 51dfd04baf1d834449bf1cafb75874d5d9950ae1 Mon Sep 17 00:00:00 2001
From: Auto Mation 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 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 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 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 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 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 Unique identifier of the Address. Custom Fields defined 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 User-defined unique identifier for the Address. 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 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 Two-digit country code as per ISO 3166-1 alpha-2. Name of the country. 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.custom
field.custom
field.custom
field.custom
field.custom
field.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.key
instead and omit this field from the request to let the API generate the ID for the Address.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.key
instead and omit this field from the request to let the API generate the ID for the Address.itemShippingAddresses
(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.custom
field.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()`
-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`
Added Type(s)
+
+- added type `GoogleCloudFunctionDestination`
+
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 MationData 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.
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.
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.
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.
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.
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.
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.
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.
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.
Platform
TaxMode, it is automatically set when a shipping address is set.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.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.
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
.
Indicates how taxes are calculated when calculating taxes for taxedPrice
.
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.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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
.
Discount Codes applied to the Cart. A Cart that has directDiscounts
cannot have discountCodes
.
Direct Discounts added to the Cart. A Cart that has discountCodes
cannot have directDiscounts
.
Automatically set when a Line Item with GiftLineItem
LineItemMode is removed from the Cart.
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}
.
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.
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.
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(); /** *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}
.
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.
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.
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}
.
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.
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.
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|arrayCustom Fields for the Custom Line Item.
+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|arrayUser-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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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|arraycode
of a DiscountCode.
code
of a DiscountCode.
code
of a DiscountCode.
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.
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.
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.
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.
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.
SKU of an existing ProductVariant.
+ *Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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.
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.
SKU of an existing ProductVariant.
+ *Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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|arrayResourceIdentifier to a Channel.
- * + *ID of an existing Product.
+ *Either the productId
and variantId
, or sku
must be provided.
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.
SKU of an existing ProductVariant.
+ *Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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|arrayPayment 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.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
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.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
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.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
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|arrayResourceIdentifier 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.
ResourceIdentifier to a Channel.
+ *supplyChannel
to set for all LineItems that are added to the Cart.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
ResourceIdentifier to a Channel.
+ *supplyChannel
to set for all LineItems that are added to the Cart.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
ResourceIdentifier to a Channel.
+ *supplyChannel
to set for all LineItems that are added to the Cart.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
id
of the CustomLineItem to update.
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.
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.
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.
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.
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.
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.
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.
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.
Platform
TaxMode, it is automatically set when a shipping address is set.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.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.
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
.
Indicates how taxes are calculated when calculating taxes for taxedPrice
.
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.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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
.
Discount Codes applied to the Cart. A Cart that has directDiscounts
cannot have discountCodes
.
Direct Discounts added to the Cart. A Cart that has discountCodes
cannot have directDiscounts
.
Automatically set when a Line Item with GiftLineItem
LineItemMode is removed from the Cart.
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.
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.
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.
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.
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.
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.
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.
New value to set.
+ *If 0
, the Custom Line Item is removed from the Cart.
id
of the CustomLineItem to update.
New value to set.
+ *If 0
, the Custom Line Item is removed from the Cart.
id
of the CustomLineItem to update.
New value to set.
+ *If 0
, the Custom Line Item is removed from the Cart.
id
of the LineItem to update.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
id
of the LineItem to update.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
id
of the LineItem to update.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
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.
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.
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.
The default tax calculation mode is LineItemLevel
.
Determines how monetary values are rounded when calculating taxes for taxedPrice
.
Determines how taxes are calculated when calculating taxes for taxedPrice
.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The custom fields.
+ *Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.Must be one of the languages supported for this project
+ *Custom Shipping Methods for a Cart with Multiple
ShippingMode.
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.
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
.
Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.code
of the existing DiscountCodes to add to the Cart.
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
.
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.
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.
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.
The default tax calculation mode is LineItemLevel
.
Determines how monetary values are rounded when calculating taxes for taxedPrice
.
Determines how taxes are calculated when calculating taxes for taxedPrice
.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The custom fields.
+ *Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.Must be one of the languages supported for this project
+ *Custom Shipping Methods for a Cart with Multiple
ShippingMode.
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.
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
.
Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.code
of the existing DiscountCodes to add to the Cart.
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
.
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.
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.
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 ?listDefault 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 ?listThe 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.
Determines how monetary values are rounded when calculating taxes for taxedPrice
.
The default tax calculation mode is LineItemLevel
.
Determines how taxes are calculated when calculating taxes for taxedPrice
.
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 ?listBilling address associated with the Cart.
* - * @return null|CustomLineItemDraftCollection + * + * @return null|BaseAddress */ - public function getCustomLineItems() + public function getBillingAddress() { - if (is_null($this->customLineItems)) { - /** @psalm-var ?listThe 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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The custom fields.
+ *Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.Must be one of the languages supported for this project
+ *Custom Shipping Methods for a Cart with Multiple
ShippingMode.
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.
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
.
Single
, only a single Shipping Method can be added to the Cart.Multiple
, multiple Shipping Methods can be added to the Cart.code
of the existing DiscountCodes to add to the Cart.
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
.
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 ?listThe 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|arrayContains 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 ?listThe 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 ?listThe 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|arrayPresent on resources created after 1 February 2019 except for events not tracked.
+ *id
of the Customer that the Cart belongs to.
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|arrayAnonymous 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.
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.
Platform
TaxMode, it is automatically set when a shipping address is set.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.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.
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
.
Indicates how taxes are calculated when calculating taxes for taxedPrice
.
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 ?listBilling 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|arrayShipping 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|arrayWhen 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.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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
.
Discount Codes applied to the Cart. A Cart that has directDiscounts
cannot have discountCodes
.
Direct Discounts added to the Cart. A Cart that has discountCodes
cannot have directDiscounts
.
Automatically set when a Line Item with GiftLineItem
LineItemMode is removed from the Cart.
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 ?listThe 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|arrayThe 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|arrayContains 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 ?listThe 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|arrayNumber 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.
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.
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.
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.
false
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.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.
false
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.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.
false
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.id
of the Custom Line Item to remove.
id
of the Custom Line Item to remove.
id
of the Custom Line Item to remove.
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
.
key
of the Address to remove from itemShippingAddresses
.
key
of the Address to remove from itemShippingAddresses
.
id
of the Line Item to remove.
New value to set.
+ * If absent or 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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.
New value to set.
+ * If absent or 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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.
New value to set.
+ * If absent or 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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|arrayThe 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
.
Set if the externalTotalGross
price is a sum of portions with different tax rates.
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
.
Set if the externalTotalGross
price is a sum of portions with different tax rates.
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
.
Set if the externalTotalGross
price is a sum of portions with different tax rates.
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.
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.
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.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
id
of the CustomLineItem to update.
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.
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.
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.
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.
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.
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.
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.
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.
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.
External Tax Rate for the shippingRate
to be set if the Cart has the External
TaxMode.
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.
External Tax Rate for the shippingRate
to be set if the Cart has the External
TaxMode.
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.
External Tax Rate for the shippingRate
to be set if the Cart has the External
TaxMode.
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.
If set, a customer with the given ID must exist in the project.
+ *id
of an existing Customer. If empty, any value is removed.
If set, a customer with the given ID must exist in the project.
+ *id
of an existing Customer. If empty, any value is removed.
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.
id
of the Delivery.
id
of the Delivery.
id
of the Delivery.
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
.
Sets the Custom Fields fields for the address
in a Delivery.
Sets the Custom Fields fields for the Delivery address
.
id
of the Delivery.
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
.
Sets the Custom Fields fields for the address
in a Delivery.
Sets the Custom Fields fields for the Delivery address
.
id
of the Delivery.
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
.
Sets the Custom Fields fields for the address
in a Delivery.
Sets the Custom Fields fields for the Delivery address
.
key
of the Address in itemShippingAddress
.
key
of the Address in itemShippingAddress
.
key
of the Address in itemShippingAddress
.
key
of the Address in itemShippingAddress
.
key
of the Address in itemShippingAddress
.
key
of the Address in itemShippingAddress
.
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.
id
of the LineItem to update.
id
of the LineItem to update.
id
of the LineItem to update.
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.
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.
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.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
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
.
id
of the LineItem to update.
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
.
id
of the LineItem to update.
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
.
id
of the LineItem to update.
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.
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.
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.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.id
of the LineItem to update.
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.
id
of the LineItem to update.
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.
id
of the LineItem to update.
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.
id
of the LineItem to update.
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.
id
of the LineItem to update.
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.
id
of the LineItem to update.
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.
id
of the LineItem to update.
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
.
id
of the LineItem to update.
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
.
id
of the LineItem to update.
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
.
Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
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.
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.
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.
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.
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.
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.
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.
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
.
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.
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
.
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.
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
.
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.
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.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.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.
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.
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.
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.
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
.
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}
.
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.
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.
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.External
TaxMode, the taxRate
of Custom Line Items can be set using ExternalTaxRateDraft.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.
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
.
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}
.
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.
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.
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.External
TaxMode, the taxRate
of Custom Line Items can be set using ExternalTaxRateDraft.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}
.
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.
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.
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}
.
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.
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.
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}
.
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.
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.
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.
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
.
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}
.
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.
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.
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.External
TaxMode, the taxRate
of Custom Line Items can be set using ExternalTaxRateDraft.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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
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.
Tax Rate used to tax a shipping expense if the Cart has the External
TaxMode.
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|arrayThe 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
.
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
.
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.
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.
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.
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
.
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
.
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
.
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
.
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.
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.
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.
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.
+ *subRates
are specified, a value must be defined.subRates
are specified, this can be omitted or its value must be the sum of all subRates
amounts.A two-digit country code as per ISO 3166-1 alpha-2.
+ *false
, the related price is considered the net price and the provided amount
is applied to calculate the gross price.true
, the related price is considered the gross price, and the provided amount
is applied to calculate the net price.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.
+ *subRates
are specified, a value must be defined.subRates
are specified, this can be omitted or its value must be the sum of all subRates
amounts.A two-digit country code as per ISO 3166-1 alpha-2.
+ *false
, the related price is considered the net price and the provided amount
is applied to calculate the gross price.true
, the related price is considered the gross price, and the provided amount
is applied to calculate the net price.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.
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.
+ *subRates
are specified, a value must be defined.subRates
are specified, this can be omitted or its value must be the sum of all subRates
amounts.A two-digit country code as per ISO 3166-1 alpha-2.
+ *false
, the related price is considered the net price and the provided amount
is applied to calculate the gross price.true
, the related price is considered the gross price, and the provided amount
is applied to calculate the net price.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.
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.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.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.The key of the address in the cart's itemShippingAddresses
Key of the address in the Cart itemShippingAddresses
.
+ * Duplicate address keys are not allowed.
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.
The key of the address in the cart's itemShippingAddresses
Key of the address in the Cart itemShippingAddresses
.
+ * Duplicate address keys are not allowed.
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.
The key of the address in the cart's itemShippingAddresses
Key of the address in the Cart itemShippingAddresses
.
+ * Duplicate address keys are not allowed.
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.
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.
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:
+ *key
is available on that specific Product at the time the Line Item was created or updated on the Cart.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.
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
.
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
.
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.
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.
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.
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.External
TaxMode, the taxRate
of Line Items can be set using ExternalTaxRateDraft.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.
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.
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.
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.
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.
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:
+ *key
is available on that specific Product at the time the Line Item was created or updated on the Cart.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.
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
.
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
.
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.
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.
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.
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.External
TaxMode, the taxRate
of Line Items can be set using ExternalTaxRateDraft.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.
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.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
The amount of a LineItem
in 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.
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.
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.
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.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
The amount of a LineItem
in 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.
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.
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.
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.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
The amount of a LineItem
in 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.
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.
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.
The custom fields.
- * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|arraySets 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.
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.
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.
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|arrayUnique 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.
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:
+ *key
is available on that specific Product at the time the Line Item was created or updated on the Cart.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.
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
.
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|arrayTaxed 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
.
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|arrayThe amount of a LineItem in the cart. - * Must be a positive integer.
+ *Automatically set after taxRate
is set.
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.
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.
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.External
TaxMode, the taxRate
of Line Items can be set using ExternalTaxRateDraft.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.
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.
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.
Indicates how the Price for the Line Item is set.
* - * @return null|DiscountedLineItemPriceForQuantityCollection - */ - public function getDiscountedPricePerQuantity() - { - if (is_null($this->discountedPricePerQuantity)) { - /** @psalm-var ?listIndicates 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|arrayInventory 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.
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|arrayDate 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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
Tax Rate used for taxing a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
Tax Rate used for taxing a shipping expense if the Cart has the External
TaxMode.
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.
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:
CartClassification
, it must be ClassificationShippingRateInputDraft.CartScore
, it must be ScoreShippingRateInputDraft.CartValue
, it cannot be set.The shippingRateInput
cannot be set on the Cart if CartValueType is defined.
Tax Rate used for taxing a shipping expense if the Cart has the External
TaxMode.
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|arrayName 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.
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.
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.
Used to select a Tax Rate when a Cart has the Platform
TaxMode.
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.
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.
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.
Used to select a Tax Rate when a Cart has the Platform
TaxMode.
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.
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.
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.
Used to select a Tax Rate when a Cart has the Platform
TaxMode.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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.
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.
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.
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.
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.
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.
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.
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.
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.
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 Buildercode
of a DiscountCode.
code
of a DiscountCode.
code
of a DiscountCode.
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.
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.
sku
of the ProductVariant.
Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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.
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.
sku
of the ProductVariant.
Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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|arrayResourceIdentifier to a Channel.
- * - * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel() - { - if (is_null($this->distributionChannel)) { - /** @psalm-var stdClass|arrayid
of the Product.
Either the productId
and variantId
, or sku
must be provided.
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.
sku
of the ProductVariant.
Either the productId
and variantId
, or sku
must be provided.
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.
Used to identify Inventory entries that must be reserved.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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|arrayResourceIdentifier 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.
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.
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.
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.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
id
of the LineItem to update.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
id
of the LineItem to update.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
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.
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.
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
.
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.
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
.
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.
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.
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
.
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.
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
.
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|arrayDefault 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|arrayLine 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.
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|arrayBilling 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|arrayThe 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|arrayShipping 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.
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
.
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.
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
.
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|arrayReference 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|arrayThe 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 ?listfalse
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.false
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.false
to only update the Prices and TaxRates of the Line Items.true
to update the Line Items' product data (like name
, variant
and productType
) also.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
.
key
of the Address to remove from itemShippingAddresses
.
key
of the Address to remove from itemShippingAddresses
.
id
of the Line Item to remove.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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.
New value to set.
+ *If 0
, the Line Item is removed from the Cart.
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.
Sets the LineItem price
and totalPrice
to the given value when decreasing the quantity of a Line Item with the ExternalTotal
LineItemPriceMode.
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|arrayTwo-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.
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.
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.
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.
id
of the LineItem to update.
id
of the LineItem to update.
id
of the LineItem to update.
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.
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.
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.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the ProductDistribution
ChannelRoleEnum.id
of the LineItem to update.
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.
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.
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.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.id
of the LineItem to update.
ResourceIdentifier to a Channel.
+ *lineItemId
.lineItemId
.
+ * The Channel must have the InventorySupply
ChannelRoleEnum.Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
Value to set.
+ * Must be one of the Project's languages
.
+ * If empty, any existing value will be removed.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
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.
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.
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.
id
of the ProductVariant in the Product.
+ * If not provided, the Master Variant is used.
sku
of the ProductVariant.
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.
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.
The custom fields.
- * - * - * @return null|CustomFieldsDraft - */ - public function getCustom() - { - if (is_null($this->custom)) { - /** @psalm-var stdClass|arrayContainer 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|arrayversion
of the Quote from which the Order is created.
Set to true
, if the quoteState
of the referenced Quote should be set to Accepted
.
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.
Set to true
, if the quoteState
of the referenced Quote should be set to Accepted
.
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.
Set to true
, if the quoteState
of the referenced Quote should be set to Accepted
.
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.
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.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
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.
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.
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.
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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.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:
CartClassification
, it is ClassificationShippingRateInput.CartScore
, it is ScoreShippingRateInput.CartValue
, it cannot be used.For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *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.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
For order creation and updates, the sum of the targets
must match the quantity of the Line Items or Custom Line Items.
Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *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:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *Cannot be used in LineItemDraft or CustomLineItemDraft.
+ *Can only be set by these update actions:
+ *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.
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.
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.
ID of an existing Product.
+ *id
of the published Product.
Either the productId
and variantId
, or sku
must be provided.
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.
SKU of an existing ProductVariant.
+ *SKU of the ProductVariant.
*Either the productId
and variantId
, or sku
must be provided.
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.
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.
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.
SKU of an existing ProductVariant.
+ *SKU of the ProductVariant.
*Either the productId
and variantId
, or sku
must be provided.
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.
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.
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.
SKU of an existing ProductVariant.
+ *SKU of the ProductVariant.
*Either the productId
and variantId
, or sku
must be provided.
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.
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.
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.
Used to select a Product Price.
* The referenced Channel must have the ProductDistribution
ChannelRoleEnum.
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.
Sets the LineItem price
value, and the priceMode
to ExternalPrice
LineItemPriceMode.
External Tax Rate for the Line Item if the Cart has the External
TaxMode.
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.
id
of the Product.
id
of a published Product.
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.
Used to select a Product Price.
* The referenced Channel must have the ProductDistribution
ChannelRoleEnum.
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.
External Tax Rate for the Line Item if the Cart has the External
TaxMode.
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.
id
of the Product.
id
of a published Product.
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.
Used to select a Product Price.
* The referenced Channel must have the ProductDistribution
ChannelRoleEnum.
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.
External Tax Rate for the Line Item if the Cart has the External
TaxMode.
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.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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.
Sets the LineItem price
and totalPrice
values, and the priceMode
to ExternalTotal
LineItemPriceMode.
External Tax Rate for the Line Item, if the Cart has the External
TaxMode.
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|arrayMaps to Customer.customerNumber
.
The custom fields for this Customer.
+ *The Custom Fields for this Customer.
* * @return null|Custom */ public function getCustom(); + /** + *Password
to make the password
field required for the Customer.ExternalAuth
when the password is not required for the Customer.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; } + /** + *Password
to make the password
field required for the Customer.ExternalAuth
when the password is not required for the Customer.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; } + /** + *Password
to make the password
field required for the Customer.ExternalAuth
when the password is not required for the Customer.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.
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.
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