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
27 changes: 27 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,30 @@
- added method `$apiRoot->withProjectKey()->channels()->withKey()->delete()`
</details>


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

- added type `CartDiscountPatternTarget`
- added type `CountOnCustomLineItemUnits`
- added type `CountOnLineItemUnits`
- added type `PatternComponent`
</details>


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

- added property `applicationMode` to type `CartDiscountValueFixed`
- added property `applicationMode` to type `CartDiscountValueFixedDraft`
</details>

**History changes**

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

- added type `ChangeTargetPatternChangeValue`
- added type `PatternComponent`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ public function getCustom();

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ public function getCustom()

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ public function getCustom()

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
2 changes: 1 addition & 1 deletion lib/commercetools-api/src/Models/Cart/CustomLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function getCustom();
public function getShippingDetails();

/**
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a> are applied to the Custom Line Item.</p>
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function getShippingDetails()
}

/**
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a> are applied to the Custom Line Item.</p>
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ public function getShippingDetails();

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ public function getShippingDetails()

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ public function getShippingDetails()

/**
* <ul>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>
* are applied to the Custom Line Item.</li>
* <li>If <code>Standard</code>, Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</li>
* <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ public function getShippingDetails()
}

/**
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a> are applied to the Custom Line Item.</p>
* <p>Indicates whether Cart Discounts with a matching <a href="ctp:api:type:CartDiscountCustomLineItemsTarget">CartDiscountCustomLineItemsTarget</a>, <a href="ctp:api:type:MultiBuyCustomLineItemsTarget">MultiBuyCustomLineItemsTarget</a>, or <a href="ctp:api:type:CartDiscountPatternTarget">CartDiscountPatternTarget</a> are applied to the Custom Line Item.</p>
*
*
* @return null|string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\CartDiscount;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;

interface CartDiscountPatternTarget extends CartDiscountTarget
{
public const FIELD_TRIGGER_PATTERN = 'triggerPattern';
public const FIELD_TARGET_PATTERN = 'targetPattern';
public const FIELD_MAX_OCCURRENCE = 'maxOccurrence';
public const FIELD_SELECTION_MODE = 'selectionMode';

/**
* <p>Units of a (Custom) Line Item that trigger a discount application.</p>
* <p>Based on the availability of matching units, the <code>triggerPattern</code> can match multiple times, effecting the number of times the discount will be applied.
* To further limit the discount application, set the <code>maxOccurrence</code>.</p>
* <p>If empty or not set, the Discount will apply indefinitely.</p>
*

* @return null|PatternComponentCollection
*/
public function getTriggerPattern();

/**
* <p>Units of (Custom) Line Items on which the Discount is applied.</p>
* <p>Based on the availability of matching units and the limits from the <code>triggerPattern</code> or <code>maxOccurence</code>, the <code>targetPattern</code> can match multiple times.</p>
*

* @return null|PatternComponentCollection
*/
public function getTargetPattern();

/**
* <p>Maximum number of times the Discount can apply on a Cart.</p>
* <p>If empty or not set, the Discount will apply indefinitely.</p>
*

* @return null|int
*/
public function getMaxOccurrence();

/**
* <p>Determines which of the matching units of (Custom) Line Items are discounted.</p>
*

* @return null|string
*/
public function getSelectionMode();

/**
* @param ?PatternComponentCollection $triggerPattern
*/
public function setTriggerPattern(?PatternComponentCollection $triggerPattern): void;

/**
* @param ?PatternComponentCollection $targetPattern
*/
public function setTargetPattern(?PatternComponentCollection $targetPattern): void;

/**
* @param ?int $maxOccurrence
*/
public function setMaxOccurrence(?int $maxOccurrence): void;

/**
* @param ?string $selectionMode
*/
public function setSelectionMode(?string $selectionMode): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\CartDiscount;

use Commercetools\Base\Builder;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @implements Builder<CartDiscountPatternTarget>
*/
final class CartDiscountPatternTargetBuilder implements Builder
{
/**

* @var ?PatternComponentCollection
*/
private $triggerPattern;

/**

* @var ?PatternComponentCollection
*/
private $targetPattern;

/**

* @var ?int
*/
private $maxOccurrence;

/**

* @var ?string
*/
private $selectionMode;

/**
* <p>Units of a (Custom) Line Item that trigger a discount application.</p>
* <p>Based on the availability of matching units, the <code>triggerPattern</code> can match multiple times, effecting the number of times the discount will be applied.
* To further limit the discount application, set the <code>maxOccurrence</code>.</p>
* <p>If empty or not set, the Discount will apply indefinitely.</p>
*

* @return null|PatternComponentCollection
*/
public function getTriggerPattern()
{
return $this->triggerPattern;
}

/**
* <p>Units of (Custom) Line Items on which the Discount is applied.</p>
* <p>Based on the availability of matching units and the limits from the <code>triggerPattern</code> or <code>maxOccurence</code>, the <code>targetPattern</code> can match multiple times.</p>
*

* @return null|PatternComponentCollection
*/
public function getTargetPattern()
{
return $this->targetPattern;
}

/**
* <p>Maximum number of times the Discount can apply on a Cart.</p>
* <p>If empty or not set, the Discount will apply indefinitely.</p>
*

* @return null|int
*/
public function getMaxOccurrence()
{
return $this->maxOccurrence;
}

/**
* <p>Determines which of the matching units of (Custom) Line Items are discounted.</p>
*

* @return null|string
*/
public function getSelectionMode()
{
return $this->selectionMode;
}

/**
* @param ?PatternComponentCollection $triggerPattern
* @return $this
*/
public function withTriggerPattern(?PatternComponentCollection $triggerPattern)
{
$this->triggerPattern = $triggerPattern;

return $this;
}

/**
* @param ?PatternComponentCollection $targetPattern
* @return $this
*/
public function withTargetPattern(?PatternComponentCollection $targetPattern)
{
$this->targetPattern = $targetPattern;

return $this;
}

/**
* @param ?int $maxOccurrence
* @return $this
*/
public function withMaxOccurrence(?int $maxOccurrence)
{
$this->maxOccurrence = $maxOccurrence;

return $this;
}

/**
* @param ?string $selectionMode
* @return $this
*/
public function withSelectionMode(?string $selectionMode)
{
$this->selectionMode = $selectionMode;

return $this;
}


public function build(): CartDiscountPatternTarget
{
return new CartDiscountPatternTargetModel(
$this->triggerPattern,
$this->targetPattern,
$this->maxOccurrence,
$this->selectionMode
);
}

public static function of(): CartDiscountPatternTargetBuilder
{
return new self();
}
}
Loading
Loading