From bce478e1e5ba4fb8f4fedc80f84d39ea4299d899 Mon Sep 17 00:00:00 2001 From: Clara Muller <5667350+ClaraMuller@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:47:50 +0100 Subject: [PATCH] feat(specs): add `sortBy` trigger on Composition Rules --- .../common/schemas/components/CompositionRule.yml | 8 ++++++++ tests/CTS/requests/composition/saveRules.json | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/specs/composition/common/schemas/components/CompositionRule.yml b/specs/composition/common/schemas/components/CompositionRule.yml index f696e687598..0f99cc3f794 100644 --- a/specs/composition/common/schemas/components/CompositionRule.yml +++ b/specs/composition/common/schemas/components/CompositionRule.yml @@ -70,6 +70,14 @@ condition: You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter. example: 'genre:comedy' + sortBy: + type: string + description: | + Sort criteria that trigger the rule. + + You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`. + The rule will trigger if the value passed to `sortBy` matches the one defined in the condition. + example: 'price-low-to-high' anchoring: type: string diff --git a/tests/CTS/requests/composition/saveRules.json b/tests/CTS/requests/composition/saveRules.json index 68b4c5bd5f7..44138e93a4d 100644 --- a/tests/CTS/requests/composition/saveRules.json +++ b/tests/CTS/requests/composition/saveRules.json @@ -334,6 +334,9 @@ { "anchoring": "contains", "pattern": "harry" + }, + { + "sortBy": "price-low-to-high" } ], "consequence": { @@ -384,6 +387,9 @@ { "anchoring": "contains", "pattern": "harry" + }, + { + "sortBy": "price-low-to-high" } ], "consequence": {