Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from voucherifyio/pz/stackable-validation
Browse files Browse the repository at this point in the history
pz/stackable-validation
  • Loading branch information
p-zielinski authored Jan 18, 2024
2 parents 1fdd39a + 6a422b6 commit 2b65ac8
Show file tree
Hide file tree
Showing 27 changed files with 424 additions and 4,250 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ Class | Method | HTTP request | Description
- [ClientValidationsValidateRequestBody](docs/Model/ClientValidationsValidateRequestBody.md)
- [ClientValidationsValidateRequestBodyAllOfOptions](docs/Model/ClientValidationsValidateRequestBodyAllOfOptions.md)
- [ClientValidationsValidateResponseBody](docs/Model/ClientValidationsValidateResponseBody.md)
- [ClientValidationsValidateResponseBodyRedeemablesItem](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItem.md)
- [ClientValidationsValidateResponseBodyRedeemablesItemResult](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItemResult.md)
- [ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md)
- [ClientValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscountProduct.md)
- [ClientValidationsValidateResponseBodyRedeemablesItemResultGift](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItemResultGift.md)
- [ClientValidationsValidateResponseBodyRedeemablesItemResultLoyaltyCard](docs/Model/ClientValidationsValidateResponseBodyRedeemablesItemResultLoyaltyCard.md)
- [CodeConfig](docs/Model/CodeConfig.md)
- [CodeConfigRequiredLengthCharsetPattern](docs/Model/CodeConfigRequiredLengthCharsetPattern.md)
- [CreatePublicationCampaign](docs/Model/CreatePublicationCampaign.md)
Expand Down Expand Up @@ -610,7 +604,6 @@ Class | Method | HTTP request | Description
- [QualificationsRedeemable](docs/Model/QualificationsRedeemable.md)
- [QualificationsRedeemableBase](docs/Model/QualificationsRedeemableBase.md)
- [QualificationsRedeemables](docs/Model/QualificationsRedeemables.md)
- [QualificationsStackingRules](docs/Model/QualificationsStackingRules.md)
- [RedeemableGift](docs/Model/RedeemableGift.md)
- [RedeemableLoyaltyCard](docs/Model/RedeemableLoyaltyCard.md)
- [RedeemableResult](docs/Model/RedeemableResult.md)
Expand Down Expand Up @@ -746,6 +739,7 @@ Class | Method | HTTP request | Description
- [StackableValidateRedeemBaseRedeemablesItem](docs/Model/StackableValidateRedeemBaseRedeemablesItem.md)
- [StackableValidateRedeemBaseRedeemablesItemGift](docs/Model/StackableValidateRedeemBaseRedeemablesItemGift.md)
- [StackableValidateRedeemBaseRedeemablesItemReward](docs/Model/StackableValidateRedeemBaseRedeemablesItemReward.md)
- [StackingRules](docs/Model/StackingRules.md)
- [ValidationEntity](docs/Model/ValidationEntity.md)
- [ValidationRule](docs/Model/ValidationRule.md)
- [ValidationRuleAssignment](docs/Model/ValidationRuleAssignment.md)
Expand All @@ -765,7 +759,6 @@ Class | Method | HTTP request | Description
- [ValidationsRedeemableApplicableResult](docs/Model/ValidationsRedeemableApplicableResult.md)
- [ValidationsRedeemableApplicableResultDiscount](docs/Model/ValidationsRedeemableApplicableResultDiscount.md)
- [ValidationsRedeemableApplicableResultDiscountProduct](docs/Model/ValidationsRedeemableApplicableResultDiscountProduct.md)
- [ValidationsRedeemableApplicableResultGift](docs/Model/ValidationsRedeemableApplicableResultGift.md)
- [ValidationsRedeemableApplicableResultLoyaltyCard](docs/Model/ValidationsRedeemableApplicableResultLoyaltyCard.md)
- [ValidationsRedeemableInapplicable](docs/Model/ValidationsRedeemableInapplicable.md)
- [ValidationsRedeemableInapplicableResult](docs/Model/ValidationsRedeemableInapplicableResult.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Name | Type | Description | Notes
**redeemables** | [**\OpenAPI\Client\Model\QualificationsRedeemables**](QualificationsRedeemables.md) | | [optional]
**tracking_id** | **string** | This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID. | [optional]
**order** | [**\OpenAPI\Client\Model\OrderCalculated**](OrderCalculated.md) | | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\QualificationsStackingRules**](QualificationsStackingRules.md) | | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\StackingRules**](StackingRules.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
7 changes: 4 additions & 3 deletions docs/Model/ClientValidationsValidateResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**valid** | **bool** | The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable. |
**redeemables** | [**\OpenAPI\Client\Model\ClientValidationsValidateResponseBodyRedeemablesItem[]**](ClientValidationsValidateResponseBodyRedeemablesItem.md) | Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`. |
**redeemables** | [**\OpenAPI\Client\Model\ValidationsValidateResponseBodyRedeemablesItem[]**](ValidationsValidateResponseBodyRedeemablesItem.md) | |
**skipped_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each skipped redeemable. | [optional]
**inapplicable_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each inapplicable redeemable. | [optional]
**order** | [**\OpenAPI\Client\Model\OrderCalculated**](OrderCalculated.md) | | [optional]
**tracking_id** | **string** | Hashed customer source ID. | [optional]
**session** | [**\OpenAPI\Client\Model\Session**](Session.md) | | [optional]
**application_mode** | **string** | |
**inapplicable_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each inapplicable redeemable. | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\StackingRules**](StackingRules.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/QualificationsCheckEligibilityResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Name | Type | Description | Notes
**redeemables** | [**\OpenAPI\Client\Model\QualificationsRedeemables**](QualificationsRedeemables.md) | | [optional]
**tracking_id** | **string** | This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID. | [optional]
**order** | [**\OpenAPI\Client\Model\OrderCalculated**](OrderCalculated.md) | | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\QualificationsStackingRules**](QualificationsStackingRules.md) | | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\StackingRules**](StackingRules.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
16 changes: 16 additions & 0 deletions docs/Model/StackingRules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# # StackingRules

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**redeemables_limit** | **int** | Defines how many redeemables can be sent in one stacking request (note: more redeemables means more processing time!). | [default to 30]
**applicable_redeemables_limit** | **int** | Defines how many of the sent redeemables will be applied to the order. For example, a user can select 30 discounts but only 5 will be applied to the order and the remaining will be labelled as SKIPPED. | [default to 5]
**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an exclusive category can be applied in one request. | [default to 1]
**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables per category can be applied in one request. | [optional] [default to 1]
**exclusive_categories** | **string[]** | Lists all exclusive categories. A redeemable from a campaign with an exclusive category is the only redeemable to be redeemed when applied with redeemables from other campaigns unless these campaigns are exclusive or joint. |
**joint_categories** | **string[]** | Lists all joint categories. A campaign with a joint category is always applied regardless of the exclusivity of other campaigns. |
**redeemables_application_mode** | **string** | Defines redeemables application mode. | [optional]
**redeemables_sorting_rule** | **string** | Defines redeemables sorting rule. | [optional] [default to 'REQUESTED_ORDER']

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/ValidationsRedeemableApplicableResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**discount** | [**\OpenAPI\Client\Model\ValidationsRedeemableApplicableResultDiscount**](ValidationsRedeemableApplicableResultDiscount.md) | | [optional]
**gift** | [**\OpenAPI\Client\Model\ValidationsRedeemableApplicableResultGift**](ValidationsRedeemableApplicableResultGift.md) | | [optional]
**gift** | [**\OpenAPI\Client\Model\ValidationsValidateResponseBodyRedeemablesItemResultGift**](ValidationsValidateResponseBodyRedeemablesItemResultGift.md) | | [optional]
**loyalty_card** | [**\OpenAPI\Client\Model\ValidationsRedeemableApplicableResultLoyaltyCard**](ValidationsRedeemableApplicableResultLoyaltyCard.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
7 changes: 4 additions & 3 deletions docs/Model/ValidationsValidateResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**valid** | **bool** | The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable. |
**redeemables** | [**\OpenAPI\Client\Model\ValidationsValidateResponseBodyRedeemablesItem[]**](ValidationsValidateResponseBodyRedeemablesItem.md) | Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`. |
**redeemables** | [**\OpenAPI\Client\Model\ValidationsValidateResponseBodyRedeemablesItem[]**](ValidationsValidateResponseBodyRedeemablesItem.md) | |
**skipped_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each skipped redeemable. | [optional]
**inapplicable_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each inapplicable redeemable. | [optional]
**order** | [**\OpenAPI\Client\Model\OrderCalculated**](OrderCalculated.md) | | [optional]
**tracking_id** | **string** | Hashed customer source ID. | [optional]
**session** | [**\OpenAPI\Client\Model\Session**](Session.md) | | [optional]
**application_mode** | **string** | |
**inapplicable_redeemables** | [**ValidationsRedeemableInapplicable[]**](ValidationsRedeemableInapplicable.md) | Lists validation results of each inapplicable redeemable. | [optional]
**stacking_rules** | [**\OpenAPI\Client\Model\StackingRules**](StackingRules.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**applicable_to** | [**\OpenAPI\Client\Model\ApplicableToResultList**](ApplicableToResultList.md) | | [optional]
**inapplicable_to** | [**\OpenAPI\Client\Model\InapplicableToResultList**](InapplicableToResultList.md) | | [optional]
**result** | [**\OpenAPI\Client\Model\ValidationsValidateResponseBodyRedeemablesItemResult**](ValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional]
**metadata** | **object** | | [optional]
**metadata** | **object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional]
**categories** | [**\OpenAPI\Client\Model\Category[]**](Category.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ClientQualificationsCheckEligibilityResponseBody implements ModelInterface
'redeemables' => '\OpenAPI\Client\Model\QualificationsRedeemables',
'tracking_id' => 'string',
'order' => '\OpenAPI\Client\Model\OrderCalculated',
'stacking_rules' => '\OpenAPI\Client\Model\QualificationsStackingRules'
'stacking_rules' => '\OpenAPI\Client\Model\StackingRules'
];

/**
Expand Down Expand Up @@ -396,7 +396,7 @@ public function setOrder($order)
/**
* Gets stacking_rules
*
* @return \OpenAPI\Client\Model\QualificationsStackingRules|null
* @return \OpenAPI\Client\Model\StackingRules|null
*/
public function getStackingRules()
{
Expand All @@ -406,7 +406,7 @@ public function getStackingRules()
/**
* Sets stacking_rules
*
* @param \OpenAPI\Client\Model\QualificationsStackingRules|null $stacking_rules stacking_rules
* @param \OpenAPI\Client\Model\StackingRules|null $stacking_rules stacking_rules
*
* @return self
*/
Expand Down
Loading

0 comments on commit 2b65ac8

Please sign in to comment.