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
63 changes: 8 additions & 55 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,20 @@
**Api changes**

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

- added type `CustomerDefaultBillingAddressSetMessage`
- added type `CustomerDefaultShippingAddressSetMessage`
- added type `CustomerStoresSetMessage`
- added type `CustomerDefaultBillingAddressSetMessagePayload`
- added type `CustomerDefaultShippingAddressSetMessagePayload`
- added type `CustomerStoresSetMessagePayload`
</details>


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

- added method `apiRoot.withProjectKey().recurrencePolicies().withKey().delete()`
- added method `apiRoot.withProjectKey().recurrencePolicies().withId().delete()`
- added property `isActive` to type `DiscountGroup`
- added property `isActive` to type `DiscountGroupDraft`
</details>

**Import changes**

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

- added type `AssociateRoleKeyReference`
- added type `BusinessUnitKeyReference`
- added type `BusinessUnitImportRequest`
- added type `AssociateRoleInheritanceMode`
- added type `BusinessUnitStatus`
- added type `BusinessUnitAssociateMode`
- added type `BusinessUnitApprovalRuleMode`
- added type `BusinessUnitStoreMode`
- added type `BusinessUnitType`
- added type `AssociateRoleAssignmentDraft`
- added type `AssociateDraft`
- added type `BusinessUnitImport`
- added type `CompanyBusinessUnitImport`
- added type `DivisionBusinessUnitImport`
</details>


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

- added method `apiRoot.withProjectKeyValue().businessUnits().importContainers().withImportContainerKeyValue().post()`
</details>


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

- added resource `/{projectKey}/business-units`
- added resource `/{projectKey}/business-units/import-containers`
- added resource `/{projectKey}/business-units/import-containers/{importContainerKey}`
</details>


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

- added enum `business-unit` to type `ImportResourceType`
- added enum `associate-role` to type `ReferenceType`
- added enum `business-unit` to type `ReferenceType`
- added type `DiscountGroupSetIsActiveAction`
- added type `MaxDiscountGroupsReachedError`
- added type `GraphQLMaxDiscountGroupsReachedError`
- added type `DiscountGroupIsActiveSetMessage`
- added type `DiscountGroupIsActiveSetMessagePayload`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -4336,18 +4336,46 @@ type DiscountCodeDeleted implements MessagePayload {
}

input DiscountCodeDraft {
"""
User-defined unique identifier for the DiscountCode that can be added to the Cart to apply the related CartDiscounts.
It cannot be modified after the DiscountCode is created.
"""
code: String!

"Name of the DiscountCode."
name: [LocalizedStringItemInputType!]

"User-defined unique identifier for the DiscountCode."
key: String

"The description of the DiscountCode."
description: [LocalizedStringItemInputType!]

"Specify what CartDiscounts the API applies when you add the DiscountCode to the Cart."
cartDiscounts: [ResourceIdentifierInput!]!

"Only active DiscountCodes can be applied to the Cart."
isActive: Boolean = true

"Number of times the DiscountCode can be applied. If not set, the DiscountCode can be applied any number of times."
maxApplications: Long

"Number of times the DiscountCode can be applied per Customer. If not set, the DiscountCode can be applied any number of times."
maxApplicationsPerCustomer: Long

"DiscountCode can only be applied to Carts that match this predicate."
cartPredicate: String

"Custom Fields for the DiscountCode."
custom: CustomFieldsDraft

"Date and time (UTC) from which the DiscountCode is effective. Must be earlier than `validUntil`."
validFrom: DateTime

"Date and time (UTC) until which the DiscountCode is effective. Must be later than `validFrom`."
validUntil: DateTime

"Groups to which the DiscountCode will belong to."
groups: [String!] = []
}

