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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
747 changes: 747 additions & 0 deletions changes.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,10 @@ input CartDraft {
origin: CartOrigin = Customer
}

type CartFrozen implements MessagePayload {
type: String!
}

type CartLimitWithCurrent implements LimitWithCurrent {
limit: Long
current: Long!
Expand All @@ -2057,6 +2061,22 @@ type CartLimitsProjection {
total: CartLimitWithCurrent!
}

enum CartMergeMode {
"""
`LineItem`s of the anonymous cart will be copied to the customer’s active cart that has been modified most recently.

The `CartState` of the anonymous cart gets changed to `Merged` while the `CartState` of the customer’s cart remains `Active`.

`CustomLineItems` and `CustomFields` of the anonymous cart will not be copied to the customers cart.

If a `LineItem` in the anonymous cart matches an existing line item in the customer’s cart (same product ID and variant ID), the maximum quantity of both LineItems is used as the new quantity. In that case `CustomFields` on the `LineItem` of the anonymous cart will not be in the resulting `LineItem`.
"""
MergeWithExistingCustomerCart

"The anonymous cart is used as new active customer cart. No `LineItem`s get merged."
UseAsNewActiveCustomerCart
}

enum CartOrigin {
"The cart was created by the customer. This is the default value"
Customer
Expand Down Expand Up @@ -2107,6 +2127,10 @@ enum CartState {
Ordered
}

type CartUnfrozen implements MessagePayload {
type: String!
}

input CartUpdateAction {
addCustomShippingMethod: AddCartCustomShippingMethod
addDiscountCode: AddCartDiscountCode
Expand Down Expand Up @@ -4612,6 +4636,17 @@ input EnumValueInput {
label: String!
}

type RecurringOrderFailureError {
"Error identifier"
code: String!

"Plain text description of the cause of the error."
message: String!

"Information about the cause of the error."
details: Json!
}

type EventBridgeDestination implements Destination {
source: String!
region: String!
Expand Down Expand Up @@ -5306,6 +5341,7 @@ type InventoryEntryQuantitySet implements MessagePayload {
newQuantityOnStock: Long!
oldAvailableQuantity: Long!
newAvailableQuantity: Long!
sku: String
supplyChannel: Channel
supplyChannelRef: Reference
type: String!
Expand Down Expand Up @@ -5825,6 +5861,13 @@ interface MeQueryInterface implements CartQueryInterface & ActiveCartInterface &
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}

input MergeCartDraft {
anonymousCart: ResourceIdentifierInput
mergeMode: CartMergeMode = MergeWithExistingCustomerCart
anonymousId: String
updateProductData: Boolean = false
}

type Message implements Versioned & ReferenceExpandable {
id: String!
type: String!
Expand Down Expand Up @@ -6442,6 +6485,11 @@ type Mutation {
"Create/modify entity as an associate in business-unit."
asAssociate: AsAssociateArgument): Cart

mergeCart(customerId: String!, draft: MergeCartDraft!,

"The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions."
storeKey: KeyReferenceInput): Cart

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
createMyCart(draft: MyCartDraft!,

Expand Down Expand Up @@ -10452,10 +10500,10 @@ type Query {
apiClient(id: String!): APIClientWithoutSecret
apiClients(where: String, sort: [String!], limit: Int, offset: Int): APIClientWithoutSecretQueryResult!
limits: ProjectCustomLimitsProjection!
productProjectionSearch(projectExpandedProducts: Boolean = false, locale: Locale, text: String, facets: [SearchFacetInput!] = [], filters: [SearchFilterInput!] = [], queryFilters: [SearchFilterInput!] = [], facetFilters: [SearchFilterInput!] = [], sorts: [String!] = [], limit: Int = 10, offset: Int = 0, fuzzy: Boolean = false, fuzzyLevel: Int, priceSelector: PriceSelectorInput, markMatchingVariants: Boolean = false,
productProjectionSearch(projectExpandedProducts: Boolean = false, locale: Locale, text: String, facets: [SearchFacetInput!] = [], filters: [SearchFilterInput!] = [], queryFilters: [SearchFilterInput!] = [], facetFilters: [SearchFilterInput!] = [], sorts: [String!] = [], limit: Int = 10, offset: Int = 0, fuzzy: Boolean = false, fuzzyLevel: Int, priceSelector: PriceSelectorInput, markMatchingVariants: Boolean,

"Deprecated: please use 'markMatchingVariants'."
markMatchingVariant: Boolean = false, storeProjection: String, localeProjection: [Locale!], staged: Boolean = false): ProductProjectionSearchResult!
markMatchingVariant: Boolean, storeProjection: String, localeProjection: [Locale!], staged: Boolean = false): ProductProjectionSearchResult!

"""
StandalonePrices are managed and queried through the StandalonePrices API
Expand Down Expand Up @@ -11016,6 +11064,15 @@ type RecurringOrderCustomFieldChanged implements MessagePayload {
type: String!
}

type RecurringOrderFailed implements MessagePayload {
cartId: String!
failedAt: DateTime!
failureReason: String!
orderScheduledAt: DateTime!
errors: [RecurringOrderFailureError!]
type: String!
}

type RecurringOrderCustomFieldRemoved implements MessagePayload {
name: String!
type: String!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@

package com.commercetools.api.client;

import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;

import com.fasterxml.jackson.core.type.TypeReference;

import io.vrap.rmf.base.client.*;
import io.vrap.rmf.base.client.utils.Generated;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
* <p>Merges items from an anonymous Cart into the most recently modified active Cart of a Customer. If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. For more information, see <span>Merge behavior</span>.</p>
*
* <hr>
* <div class=code-example>
* <pre><code class='java'>{@code
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
* .withProjectKey("{projectKey}")
* .carts()
* .customerIdWithCustomerIdValueMerge("{customerId}")
* .post(null)
* .execute()
* }</code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ByProjectKeyCartsCustomerIdByCustomerIdMergePost extends
TypeBodyApiMethod<ByProjectKeyCartsCustomerIdByCustomerIdMergePost, com.commercetools.api.models.cart.Cart, com.commercetools.api.models.cart.MergeCartDraft>
implements com.commercetools.api.client.ErrorableTrait<ByProjectKeyCartsCustomerIdByCustomerIdMergePost> {

@Override
public TypeReference<com.commercetools.api.models.cart.Cart> resultType() {
return new TypeReference<com.commercetools.api.models.cart.Cart>() {
};
}

private String projectKey;
private String customerId;

private com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft;

public ByProjectKeyCartsCustomerIdByCustomerIdMergePost(final ApiHttpClient apiHttpClient, String projectKey,
String customerId, com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft) {
super(apiHttpClient);
this.projectKey = projectKey;
this.customerId = customerId;
this.mergeCartDraft = mergeCartDraft;
}

public ByProjectKeyCartsCustomerIdByCustomerIdMergePost(ByProjectKeyCartsCustomerIdByCustomerIdMergePost t) {
super(t);
this.projectKey = t.projectKey;
this.customerId = t.customerId;
this.mergeCartDraft = t.mergeCartDraft;
}

@Override
protected ApiHttpRequest buildHttpRequest() {
List<String> params = new ArrayList<>(getQueryParamUriStrings());
String httpRequestPath = String.format("%s/carts/customer-id=%s/merge", encodePathParam(this.projectKey),
encodePathParam(this.customerId));
if (!params.isEmpty()) {
httpRequestPath += "?" + String.join("&", params);
}
return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(),
io.vrap.rmf.base.client.utils.json.JsonUtils
.executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(mergeCartDraft)));

}

@Override
public ApiHttpResponse<com.commercetools.api.models.cart.Cart> executeBlocking(final ApiHttpClient client,
final Duration timeout) {
return executeBlocking(client, timeout, com.commercetools.api.models.cart.Cart.class);
}

@Override
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> execute(
final ApiHttpClient client) {
return execute(client, com.commercetools.api.models.cart.Cart.class);
}

public String getProjectKey() {
return this.projectKey;
}

public String getCustomerId() {
return this.customerId;
}

public void setProjectKey(final String projectKey) {
this.projectKey = projectKey;
}

public void setCustomerId(final String customerId) {
this.customerId = customerId;
}

public com.commercetools.api.models.cart.MergeCartDraft getBody() {
return mergeCartDraft;
}

public ByProjectKeyCartsCustomerIdByCustomerIdMergePost withBody(
com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft) {
ByProjectKeyCartsCustomerIdByCustomerIdMergePost t = copy();
t.mergeCartDraft = mergeCartDraft;
return t;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;

if (o == null || getClass() != o.getClass())
return false;

ByProjectKeyCartsCustomerIdByCustomerIdMergePost that = (ByProjectKeyCartsCustomerIdByCustomerIdMergePost) o;

return new EqualsBuilder().append(projectKey, that.projectKey)
.append(customerId, that.customerId)
.append(mergeCartDraft, that.mergeCartDraft)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(projectKey).append(customerId).append(mergeCartDraft).toHashCode();
}

@Override
protected ByProjectKeyCartsCustomerIdByCustomerIdMergePost copy() {
return new ByProjectKeyCartsCustomerIdByCustomerIdMergePost(this);
}
}
Loading
Loading