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
13 changes: 13 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
<details>
<summary>Added Type(s)</summary>

- added type `CartDiscountSetRecurringOrderScopeAction`
- added type `CartLock`
- added type `FreezeStrategy`
- added type `CartLockCartAction`
- added type `CartSetPurchaseOrderNumberAction`
- added type `CartUnlockCartAction`
- added type `CartPurchaseOrderNumberSetMessage`
- added type `CartPurchaseOrderNumberSetMessagePayload`
- added type `AnyOrder`
- added type `AnyOrderDraft`
- added type `ApplicableRecurrencePolicies`
- added type `ApplicableRecurrencePoliciesDraft`
- added type `NonRecurringOrdersOnly`
- added type `NonRecurringOrdersOnlyDraft`
- added type `RecurringOrderScope`
- added type `RecurringOrderScopeDraft`
- added type `RecurringOrdersOnly`
- added type `RecurringOrdersOnlyDraft`
</details>


<details>
<summary>Added Property(s)</summary>

- added property `recurringOrderScope` to type `CartDiscount`
- added property `recurringOrderScope` to type `CartDiscountDraft`
- added property `freezeStrategy` to type `Cart`
- added property `lock` to type `Cart`
- added property `purchaseOrderNumber` to type `Cart`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,26 @@ enum AnonymousCartSignInMode {
UseAsNewActiveCustomerCart
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type AnyOrder implements RecurringOrderScope {
type: RecurringOrderScopeType!
}

input AnyOrderInput {
dummy: String
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ApplicableRecurrencePolicies implements RecurringOrderScope {
recurrencePolicies: [RecurrencePolicy!]!
type: RecurringOrderScopeType!
recurrencePoliciesRef: [Reference!]!
}

input ApplicableRecurrencePoliciesInput {
recurrencePolicies: [ResourceIdentifierInput!]!
}

type Applied implements OrderEditResult {
excerptBeforeEdit: OrderExcerpt!
excerptAfterEdit: OrderExcerpt!
Expand Down Expand Up @@ -1904,6 +1924,7 @@ type CartDiscount implements Versioned & ReferenceExpandable {
lastModifiedAt: DateTime!
createdBy: Initiator
lastModifiedBy: Initiator
recurringOrderScope: RecurringOrderScope!
}

type CartDiscountCreated implements MessagePayload {
Expand Down Expand Up @@ -1931,6 +1952,7 @@ input CartDiscountDraft {
key: String
stores: [ResourceIdentifierInput!]
discountGroup: ResourceIdentifierInput
recurringOrderScope: RecurringOrderScopeInput
}

type CartDiscountLimitWithCurrent implements LimitWithCurrent {
Expand Down Expand Up @@ -2036,6 +2058,7 @@ input CartDiscountUpdateAction {
setValidFromAndUntil: SetCartDiscountValidFromAndUntil
setValidUntil: SetCartDiscountValidUntil
setDiscountGroup: SetCartDiscountDiscountGroup
setRecurringOrderScope: SetCartDiscountRecurringOrderScope
}

interface CartDiscountValue {
Expand Down Expand Up @@ -7377,6 +7400,15 @@ type NestedAttributeDefinitionType implements AttributeDefinitionType {
name: String!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type NonRecurringOrdersOnly implements RecurringOrderScope {
type: RecurringOrderScopeType!
}

input NonRecurringOrdersOnlyInput {
dummy: String
}

type NotProcessed implements OrderEditResult {
type: String!
}
Expand Down Expand Up @@ -11237,6 +11269,25 @@ type RecurringOrderScheduleSet implements MessagePayload {
type: String!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
interface RecurringOrderScope {
type: RecurringOrderScopeType!
}

input RecurringOrderScopeInput {
AnyOrder: AnyOrderInput
RecurringOrdersOnly: RecurringOrdersOnlyInput
NonRecurringOrdersOnly: NonRecurringOrdersOnlyInput
ApplicableRecurrencePolicies: ApplicableRecurrencePoliciesInput
}

enum RecurringOrderScopeType {
AnyOrder
NonRecurringOrdersOnly
RecurringOrdersOnly
ApplicableRecurrencePolicies
}

type RecurringOrderStartsAtSet implements MessagePayload {
startsAt: DateTime!
oldStartsAt: DateTime!
Expand Down Expand Up @@ -11285,6 +11336,15 @@ input RecurringOrderUpdateAction {
transitionState: TransitionRecurringOrderState
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type RecurringOrdersOnly implements RecurringOrderScope {
type: RecurringOrderScopeType!
}

input RecurringOrdersOnlyInput {
dummy: String
}

type Reference {
typeId: String!
id: String!
Expand Down Expand Up @@ -12629,6 +12689,10 @@ input SetCartDiscountKey {
key: String
}

input SetCartDiscountRecurringOrderScope {
recurringOrderScope: RecurringOrderScopeInput!
}

input SetCartDiscountStores {
stores: [ResourceIdentifierInput!]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.common.Reference;
import com.commercetools.api.models.discount_group.DiscountGroupReference;
import com.commercetools.api.models.recurring_order.RecurringOrderScope;
import com.commercetools.api.models.store.StoreKeyReference;
import com.commercetools.api.models.type.CustomFields;
import com.fasterxml.jackson.annotation.*;
Expand Down Expand Up @@ -46,6 +47,7 @@
* .requiresDiscountCode(true)
* .plusReferences(referencesBuilder -> referencesBuilder)
* .stackingMode(StackingMode.STACKING)
* .recurringOrderScope(recurringOrderScopeBuilder -> recurringOrderScopeBuilder)
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -244,6 +246,16 @@ public interface CartDiscount
@JsonProperty("discountGroup")
public DiscountGroupReference getDiscountGroup();

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>The default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnly" rel="nofollow">NonRecurringOrdersOnly</a>.</p>
* @return recurringOrderScope
*/
@NotNull
@Valid
@JsonProperty("recurringOrderScope")
public RecurringOrderScope getRecurringOrderScope();

/**
* <p>Unique identifier of the CartDiscount.</p>
* @param id value to be set
Expand Down Expand Up @@ -423,6 +435,14 @@ public interface CartDiscount

public void setDiscountGroup(final DiscountGroupReference discountGroup);

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>The default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnly" rel="nofollow">NonRecurringOrdersOnly</a>.</p>
* @param recurringOrderScope value to be set
*/

public void setRecurringOrderScope(final RecurringOrderScope recurringOrderScope);

/**
* factory method
* @return instance of CartDiscount
Expand Down Expand Up @@ -460,6 +480,7 @@ public static CartDiscount of(final CartDiscount template) {
instance.setStackingMode(template.getStackingMode());
instance.setCustom(template.getCustom());
instance.setDiscountGroup(template.getDiscountGroup());
instance.setRecurringOrderScope(template.getRecurringOrderScope());
return instance;
}

Expand Down Expand Up @@ -510,6 +531,8 @@ public static CartDiscount deepCopy(@Nullable final CartDiscount template) {
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
instance.setDiscountGroup(
com.commercetools.api.models.discount_group.DiscountGroupReference.deepCopy(template.getDiscountGroup()));
instance.setRecurringOrderScope(com.commercetools.api.models.recurring_order.RecurringOrderScope
.deepCopy(template.getRecurringOrderScope()));
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* .requiresDiscountCode(true)
* .plusReferences(referencesBuilder -> referencesBuilder)
* .stackingMode(StackingMode.STACKING)
* .recurringOrderScope(recurringOrderScopeBuilder -> recurringOrderScopeBuilder)
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -89,6 +90,8 @@ public class CartDiscountBuilder implements Builder<CartDiscount> {
@Nullable
private com.commercetools.api.models.discount_group.DiscountGroupReference discountGroup;

private com.commercetools.api.models.recurring_order.RecurringOrderScope recurringOrderScope;

/**
* <p>Unique identifier of the CartDiscount.</p>
* @param id value to be set
Expand Down Expand Up @@ -662,6 +665,34 @@ public CartDiscountBuilder discountGroup(
return this;
}

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>The default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnly" rel="nofollow">NonRecurringOrdersOnly</a>.</p>
* @param recurringOrderScope value to be set
* @return Builder
*/

public CartDiscountBuilder recurringOrderScope(
final com.commercetools.api.models.recurring_order.RecurringOrderScope recurringOrderScope) {
this.recurringOrderScope = recurringOrderScope;
return this;
}

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>The default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnly" rel="nofollow">NonRecurringOrdersOnly</a>.</p>
* @param builder function to build the recurringOrderScope value
* @return Builder
*/

public CartDiscountBuilder recurringOrderScope(
Function<com.commercetools.api.models.recurring_order.RecurringOrderScopeBuilder, Builder<? extends com.commercetools.api.models.recurring_order.RecurringOrderScope>> builder) {
this.recurringOrderScope = builder
.apply(com.commercetools.api.models.recurring_order.RecurringOrderScopeBuilder.of())
.build();
return this;
}

/**
* <p>Unique identifier of the CartDiscount.</p>
* @return id
Expand Down Expand Up @@ -875,6 +906,16 @@ public com.commercetools.api.models.discount_group.DiscountGroupReference getDis
return this.discountGroup;
}

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>The default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnly" rel="nofollow">NonRecurringOrdersOnly</a>.</p>
* @return recurringOrderScope
*/

public com.commercetools.api.models.recurring_order.RecurringOrderScope getRecurringOrderScope() {
return this.recurringOrderScope;
}

/**
* builds CartDiscount with checking for non-null required values
* @return CartDiscount
Expand All @@ -893,9 +934,10 @@ public CartDiscount build() {
Objects.requireNonNull(requiresDiscountCode, CartDiscount.class + ": requiresDiscountCode is missing");
Objects.requireNonNull(references, CartDiscount.class + ": references is missing");
Objects.requireNonNull(stackingMode, CartDiscount.class + ": stackingMode is missing");
Objects.requireNonNull(recurringOrderScope, CartDiscount.class + ": recurringOrderScope is missing");
return new CartDiscountImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, key,
description, value, cartPredicate, target, sortOrder, stores, isActive, validFrom, validUntil,
requiresDiscountCode, references, stackingMode, custom, discountGroup);
requiresDiscountCode, references, stackingMode, custom, discountGroup, recurringOrderScope);
}

/**
Expand All @@ -905,7 +947,7 @@ public CartDiscount build() {
public CartDiscount buildUnchecked() {
return new CartDiscountImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, key,
description, value, cartPredicate, target, sortOrder, stores, isActive, validFrom, validUntil,
requiresDiscountCode, references, stackingMode, custom, discountGroup);
requiresDiscountCode, references, stackingMode, custom, discountGroup, recurringOrderScope);
}

/**
Expand Down Expand Up @@ -945,6 +987,7 @@ public static CartDiscountBuilder of(final CartDiscount template) {
builder.stackingMode = template.getStackingMode();
builder.custom = template.getCustom();
builder.discountGroup = template.getDiscountGroup();
builder.recurringOrderScope = template.getRecurringOrderScope();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.discount_group.DiscountGroupResourceIdentifier;
import com.commercetools.api.models.recurring_order.RecurringOrderScopeDraft;
import com.commercetools.api.models.store.StoreResourceIdentifier;
import com.commercetools.api.models.type.CustomFieldsDraft;
import com.fasterxml.jackson.annotation.*;
Expand Down Expand Up @@ -171,6 +172,15 @@ public interface CartDiscountDraft extends com.commercetools.api.models.Customiz
@JsonProperty("discountGroup")
public DiscountGroupResourceIdentifier getDiscountGroup();

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>If not set, the default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnlyDraft" rel="nofollow">NonRecurringOrdersOnlyDraft</a>.</p>
* @return recurringOrderScope
*/
@Valid
@JsonProperty("recurringOrderScope")
public RecurringOrderScopeDraft getRecurringOrderScope();

/**
* <p>Name of the CartDiscount.</p>
* @param name value to be set
Expand Down Expand Up @@ -297,6 +307,14 @@ public interface CartDiscountDraft extends com.commercetools.api.models.Customiz

public void setDiscountGroup(final DiscountGroupResourceIdentifier discountGroup);

/**
* <p>Scope of the Cart Discount for Recurring Orders.</p>
* <p>If not set, the default is <a href="https://docs.commercetools.com/apis/ctp:api:type:NonRecurringOrdersOnlyDraft" rel="nofollow">NonRecurringOrdersOnlyDraft</a>.</p>
* @param recurringOrderScope value to be set
*/

public void setRecurringOrderScope(final RecurringOrderScopeDraft recurringOrderScope);

/**
* factory method
* @return instance of CartDiscountDraft
Expand Down Expand Up @@ -327,6 +345,7 @@ public static CartDiscountDraft of(final CartDiscountDraft template) {
instance.setStackingMode(template.getStackingMode());
instance.setCustom(template.getCustom());
instance.setDiscountGroup(template.getDiscountGroup());
instance.setRecurringOrderScope(template.getRecurringOrderScope());
return instance;
}

Expand Down Expand Up @@ -366,6 +385,8 @@ public static CartDiscountDraft deepCopy(@Nullable final CartDiscountDraft templ
instance.setCustom(com.commercetools.api.models.type.CustomFieldsDraft.deepCopy(template.getCustom()));
instance.setDiscountGroup(com.commercetools.api.models.discount_group.DiscountGroupResourceIdentifier
.deepCopy(template.getDiscountGroup()));
instance.setRecurringOrderScope(com.commercetools.api.models.recurring_order.RecurringOrderScopeDraft
.deepCopy(template.getRecurringOrderScope()));
return instance;
}

Expand Down
Loading