From b2b93565629cd324852e58d27745775c6356be65 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 10:32:45 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 27 +--- .../main/resources/graphql/schema.graphqls | 21 +++ .../api/models/cart/BestDeal.java | 127 ++++++++++++++++++ .../api/models/cart/BestDealBuilder.java | 82 +++++++++++ .../api/models/cart/BestDealImpl.java | 94 +++++++++++++ .../commercetools/api/models/cart/Cart.java | 18 +++ .../api/models/cart/CartBuilder.java | 46 ++++++- .../api/models/cart/CartImpl.java | 21 +++ .../models/cart/DiscountTypeCombination.java | 106 +++++++++++++++ .../cart/DiscountTypeCombinationBuilder.java | 30 +++++ .../cart/DiscountTypeCombinationImpl.java | 72 ++++++++++ .../api/models/cart/Stacking.java | 107 +++++++++++++++ .../api/models/cart/StackingBuilder.java | 57 ++++++++ .../api/models/cart/StackingImpl.java | 65 +++++++++ .../commercetools/api/models/order/Order.java | 19 +++ .../api/models/order/OrderBuilder.java | 46 ++++++- .../api/models/order/OrderImpl.java | 21 +++ .../api/models/order_edit/StagedOrder.java | 3 + .../models/order_edit/StagedOrderBuilder.java | 46 ++++++- .../models/order_edit/StagedOrderImpl.java | 21 +++ .../query/cart/BestDealQueryBuilderDsl.java | 26 ++++ .../query/cart/CartQueryBuilderDsl.java | 10 ++ ...iscountTypeCombinationQueryBuilderDsl.java | 35 +++++ .../query/cart/StackingQueryBuilderDsl.java | 20 +++ .../query/order/OrderQueryBuilderDsl.java | 10 ++ .../StagedOrderQueryBuilderDsl.java | 10 ++ .../api/models/cart/BestDealTest.java | 36 +++++ .../api/models/cart/CartTest.java | 10 ++ .../api/models/cart/StackingTest.java | 13 ++ .../api/models/order/OrderTest.java | 10 ++ references.txt | 1 + 31 files changed, 1184 insertions(+), 26 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDeal.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombination.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Stacking.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/BestDealQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountTypeCombinationQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/StackingQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/BestDealTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/StackingTest.java diff --git a/changes.md b/changes.md index 2d9ef623ed5..38e04aca4a9 100644 --- a/changes.md +++ b/changes.md @@ -3,30 +3,17 @@
Added Type(s) -- added type `AssociateRoleNameSetMessage` -- added type `AssociateRoleNameSetMessagePayload` +- added type `BestDeal` +- added type `DiscountTypeCombination` +- added type `Stacking`
-Removed Type(s) +Added Property(s) -- :warning: removed type `AssociateRoleNameChangedMessage` -- :warning: removed type `AssociateRoleNameChangedMessagePayload` -
- -**History changes** - -
-Removed Enum(s) - -- :warning: removed enum `setAsssetKey` from type `UpdateType` -
- - -
-Added Enum(s) - -- added enum `setAssetKey` to type `UpdateType` +- added property `discountTypeCombination` to type `Cart` +- added property `discountTypeCombination` to type `StagedOrder` +- added property `discountTypeCombination` to type `Order`
diff --git a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls index d02e768677d..3183c16bc33 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -1737,6 +1737,7 @@ type Cart implements Versioned & ReferenceExpandable { taxedShippingPrice: TaxedPrice shippingMode: ShippingMode! shippingCustomFields: CustomFieldsType + discountTypeCombination: DiscountTypeCombination cartState: CartState! key: String custom: CustomFieldsType @@ -1963,6 +1964,25 @@ input CartDiscountValueInput { giftLineItem: GiftLineItemValueInput } +"Chosen discount type for the cart as part of best deal" +enum ChosenDiscountType { + CartDiscount + ProductDiscount +} + +interface DiscountTypeCombination { + type: String! +} + +type Stacking implements DiscountTypeCombination { + type: String! +} + +type BestDeal implements DiscountTypeCombination { + type: String! + chosenDiscountType: ChosenDiscountType +} + input CartDraft { currency: Currency! country: Country @@ -6820,6 +6840,7 @@ type Order implements Versioned & ReferenceExpandable { shippingInfo: ShippingInfo discountCodes: [DiscountCodeInfo!]! directDiscounts: [DirectDiscount!]! + discountTypeCombination: DiscountTypeCombination refusedGifts: [CartDiscount!]! refusedGiftsRefs: [Reference!]! paymentInfo: PaymentInfo diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDeal.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDeal.java new file mode 100644 index 00000000000..a5583e8beff --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDeal.java @@ -0,0 +1,127 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.constraints.NotNull; + +/** + *

Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BestDeal bestDeal = BestDeal.builder()
+ *             .chosenDiscountType("{chosenDiscountType}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BestDealImpl.class) +public interface BestDeal extends DiscountTypeCombination { + + /** + * discriminator value for BestDeal + */ + String BEST_DEAL = "BestDeal"; + + /** + *

Discount type that offers the best deal; the value can be product-discount or cart-discount.

+ * @return chosenDiscountType + */ + @NotNull + @JsonProperty("chosenDiscountType") + public String getChosenDiscountType(); + + /** + *

Discount type that offers the best deal; the value can be product-discount or cart-discount.

+ * @param chosenDiscountType value to be set + */ + + public void setChosenDiscountType(final String chosenDiscountType); + + /** + * factory method + * @return instance of BestDeal + */ + public static BestDeal of() { + return new BestDealImpl(); + } + + /** + * factory method to create a shallow copy BestDeal + * @param template instance to be copied + * @return copy instance + */ + public static BestDeal of(final BestDeal template) { + BestDealImpl instance = new BestDealImpl(); + instance.setChosenDiscountType(template.getChosenDiscountType()); + return instance; + } + + /** + * factory method to create a deep copy of BestDeal + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BestDeal deepCopy(@Nullable final BestDeal template) { + if (template == null) { + return null; + } + BestDealImpl instance = new BestDealImpl(); + instance.setChosenDiscountType(template.getChosenDiscountType()); + return instance; + } + + /** + * builder factory method for BestDeal + * @return builder + */ + public static BestDealBuilder builder() { + return BestDealBuilder.of(); + } + + /** + * create builder for BestDeal instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BestDealBuilder builder(final BestDeal template) { + return BestDealBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBestDeal(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealBuilder.java new file mode 100644 index 00000000000..6fae40f126d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealBuilder.java @@ -0,0 +1,82 @@ + +package com.commercetools.api.models.cart; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * BestDealBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BestDeal bestDeal = BestDeal.builder()
+ *             .chosenDiscountType("{chosenDiscountType}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BestDealBuilder implements Builder { + + private String chosenDiscountType; + + /** + *

Discount type that offers the best deal; the value can be product-discount or cart-discount.

+ * @param chosenDiscountType value to be set + * @return Builder + */ + + public BestDealBuilder chosenDiscountType(final String chosenDiscountType) { + this.chosenDiscountType = chosenDiscountType; + return this; + } + + /** + *

Discount type that offers the best deal; the value can be product-discount or cart-discount.

+ * @return chosenDiscountType + */ + + public String getChosenDiscountType() { + return this.chosenDiscountType; + } + + /** + * builds BestDeal with checking for non-null required values + * @return BestDeal + */ + public BestDeal build() { + Objects.requireNonNull(chosenDiscountType, BestDeal.class + ": chosenDiscountType is missing"); + return new BestDealImpl(chosenDiscountType); + } + + /** + * builds BestDeal without checking for non-null required values + * @return BestDeal + */ + public BestDeal buildUnchecked() { + return new BestDealImpl(chosenDiscountType); + } + + /** + * factory method for an instance of BestDealBuilder + * @return builder + */ + public static BestDealBuilder of() { + return new BestDealBuilder(); + } + + /** + * create builder for BestDeal instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BestDealBuilder of(final BestDeal template) { + BestDealBuilder builder = new BestDealBuilder(); + builder.chosenDiscountType = template.getChosenDiscountType(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealImpl.java new file mode 100644 index 00000000000..8dadb068ca6 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealImpl.java @@ -0,0 +1,94 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *

Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BestDealImpl implements BestDeal, ModelBase { + + private String type; + + private String chosenDiscountType; + + /** + * create instance with all properties + */ + @JsonCreator + BestDealImpl(@JsonProperty("chosenDiscountType") final String chosenDiscountType) { + this.chosenDiscountType = chosenDiscountType; + this.type = BEST_DEAL; + } + + /** + * create empty instance + */ + public BestDealImpl() { + this.type = BEST_DEAL; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

Discount type that offers the best deal; the value can be product-discount or cart-discount.

+ */ + + public String getChosenDiscountType() { + return this.chosenDiscountType; + } + + public void setChosenDiscountType(final String chosenDiscountType) { + this.chosenDiscountType = chosenDiscountType; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BestDealImpl that = (BestDealImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(chosenDiscountType, that.chosenDiscountType) + .append(type, that.type) + .append(chosenDiscountType, that.chosenDiscountType) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).append(chosenDiscountType).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("chosenDiscountType", chosenDiscountType) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Cart.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Cart.java index b33b6c13b5e..1f887d96a62 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Cart.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Cart.java @@ -389,6 +389,14 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod @JsonProperty("custom") public CustomFields getCustom(); + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ * @return discountTypeCombination + */ + @Valid + @JsonProperty("discountTypeCombination") + public DiscountTypeCombination getDiscountTypeCombination(); + /** *

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

* @return deleteDaysAfterLastModification @@ -763,6 +771,13 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod public void setCustom(final CustomFields custom); + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ * @param discountTypeCombination value to be set + */ + + public void setDiscountTypeCombination(final DiscountTypeCombination discountTypeCombination); + /** *

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

* @param deleteDaysAfterLastModification value to be set @@ -853,6 +868,7 @@ public static Cart of(final Cart template) { instance.setLocale(template.getLocale()); instance.setOrigin(template.getOrigin()); instance.setCustom(template.getCustom()); + instance.setDiscountTypeCombination(template.getDiscountTypeCombination()); instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification()); instance.setLastModifiedBy(template.getLastModifiedBy()); instance.setCreatedBy(template.getCreatedBy()); @@ -946,6 +962,8 @@ public static Cart deepCopy(@Nullable final Cart template) { instance.setLocale(template.getLocale()); instance.setOrigin(template.getOrigin()); instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom())); + instance.setDiscountTypeCombination( + com.commercetools.api.models.cart.DiscountTypeCombination.deepCopy(template.getDiscountTypeCombination())); instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification()); instance.setLastModifiedBy( com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartBuilder.java index 48099cc7059..47ce6dbb45f 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartBuilder.java @@ -143,6 +143,9 @@ public class CartBuilder implements Builder { @Nullable private com.commercetools.api.models.type.CustomFields custom; + @Nullable + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + @Nullable private Integer deleteDaysAfterLastModification; @@ -1500,6 +1503,32 @@ public CartBuilder custom(@Nullable final com.commercetools.api.models.type.Cust return this; } + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ * @param discountTypeCombination value to be set + * @return Builder + */ + + public CartBuilder discountTypeCombination( + @Nullable final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination) { + this.discountTypeCombination = discountTypeCombination; + return this; + } + + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ * @param builder function to build the discountTypeCombination value + * @return Builder + */ + + public CartBuilder discountTypeCombination( + Function> builder) { + this.discountTypeCombination = builder + .apply(com.commercetools.api.models.cart.DiscountTypeCombinationBuilder.of()) + .build(); + return this; + } + /** *

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

* @param deleteDaysAfterLastModification value to be set @@ -1974,6 +2003,16 @@ public com.commercetools.api.models.type.CustomFields getCustom() { return this.custom; } + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ * @return discountTypeCombination + */ + + @Nullable + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

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

* @return deleteDaysAfterLastModification @@ -2033,7 +2072,8 @@ public Cart build() { taxedShippingPrice, discountOnTotalPrice, taxMode, taxRoundingMode, taxCalculationMode, inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, - paymentInfo, country, locale, origin, custom, deleteDaysAfterLastModification, lastModifiedBy, createdBy); + paymentInfo, country, locale, origin, custom, discountTypeCombination, deleteDaysAfterLastModification, + lastModifiedBy, createdBy); } /** @@ -2046,7 +2086,8 @@ public Cart buildUnchecked() { taxedShippingPrice, discountOnTotalPrice, taxMode, taxRoundingMode, taxCalculationMode, inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, - paymentInfo, country, locale, origin, custom, deleteDaysAfterLastModification, lastModifiedBy, createdBy); + paymentInfo, country, locale, origin, custom, discountTypeCombination, deleteDaysAfterLastModification, + lastModifiedBy, createdBy); } /** @@ -2104,6 +2145,7 @@ public static CartBuilder of(final Cart template) { builder.locale = template.getLocale(); builder.origin = template.getOrigin(); builder.custom = template.getCustom(); + builder.discountTypeCombination = template.getDiscountTypeCombination(); builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification(); builder.lastModifiedBy = template.getLastModifiedBy(); builder.createdBy = template.getCreatedBy(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartImpl.java index acf8ee82bac..5f47944ddb5 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartImpl.java @@ -102,6 +102,8 @@ public class CartImpl implements Cart, ModelBase { private com.commercetools.api.models.type.CustomFields custom; + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + private Integer deleteDaysAfterLastModification; private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; @@ -149,6 +151,7 @@ public class CartImpl implements Cart, ModelBase { @JsonProperty("country") final String country, @JsonProperty("locale") final String locale, @JsonProperty("origin") final com.commercetools.api.models.cart.CartOrigin origin, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, + @JsonProperty("discountTypeCombination") final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination, @JsonProperty("deleteDaysAfterLastModification") final Integer deleteDaysAfterLastModification, @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy) { @@ -192,6 +195,7 @@ public class CartImpl implements Cart, ModelBase { this.locale = locale; this.origin = origin; this.custom = custom; + this.discountTypeCombination = discountTypeCombination; this.deleteDaysAfterLastModification = deleteDaysAfterLastModification; this.lastModifiedBy = lastModifiedBy; this.createdBy = createdBy; @@ -534,6 +538,14 @@ public com.commercetools.api.models.type.CustomFields getCustom() { return this.custom; } + /** + *

Indicates if a combination of discount types can apply on a Cart.

+ */ + + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

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

*/ @@ -755,6 +767,11 @@ public void setCustom(final com.commercetools.api.models.type.CustomFields custo this.custom = custom; } + public void setDiscountTypeCombination( + final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination) { + this.discountTypeCombination = discountTypeCombination; + } + public void setDeleteDaysAfterLastModification(final Integer deleteDaysAfterLastModification) { this.deleteDaysAfterLastModification = deleteDaysAfterLastModification; } @@ -817,6 +834,7 @@ public boolean equals(Object o) { .append(locale, that.locale) .append(origin, that.origin) .append(custom, that.custom) + .append(discountTypeCombination, that.discountTypeCombination) .append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification) .append(lastModifiedBy, that.lastModifiedBy) .append(createdBy, that.createdBy) @@ -860,6 +878,7 @@ public boolean equals(Object o) { .append(locale, that.locale) .append(origin, that.origin) .append(custom, that.custom) + .append(discountTypeCombination, that.discountTypeCombination) .append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification) .append(lastModifiedBy, that.lastModifiedBy) .append(createdBy, that.createdBy) @@ -908,6 +927,7 @@ public int hashCode() { .append(locale) .append(origin) .append(custom) + .append(discountTypeCombination) .append(deleteDaysAfterLastModification) .append(lastModifiedBy) .append(createdBy) @@ -956,6 +976,7 @@ public String toString() { .append("locale", locale) .append("origin", origin) .append("custom", custom) + .append("discountTypeCombination", discountTypeCombination) .append("deleteDaysAfterLastModification", deleteDaysAfterLastModification) .append("lastModifiedBy", lastModifiedBy) .append("createdBy", createdBy) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombination.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombination.java new file mode 100644 index 00000000000..097afc641ea --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombination.java @@ -0,0 +1,106 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.constraints.NotNull; + +/** + * DiscountTypeCombination + * + *
+ * Example to create a subtype instance using the builder pattern + *
+ *

+ *     DiscountTypeCombination discountTypeCombination = DiscountTypeCombination.bestDealBuilder()
+ *             chosenDiscountType("{chosenDiscountType}")
+ *             .build()
+ * 
+ *
+ */ +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.commercetools.api.models.cart.BestDealImpl.class, name = BestDeal.BEST_DEAL), + @JsonSubTypes.Type(value = com.commercetools.api.models.cart.StackingImpl.class, name = Stacking.STACKING) }) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", defaultImpl = DiscountTypeCombinationImpl.class, visible = true) +@JsonDeserialize(as = DiscountTypeCombinationImpl.class) +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface DiscountTypeCombination { + + /** + * + * @return type + */ + @NotNull + @JsonProperty("type") + public String getType(); + + /** + * factory method to create a deep copy of DiscountTypeCombination + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountTypeCombination deepCopy(@Nullable final DiscountTypeCombination template) { + if (template == null) { + return null; + } + if (template instanceof com.commercetools.api.models.cart.BestDeal) { + return com.commercetools.api.models.cart.BestDeal + .deepCopy((com.commercetools.api.models.cart.BestDeal) template); + } + if (template instanceof com.commercetools.api.models.cart.Stacking) { + return com.commercetools.api.models.cart.Stacking + .deepCopy((com.commercetools.api.models.cart.Stacking) template); + } + DiscountTypeCombinationImpl instance = new DiscountTypeCombinationImpl(); + return instance; + } + + /** + * builder for bestDeal subtype + * @return builder + */ + public static com.commercetools.api.models.cart.BestDealBuilder bestDealBuilder() { + return com.commercetools.api.models.cart.BestDealBuilder.of(); + } + + /** + * builder for stacking subtype + * @return builder + */ + public static com.commercetools.api.models.cart.StackingBuilder stackingBuilder() { + return com.commercetools.api.models.cart.StackingBuilder.of(); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountTypeCombination(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationBuilder.java new file mode 100644 index 00000000000..778df71a66a --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationBuilder.java @@ -0,0 +1,30 @@ + +package com.commercetools.api.models.cart; + +import java.util.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountTypeCombinationBuilder + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountTypeCombinationBuilder { + + public com.commercetools.api.models.cart.BestDealBuilder bestDealBuilder() { + return com.commercetools.api.models.cart.BestDealBuilder.of(); + } + + public com.commercetools.api.models.cart.StackingBuilder stackingBuilder() { + return com.commercetools.api.models.cart.StackingBuilder.of(); + } + + /** + * factory method for an instance of DiscountTypeCombinationBuilder + * @return builder + */ + public static DiscountTypeCombinationBuilder of() { + return new DiscountTypeCombinationBuilder(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationImpl.java new file mode 100644 index 00000000000..c577a6af6cd --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountTypeCombinationImpl.java @@ -0,0 +1,72 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * DiscountTypeCombination + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountTypeCombinationImpl implements DiscountTypeCombination, ModelBase { + + private String type; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountTypeCombinationImpl(@JsonProperty("type") final String type) { + this.type = type; + } + + /** + * create empty instance + */ + public DiscountTypeCombinationImpl() { + } + + /** + * + */ + + public String getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountTypeCombinationImpl that = (DiscountTypeCombinationImpl) o; + + return new EqualsBuilder().append(type, that.type).append(type, that.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Stacking.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Stacking.java new file mode 100644 index 00000000000..b26edd3481c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/Stacking.java @@ -0,0 +1,107 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Indicates both Product Discounts and Cart Discounts apply to a Cart and Order.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     Stacking stacking = Stacking.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = StackingImpl.class) +public interface Stacking extends DiscountTypeCombination { + + /** + * discriminator value for Stacking + */ + String STACKING = "Stacking"; + + /** + * factory method + * @return instance of Stacking + */ + public static Stacking of() { + return new StackingImpl(); + } + + /** + * factory method to create a shallow copy Stacking + * @param template instance to be copied + * @return copy instance + */ + public static Stacking of(final Stacking template) { + StackingImpl instance = new StackingImpl(); + return instance; + } + + /** + * factory method to create a deep copy of Stacking + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static Stacking deepCopy(@Nullable final Stacking template) { + if (template == null) { + return null; + } + StackingImpl instance = new StackingImpl(); + return instance; + } + + /** + * builder factory method for Stacking + * @return builder + */ + public static StackingBuilder builder() { + return StackingBuilder.of(); + } + + /** + * create builder for Stacking instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static StackingBuilder builder(final Stacking template) { + return StackingBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withStacking(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingBuilder.java new file mode 100644 index 00000000000..9cbf863ba43 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingBuilder.java @@ -0,0 +1,57 @@ + +package com.commercetools.api.models.cart; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * StackingBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     Stacking stacking = Stacking.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class StackingBuilder implements Builder { + + /** + * builds Stacking with checking for non-null required values + * @return Stacking + */ + public Stacking build() { + return new StackingImpl(); + } + + /** + * builds Stacking without checking for non-null required values + * @return Stacking + */ + public Stacking buildUnchecked() { + return new StackingImpl(); + } + + /** + * factory method for an instance of StackingBuilder + * @return builder + */ + public static StackingBuilder of() { + return new StackingBuilder(); + } + + /** + * create builder for Stacking instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static StackingBuilder of(final Stacking template) { + StackingBuilder builder = new StackingBuilder(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingImpl.java new file mode 100644 index 00000000000..76e8e6240e9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/StackingImpl.java @@ -0,0 +1,65 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *

Indicates both Product Discounts and Cart Discounts apply to a Cart and Order.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class StackingImpl implements Stacking, ModelBase { + + private String type; + + /** + * create instance with all properties + */ + @JsonCreator + public StackingImpl() { + this.type = STACKING; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + StackingImpl that = (StackingImpl) o; + + return new EqualsBuilder().append(type, that.type).append(type, that.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/Order.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/Order.java index cf456944fa7..c2f77a74eb7 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/Order.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/Order.java @@ -16,6 +16,7 @@ import com.commercetools.api.models.cart.DirectDiscount; import com.commercetools.api.models.cart.DiscountCodeInfo; import com.commercetools.api.models.cart.DiscountOnTotalPrice; +import com.commercetools.api.models.cart.DiscountTypeCombination; import com.commercetools.api.models.cart.InventoryMode; import com.commercetools.api.models.cart.LineItem; import com.commercetools.api.models.cart.RoundingMode; @@ -445,6 +446,14 @@ public interface Order extends BaseResource, OrderMixin, com.commercetools.api.m @JsonProperty("returnInfo") public List getReturnInfo(); + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @return discountTypeCombination + */ + @Valid + @JsonProperty("discountTypeCombination") + public DiscountTypeCombination getDiscountTypeCombination(); + /** *

Internal-only field.

* @return lastMessageSequenceNumber @@ -892,6 +901,13 @@ public interface Order extends BaseResource, OrderMixin, com.commercetools.api.m public void setReturnInfo(final List returnInfo); + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @param discountTypeCombination value to be set + */ + + public void setDiscountTypeCombination(final DiscountTypeCombination discountTypeCombination); + /** *

Internal-only field.

* @param lastMessageSequenceNumber value to be set @@ -1002,6 +1018,7 @@ public static Order of(final Order template) { instance.setState(template.getState()); instance.setSyncInfo(template.getSyncInfo()); instance.setReturnInfo(template.getReturnInfo()); + instance.setDiscountTypeCombination(template.getDiscountTypeCombination()); instance.setLastMessageSequenceNumber(template.getLastMessageSequenceNumber()); instance.setCustom(template.getCustom()); instance.setCompletedAt(template.getCompletedAt()); @@ -1115,6 +1132,8 @@ public static Order deepCopy(@Nullable final Order template) { .map(com.commercetools.api.models.order.ReturnInfo::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setDiscountTypeCombination( + com.commercetools.api.models.cart.DiscountTypeCombination.deepCopy(template.getDiscountTypeCombination())); instance.setLastMessageSequenceNumber(template.getLastMessageSequenceNumber()); instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom())); instance.setCompletedAt(template.getCompletedAt()); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderBuilder.java index 4084de448bc..510963a4c99 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderBuilder.java @@ -161,6 +161,9 @@ public class OrderBuilder implements Builder { @Nullable private java.util.List returnInfo; + @Nullable + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + @Deprecated @Nullable private Long lastMessageSequenceNumber; @@ -1789,6 +1792,32 @@ public OrderBuilder setReturnInfo( return returnInfo(builder.apply(com.commercetools.api.models.order.ReturnInfoBuilder.of())); } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @param discountTypeCombination value to be set + * @return Builder + */ + + public OrderBuilder discountTypeCombination( + @Nullable final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination) { + this.discountTypeCombination = discountTypeCombination; + return this; + } + + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @param builder function to build the discountTypeCombination value + * @return Builder + */ + + public OrderBuilder discountTypeCombination( + Function> builder) { + this.discountTypeCombination = builder + .apply(com.commercetools.api.models.cart.DiscountTypeCombinationBuilder.of()) + .build(); + return this; + } + /** *

Internal-only field.

* @param lastMessageSequenceNumber value to be set @@ -2375,6 +2404,16 @@ public java.util.List getReturnIn return this.returnInfo; } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @return discountTypeCombination + */ + + @Nullable + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

Internal-only field.

* @return lastMessageSequenceNumber @@ -2449,7 +2488,8 @@ public Order build() { inventoryMode, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, paymentInfo, country, locale, origin, cart, quote, orderState, shipmentState, paymentState, state, syncInfo, - returnInfo, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, createdBy); + returnInfo, discountTypeCombination, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, + createdBy); } /** @@ -2463,7 +2503,8 @@ public Order buildUnchecked() { inventoryMode, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, paymentInfo, country, locale, origin, cart, quote, orderState, shipmentState, paymentState, state, syncInfo, - returnInfo, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, createdBy); + returnInfo, discountTypeCombination, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, + createdBy); } /** @@ -2527,6 +2568,7 @@ public static OrderBuilder of(final Order template) { builder.state = template.getState(); builder.syncInfo = template.getSyncInfo(); builder.returnInfo = template.getReturnInfo(); + builder.discountTypeCombination = template.getDiscountTypeCombination(); builder.lastMessageSequenceNumber = template.getLastMessageSequenceNumber(); builder.custom = template.getCustom(); builder.completedAt = template.getCompletedAt(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderImpl.java index 781af8403a2..3787612a73a 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderImpl.java @@ -114,6 +114,8 @@ public class OrderImpl implements Order, ModelBase { private java.util.List returnInfo; + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + @Deprecated private Long lastMessageSequenceNumber; @@ -173,6 +175,7 @@ public class OrderImpl implements Order, ModelBase { @JsonProperty("state") final com.commercetools.api.models.state.StateReference state, @JsonProperty("syncInfo") final java.util.List syncInfo, @JsonProperty("returnInfo") final java.util.List returnInfo, + @JsonProperty("discountTypeCombination") final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination, @JsonProperty("lastMessageSequenceNumber") final Long lastMessageSequenceNumber, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, @JsonProperty("completedAt") final java.time.ZonedDateTime completedAt, @@ -224,6 +227,7 @@ public class OrderImpl implements Order, ModelBase { this.state = state; this.syncInfo = syncInfo; this.returnInfo = returnInfo; + this.discountTypeCombination = discountTypeCombination; this.lastMessageSequenceNumber = lastMessageSequenceNumber; this.custom = custom; this.completedAt = completedAt; @@ -616,6 +620,14 @@ public java.util.List getReturnIn return this.returnInfo; } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ */ + + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

Internal-only field.

*/ @@ -885,6 +897,11 @@ public void setReturnInfo(final java.util.List { @Nullable private java.util.List returnInfo; + @Nullable + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + @Deprecated @Nullable private Long lastMessageSequenceNumber; @@ -1798,6 +1801,32 @@ public StagedOrderBuilder setReturnInfo( return returnInfo(builder.apply(com.commercetools.api.models.order.ReturnInfoBuilder.of())); } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @param discountTypeCombination value to be set + * @return Builder + */ + + public StagedOrderBuilder discountTypeCombination( + @Nullable final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination) { + this.discountTypeCombination = discountTypeCombination; + return this; + } + + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @param builder function to build the discountTypeCombination value + * @return Builder + */ + + public StagedOrderBuilder discountTypeCombination( + Function> builder) { + this.discountTypeCombination = builder + .apply(com.commercetools.api.models.cart.DiscountTypeCombinationBuilder.of()) + .build(); + return this; + } + /** *

Internal-only field.

* @param lastMessageSequenceNumber value to be set @@ -2384,6 +2413,16 @@ public java.util.List getReturnIn return this.returnInfo; } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ * @return discountTypeCombination + */ + + @Nullable + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

Internal-only field.

* @return lastMessageSequenceNumber @@ -2458,7 +2497,8 @@ public StagedOrder build() { inventoryMode, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, paymentInfo, country, locale, origin, cart, quote, orderState, shipmentState, paymentState, state, syncInfo, - returnInfo, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, createdBy); + returnInfo, discountTypeCombination, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, + createdBy); } /** @@ -2472,7 +2512,8 @@ public StagedOrder buildUnchecked() { inventoryMode, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts, refusedGifts, paymentInfo, country, locale, origin, cart, quote, orderState, shipmentState, paymentState, state, syncInfo, - returnInfo, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, createdBy); + returnInfo, discountTypeCombination, lastMessageSequenceNumber, custom, completedAt, lastModifiedBy, + createdBy); } /** @@ -2536,6 +2577,7 @@ public static StagedOrderBuilder of(final StagedOrder template) { builder.state = template.getState(); builder.syncInfo = template.getSyncInfo(); builder.returnInfo = template.getReturnInfo(); + builder.discountTypeCombination = template.getDiscountTypeCombination(); builder.lastMessageSequenceNumber = template.getLastMessageSequenceNumber(); builder.custom = template.getCustom(); builder.completedAt = template.getCompletedAt(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderImpl.java index 88e169c8d9e..e11393fa68c 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderImpl.java @@ -114,6 +114,8 @@ public class StagedOrderImpl implements StagedOrder, ModelBase { private java.util.List returnInfo; + private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination; + @Deprecated private Long lastMessageSequenceNumber; @@ -173,6 +175,7 @@ public class StagedOrderImpl implements StagedOrder, ModelBase { @JsonProperty("state") final com.commercetools.api.models.state.StateReference state, @JsonProperty("syncInfo") final java.util.List syncInfo, @JsonProperty("returnInfo") final java.util.List returnInfo, + @JsonProperty("discountTypeCombination") final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination, @JsonProperty("lastMessageSequenceNumber") final Long lastMessageSequenceNumber, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, @JsonProperty("completedAt") final java.time.ZonedDateTime completedAt, @@ -224,6 +227,7 @@ public class StagedOrderImpl implements StagedOrder, ModelBase { this.state = state; this.syncInfo = syncInfo; this.returnInfo = returnInfo; + this.discountTypeCombination = discountTypeCombination; this.lastMessageSequenceNumber = lastMessageSequenceNumber; this.custom = custom; this.completedAt = completedAt; @@ -616,6 +620,14 @@ public java.util.List getReturnIn return this.returnInfo; } + /** + *

Indicates if a combination of discount types can apply on an Order.

+ */ + + public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountTypeCombination() { + return this.discountTypeCombination; + } + /** *

Internal-only field.

*/ @@ -885,6 +897,11 @@ public void setReturnInfo(final java.util.List type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, BestDealQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder chosenDiscountType() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("chosenDiscountType")), + p -> new CombinationQueryPredicate<>(p, BestDealQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartQueryBuilderDsl.java index de000476008..bc7cdda90f1 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartQueryBuilderDsl.java @@ -351,6 +351,16 @@ public CombinationQueryPredicate custom( CartQueryBuilderDsl::of); } + public CombinationQueryPredicate discountTypeCombination( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountTypeCombination")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart.DiscountTypeCombinationQueryBuilderDsl.of())), + CartQueryBuilderDsl::of); + } + public LongComparisonPredicateBuilder deleteDaysAfterLastModification() { return new LongComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("deleteDaysAfterLastModification")), diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountTypeCombinationQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountTypeCombinationQueryBuilderDsl.java new file mode 100644 index 00000000000..a9b561d8b08 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountTypeCombinationQueryBuilderDsl.java @@ -0,0 +1,35 @@ + +package com.commercetools.api.predicates.query.cart; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountTypeCombinationQueryBuilderDsl { + public DiscountTypeCombinationQueryBuilderDsl() { + } + + public static DiscountTypeCombinationQueryBuilderDsl of() { + return new DiscountTypeCombinationQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountTypeCombinationQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate asBestDeal( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.cart.BestDealQueryBuilderDsl.of()), + DiscountTypeCombinationQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asStacking( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.cart.StackingQueryBuilderDsl.of()), + DiscountTypeCombinationQueryBuilderDsl::of); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/StackingQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/StackingQueryBuilderDsl.java new file mode 100644 index 00000000000..e59a65426da --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/StackingQueryBuilderDsl.java @@ -0,0 +1,20 @@ + +package com.commercetools.api.predicates.query.cart; + +import com.commercetools.api.predicates.query.*; + +public class StackingQueryBuilderDsl { + public StackingQueryBuilderDsl() { + } + + public static StackingQueryBuilderDsl of() { + return new StackingQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, StackingQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java index b66277e3c1b..48587fd6707 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java @@ -411,6 +411,16 @@ public CollectionPredicateBuilder returnInfo() { p -> new CombinationQueryPredicate<>(p, OrderQueryBuilderDsl::of)); } + public CombinationQueryPredicate discountTypeCombination( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountTypeCombination")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart.DiscountTypeCombinationQueryBuilderDsl.of())), + OrderQueryBuilderDsl::of); + } + public LongComparisonPredicateBuilder lastMessageSequenceNumber() { return new LongComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastMessageSequenceNumber")), diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java index bce97a27fd1..ffbee4f6124 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java @@ -411,6 +411,16 @@ public CollectionPredicateBuilder returnInfo() { p -> new CombinationQueryPredicate<>(p, StagedOrderQueryBuilderDsl::of)); } + public CombinationQueryPredicate discountTypeCombination( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountTypeCombination")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart.DiscountTypeCombinationQueryBuilderDsl.of())), + StagedOrderQueryBuilderDsl::of); + } + public LongComparisonPredicateBuilder lastMessageSequenceNumber() { return new LongComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastMessageSequenceNumber")), diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/BestDealTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/BestDealTest.java new file mode 100644 index 00000000000..de10a70b55d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/BestDealTest.java @@ -0,0 +1,36 @@ + +package com.commercetools.api.models.cart; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class BestDealTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BestDealBuilder builder) { + BestDeal bestDeal = builder.buildUnchecked(); + Assertions.assertThat(bestDeal).isInstanceOf(BestDeal.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { BestDeal.builder().chosenDiscountType("chosenDiscountType") } }; + } + + @Test + public void chosenDiscountType() { + BestDeal value = BestDeal.of(); + value.setChosenDiscountType("chosenDiscountType"); + Assertions.assertThat(value.getChosenDiscountType()).isEqualTo("chosenDiscountType"); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartTest.java index ef12c05844a..5d0e7e4ff54 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartTest.java @@ -91,6 +91,8 @@ public static Object[][] objectBuilder() { new Object[] { Cart.builder().origin(com.commercetools.api.models.cart.CartOrigin.findEnum("Customer")) }, new Object[] { Cart.builder().custom(new com.commercetools.api.models.type.CustomFieldsImpl()) }, + new Object[] { Cart.builder() + .discountTypeCombination(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()) }, new Object[] { Cart.builder().deleteDaysAfterLastModification(3) }, new Object[] { Cart.builder().createdAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, new Object[] { Cart.builder().lastModifiedAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, @@ -394,6 +396,14 @@ public void custom() { Assertions.assertThat(value.getCustom()).isEqualTo(new com.commercetools.api.models.type.CustomFieldsImpl()); } + @Test + public void discountTypeCombination() { + Cart value = Cart.of(); + value.setDiscountTypeCombination(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()); + Assertions.assertThat(value.getDiscountTypeCombination()) + .isEqualTo(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()); + } + @Test public void deleteDaysAfterLastModification() { Cart value = Cart.of(); diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/StackingTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/StackingTest.java new file mode 100644 index 00000000000..7e46b2411b8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/StackingTest.java @@ -0,0 +1,13 @@ + +package com.commercetools.api.models.cart; + +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class StackingTest { + +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/OrderTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/OrderTest.java index b9430707ace..2d482aa3147 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/OrderTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/OrderTest.java @@ -105,6 +105,8 @@ public static Object[][] objectBuilder() { Order.builder() .returnInfo(Collections .singletonList(new com.commercetools.api.models.order.ReturnInfoImpl())) }, + new Object[] { Order.builder() + .discountTypeCombination(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()) }, new Object[] { Order.builder().lastMessageSequenceNumber(8L) }, new Object[] { Order.builder().custom(new com.commercetools.api.models.type.CustomFieldsImpl()) }, new Object[] { Order.builder().completedAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, @@ -456,6 +458,14 @@ public void returnInfo() { .isEqualTo(Collections.singletonList(new com.commercetools.api.models.order.ReturnInfoImpl())); } + @Test + public void discountTypeCombination() { + Order value = Order.of(); + value.setDiscountTypeCombination(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()); + Assertions.assertThat(value.getDiscountTypeCombination()) + .isEqualTo(new com.commercetools.api.models.cart.DiscountTypeCombinationImpl()); + } + @Test public void lastMessageSequenceNumber() { Order value = Order.of(); diff --git a/references.txt b/references.txt index aeaf42d0d27..1416b2f12e7 100644 --- a/references.txt +++ b/references.txt @@ -376,3 +376,4 @@ cf0f702598daf6d644ae327099b96b83f5539dfb 75612a593ac1a7d1fa516c2b196d10690fbb9e66 0db86e55e10010d0994faa7cffb5b1301dbac71f 4c16ce73d5391802f2cf109581ac962749c027a5 +5f1b9a7bef052b7f67754d4eccf9d18d139d53c1