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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<details>
<summary>Added Type(s)</summary>

- added type `CartLock`
- added type `CartLockCartAction`
- added type `CartSetPurchaseOrderNumberAction`
- added type `CartUnlockCartAction`
- added type `CartPurchaseOrderNumberSetMessage`
- added type `CartPurchaseOrderNumberSetMessagePayload`
</details>
Expand All @@ -12,6 +15,7 @@
<details>
<summary>Added Property(s)</summary>

- added property `lock` to type `Cart`
- added property `purchaseOrderNumber` to type `Cart`
- added property `purchaseOrderNumber` to type `CartDraft`
</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,7 @@ type Cart implements Versioned & ReferenceExpandable {
discountTypeCombination: DiscountTypeCombination
cartState: CartState!
key: String
lock: CartLock
custom: CustomFieldsType
deleteDaysAfterLastModification: Int
totalLineItemQuantity: Long
Expand Down Expand Up @@ -2114,6 +2115,12 @@ type CartLimitsProjection {
total: CartLimitWithCurrent!
}

"Prevents edits on a Cart unless the caller has the `manage_locked_carts` OAuth scope."
type CartLock {
createdAt: DateTime!
clientId: String!
}

enum CartMergeMode {
"""
`LineItem`s of the anonymous cart will be copied to the customer’s active cart that has been modified most recently.
Expand Down Expand Up @@ -2253,6 +2260,8 @@ input CartUpdateAction {
updateItemShippingAddress: UpdateCartItemShippingAddress
freezeCart: FreezeCart
unfreezeCart: UnfreezeCart
lockCart: LockCart
unlockCart: UnlockCart
applyDeltaToLineItemShippingDetailsTargets: ApplyCartDeltaToLineItemShippingDetailsTargets
applyDeltaToCustomLineItemShippingDetailsTargets: ApplyCartDeltaToCustomLineItemShippingDetailsTargets
addLineItem: AddCartLineItem
Expand Down Expand Up @@ -5849,6 +5858,10 @@ type Location {
state: String
}

input LockCart {
dummy: String
}

"The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1."
scalar Long

Expand Down Expand Up @@ -16796,6 +16809,10 @@ input UnfreezeCart {
dummy: String
}

input UnlockCart {
dummy: String
}

input UnpublishProduct {
dummy: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,14 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod
@JsonProperty("discountTypeCombination")
public DiscountTypeCombination getDiscountTypeCombination();

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @return lock
*/
@Valid
@JsonProperty("lock")
public CartLock getLock();

/**
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
* @return deleteDaysAfterLastModification
Expand Down Expand Up @@ -805,6 +813,13 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod

public void setDiscountTypeCombination(final DiscountTypeCombination discountTypeCombination);

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @param lock value to be set
*/

public void setLock(final CartLock lock);

/**
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
* @param deleteDaysAfterLastModification value to be set
Expand Down Expand Up @@ -905,6 +920,7 @@ public static Cart of(final Cart template) {
instance.setOrigin(template.getOrigin());
instance.setCustom(template.getCustom());
instance.setDiscountTypeCombination(template.getDiscountTypeCombination());
instance.setLock(template.getLock());
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber());
instance.setLastModifiedBy(template.getLastModifiedBy());
Expand Down Expand Up @@ -1004,6 +1020,7 @@ public static Cart deepCopy(@Nullable final Cart template) {
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
instance.setDiscountTypeCombination(
com.commercetools.api.models.cart.DiscountTypeCombination.deepCopy(template.getDiscountTypeCombination()));
instance.setLock(com.commercetools.api.models.cart.CartLock.deepCopy(template.getLock()));
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber());
instance.setLastModifiedBy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public class CartBuilder implements Builder<Cart> {
@Nullable
private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination;

@Nullable
private com.commercetools.api.models.cart.CartLock lock;

@Nullable
private Integer deleteDaysAfterLastModification;

Expand Down Expand Up @@ -1549,6 +1552,41 @@ public CartBuilder discountTypeCombination(
return this;
}

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @param builder function to build the lock value
* @return Builder
*/

public CartBuilder lock(
Function<com.commercetools.api.models.cart.CartLockBuilder, com.commercetools.api.models.cart.CartLockBuilder> builder) {
this.lock = builder.apply(com.commercetools.api.models.cart.CartLockBuilder.of()).build();
return this;
}

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @param builder function to build the lock value
* @return Builder
*/

public CartBuilder withLock(
Function<com.commercetools.api.models.cart.CartLockBuilder, com.commercetools.api.models.cart.CartLock> builder) {
this.lock = builder.apply(com.commercetools.api.models.cart.CartLockBuilder.of());
return this;
}

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @param lock value to be set
* @return Builder
*/

public CartBuilder lock(@Nullable final com.commercetools.api.models.cart.CartLock lock) {
this.lock = lock;
return this;
}

/**
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
* @param deleteDaysAfterLastModification value to be set
Expand Down Expand Up @@ -2055,6 +2093,16 @@ public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountType
return this.discountTypeCombination;
}

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
* @return lock
*/

@Nullable
public com.commercetools.api.models.cart.CartLock getLock() {
return this.lock;
}

/**
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
* @return deleteDaysAfterLastModification
Expand Down Expand Up @@ -2126,7 +2174,7 @@ public Cart build() {
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination,
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
}

Expand All @@ -2140,7 +2188,7 @@ public Cart buildUnchecked() {
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination,
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
}

Expand Down Expand Up @@ -2201,6 +2249,7 @@ public static CartBuilder of(final Cart template) {
builder.origin = template.getOrigin();
builder.custom = template.getCustom();
builder.discountTypeCombination = template.getDiscountTypeCombination();
builder.lock = template.getLock();
builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification();
builder.purchaseOrderNumber = template.getPurchaseOrderNumber();
builder.lastModifiedBy = template.getLastModifiedBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public class CartImpl implements Cart, ModelBase {

private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination;

private com.commercetools.api.models.cart.CartLock lock;

private Integer deleteDaysAfterLastModification;

private String purchaseOrderNumber;
Expand Down Expand Up @@ -157,6 +159,7 @@ public class CartImpl implements Cart, ModelBase {
@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("lock") final com.commercetools.api.models.cart.CartLock lock,
@JsonProperty("deleteDaysAfterLastModification") final Integer deleteDaysAfterLastModification,
@JsonProperty("purchaseOrderNumber") final String purchaseOrderNumber,
@JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,
Expand Down Expand Up @@ -203,6 +206,7 @@ public class CartImpl implements Cart, ModelBase {
this.origin = origin;
this.custom = custom;
this.discountTypeCombination = discountTypeCombination;
this.lock = lock;
this.deleteDaysAfterLastModification = deleteDaysAfterLastModification;
this.purchaseOrderNumber = purchaseOrderNumber;
this.lastModifiedBy = lastModifiedBy;
Expand Down Expand Up @@ -563,6 +567,14 @@ public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountType
return this.discountTypeCombination;
}

/**
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
*/

public com.commercetools.api.models.cart.CartLock getLock() {
return this.lock;
}

/**
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
*/
Expand Down Expand Up @@ -802,6 +814,10 @@ public void setDiscountTypeCombination(
this.discountTypeCombination = discountTypeCombination;
}

public void setLock(final com.commercetools.api.models.cart.CartLock lock) {
this.lock = lock;
}

public void setDeleteDaysAfterLastModification(final Integer deleteDaysAfterLastModification) {
this.deleteDaysAfterLastModification = deleteDaysAfterLastModification;
}
Expand Down Expand Up @@ -870,6 +886,7 @@ public boolean equals(Object o) {
.append(origin, that.origin)
.append(custom, that.custom)
.append(discountTypeCombination, that.discountTypeCombination)
.append(lock, that.lock)
.append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification)
.append(purchaseOrderNumber, that.purchaseOrderNumber)
.append(lastModifiedBy, that.lastModifiedBy)
Expand Down Expand Up @@ -916,6 +933,7 @@ public boolean equals(Object o) {
.append(origin, that.origin)
.append(custom, that.custom)
.append(discountTypeCombination, that.discountTypeCombination)
.append(lock, that.lock)
.append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification)
.append(purchaseOrderNumber, that.purchaseOrderNumber)
.append(lastModifiedBy, that.lastModifiedBy)
Expand Down Expand Up @@ -967,6 +985,7 @@ public int hashCode() {
.append(origin)
.append(custom)
.append(discountTypeCombination)
.append(lock)
.append(deleteDaysAfterLastModification)
.append(purchaseOrderNumber)
.append(lastModifiedBy)
Expand Down Expand Up @@ -1018,6 +1037,7 @@ public String toString() {
.append("origin", origin)
.append("custom", custom)
.append("discountTypeCombination", discountTypeCombination)
.append("lock", lock)
.append("deleteDaysAfterLastModification", deleteDaysAfterLastModification)
.append("purchaseOrderNumber", purchaseOrderNumber)
.append("lastModifiedBy", lastModifiedBy)
Expand Down
Loading