Expand Down Expand Up @@ -4416,6 +4444,7 @@ type DiscountGroup implements Versioned {
version: Long!
key: String!
sortOrder: String!
isActive: Boolean!
name(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
Expand Down Expand Up @@ -4451,9 +4480,16 @@ input DiscountGroupDraft {
key: String!
sortOrder: String!
name: [LocalizedStringItemInputType!]
isActive: Boolean = true
description: [LocalizedStringItemInputType!]
}

type DiscountGroupIsActiveSet implements MessagePayload {
isActive: Boolean!
discountGroupId: String!
type: String!
}

type DiscountGroupKeySet implements MessagePayload {
key: String!
discountGroupId: String!
Expand Down Expand Up @@ -4490,6 +4526,7 @@ input DiscountGroupUpdateAction {
setKey: SetDiscountGroupKey
setSortOrder: SetDiscountGroupSortOrder
setName: SetDiscountGroupName
setIsActive: SetDiscountGroupIsActive
setDescription: SetDiscountGroupDescription
}

Expand Down Expand Up @@ -8677,14 +8714,34 @@ type ProductDiscount implements Versioned & ReferenceExpandable {
}

input ProductDiscountDraft {
"Type of Discount and its corresponding value."
value: ProductDiscountValueInput!

"A valid ProductDiscount Predicate."
predicate: String!

"""
Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher `sortOrder` is prioritized.
The value must be **unique** among all ProductDiscounts in the Project.
"""
sortOrder: String!

"Name of the ProductDiscount."
name: [LocalizedStringItemInputType!]!

"Description of the ProductDiscount."
description: [LocalizedStringItemInputType!]

"Date and time (UTC) from which the Discount is effective."
validFrom: DateTime

"Date and time (UTC) until which the Discount is effective."
validUntil: DateTime

"Set to `true` to activate the ProductDiscount, set to `false` to deactivate it (even though the `predicate` matches)."
isActive: Boolean = true

"User-defined unique identifier for the ProductDiscount."
key: String
}

Expand Down Expand Up @@ -12513,6 +12570,11 @@ input SetDiscountGroupDescription {
description: [LocalizedStringItemInputType!]
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input SetDiscountGroupIsActive {
isActive: Boolean!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input SetDiscountGroupKey {
key: String!
Expand Down Expand Up @@ -14821,8 +14883,8 @@ input ShippingTargetDraft {
}

input ShippingTargetDraftType {
addressKey: String!
quantity: Long!
addressKey: String!
shippingMethodKey: String
}

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

/**
* <p>Creates a DiscountGroup in the Project. This request generates the <a href="https://docs.commercetools.com/apis/ctp:api:type:DiscountGroupCreatedMessage" rel="nofollow">DiscountGroupCreated</a> Message.</p>
* <p>If the <span>limit</span> for active Discount Groups has been reached, a <a href="https://docs.commercetools.com/apis/ctp:api:type:MaxDiscountGroupsReachedError" rel="nofollow">MaxDiscountGroupsReached</a> error is returned.</p>
*
* <hr>
* <div class=code-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

/**
* <p>Creates a DiscountGroup in the Project. This request generates the <a href="https://docs.commercetools.com/apis/ctp:api:type:DiscountGroupCreatedMessage" rel="nofollow">DiscountGroupCreated</a> Message.</p>
* <p>If the <span>limit</span> for active Discount Groups has been reached, a <a href="https://docs.commercetools.com/apis/ctp:api:type:MaxDiscountGroupsReachedError" rel="nofollow">MaxDiscountGroupsReached</a> error is returned.</p>
*
* <hr>
* <div class=code-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
* .key("{key}")
* .sortOrder("{sortOrder}")
* .isActive(true)
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -91,6 +92,14 @@ public interface DiscountGroup extends BaseResource {
@JsonProperty("sortOrder")
public String getSortOrder();

/**
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
* @return isActive
*/
@NotNull
@JsonProperty("isActive")
public Boolean getIsActive();

/**
* <p>Date and time (UTC) the DiscountGroup was initially created.</p>
* @return createdAt
Expand Down Expand Up @@ -166,6 +175,13 @@ public interface DiscountGroup extends BaseResource {

public void setSortOrder(final String sortOrder);

/**
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
* @param isActive value to be set
*/

public void setIsActive(final Boolean isActive);

/**
* <p>Date and time (UTC) the DiscountGroup was initially created.</p>
* @param createdAt value to be set
Expand Down Expand Up @@ -217,6 +233,7 @@ public static DiscountGroup of(final DiscountGroup template) {
instance.setKey(template.getKey());
instance.setDescription(template.getDescription());
instance.setSortOrder(template.getSortOrder());
instance.setIsActive(template.getIsActive());
instance.setLastModifiedBy(template.getLastModifiedBy());
instance.setCreatedBy(template.getCreatedBy());
return instance;
Expand Down Expand Up @@ -244,6 +261,7 @@ public static DiscountGroup deepCopy(@Nullable final DiscountGroup template) {
instance.setDescription(
com.commercetools.api.models.common.LocalizedString.deepCopy(template.getDescription()));
instance.setSortOrder(template.getSortOrder());
instance.setIsActive(template.getIsActive());
instance.setLastModifiedBy(
com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
* .key("{key}")
* .sortOrder("{sortOrder}")
* .isActive(true)
* .build()
* </code></pre>
* </div>
Expand All @@ -47,6 +48,8 @@ public class DiscountGroupBuilder implements Builder<DiscountGroup> {

private String sortOrder;

private Boolean isActive;

@Nullable
private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy;

Expand Down Expand Up @@ -191,6 +194,17 @@ public DiscountGroupBuilder sortOrder(final String sortOrder) {
return this;
}

/**
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
* @param isActive value to be set
* @return Builder
*/

public DiscountGroupBuilder isActive(final Boolean isActive) {
this.isActive = isActive;
return this;
}

/**
* <p>IDs and references that last modified the DiscountGroup.</p>
* @param builder function to build the lastModifiedBy value
Expand Down Expand Up @@ -337,6 +351,15 @@ public String getSortOrder() {
return this.sortOrder;
}

/**
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
* @return isActive
*/

public Boolean getIsActive() {
return this.isActive;
}

/**
* <p>IDs and references that last modified the DiscountGroup.</p>
* @return lastModifiedBy
Expand Down Expand Up @@ -368,8 +391,9 @@ public DiscountGroup build() {
Objects.requireNonNull(lastModifiedAt, DiscountGroup.class + ": lastModifiedAt is missing");
Objects.requireNonNull(key, DiscountGroup.class + ": key is missing");
Objects.requireNonNull(sortOrder, DiscountGroup.class + ": sortOrder is missing");
Objects.requireNonNull(isActive, DiscountGroup.class + ": isActive is missing");
return new DiscountGroupImpl(id, version, createdAt, lastModifiedAt, name, key, description, sortOrder,
lastModifiedBy, createdBy);
isActive, lastModifiedBy, createdBy);
}

/**
Expand All @@ -378,7 +402,7 @@ public DiscountGroup build() {
*/
public DiscountGroup buildUnchecked() {
return new DiscountGroupImpl(id, version, createdAt, lastModifiedAt, name, key, description, sortOrder,
lastModifiedBy, createdBy);
isActive, lastModifiedBy, createdBy);
}

/**
Expand All @@ -404,6 +428,7 @@ public static DiscountGroupBuilder of(final DiscountGroup template) {
builder.key = template.getKey();
builder.description = template.getDescription();
builder.sortOrder = template.getSortOrder();
builder.isActive = template.getIsActive();
builder.lastModifiedBy = template.getLastModifiedBy();
builder.createdBy = template.getCreatedBy();
return builder;
Expand Down
Loading