Replace Expired Values
ReplaceExpiredValuesRule
Replace expired values of products.
Notification level: ⚠
Key | Value |
---|---|
ID | ReplaceExpiredValuesRule |
Behavior
The Kitchen planner handles natively expired products with some basic behaviors. You can find more details in the expired products documentation 🔗.
However, we offer the possibility to the retailers to configure an ordered list of default values on parameters to take into account the expired products in Kitchen application.
📌 Note: This business rule only works when inserting a cabinet or when browsing through templates. If the default value of a parameter points to an expired products AND if a replacement for this specific expired product is provided in the ReplaceExpiredValuesRule rule, then the replacement is loaded instead of the expired product.
Trigger Conditions
As mentionned above, the rule is triggered only when inserting a cabinet or when browsing through templates. It only works when the expired product is the default value of a product parameter on a cabinet. This implies that elements such as linears (plinths, worktops, etc.) won't have any effect as they are not defined as product parameters.
Other cases
- If the retailers don't put the expired product in the ReplaceExpiredValuesRule, it will still load the expired product (even if it's expired).
- If the retailers un-expire the product (but keep the data in the ReplaceExpiredValuesRule rule), the product should not be modified.
Overload Parameter
Key name | Type | Default value | Description |
---|---|---|---|
replacements | object | – | A mapping table with a replacement product ID for each expired product ID. Mandatory key but can be empty. |
For example: In the sample code below, 13776 is the expired product and 14087 is the replacement product (as a non-expired product).
{
"replacements": {
"13776":"14087",
"9856":"9217",
"13461":"10370"
}
}
Example use cases
The following examples show how to deal with the replace values of expired products in the application.
1 - Product insertion
For this example, a cabinet CAB_800 has an expired handle product and the ID of the expired handle product is present in the "replacements" attribute (overloads of the rule). The ID of another non-expired handle product is also added in this object ("replacements" overloads).
- Open the Kitchen application
- Insert the cabinet CAB_800
- The cabinet CAB_800 should be inserted with the non-expired handle set as replacement in the business rule.
2 - Template generation
For this example, a cabinet CAB_600 has an expired handle product and the ID of the expired handle product is present in the "replacements" attribute (overloads of the rule). The ID of another non-expired handle product is also added in this object ("replacements" overloads).
- Open the Kitchen application
- Go to "Pick a layout" step and find any templace which contains the product CAB_600
- the cabinet should be proposed in the template with the non-expired handle set as replacement in the rule.