Context
In general, a context can be used to limit where entities, attributes, or specific properties are considered when executing business logic within the fulfillmenttools platform.
Entities which allow contexts currently:
Listings (sales prices, out of stock behavior)
These entities contain a context field. The context is evaluated at runtime and determines whether the given object is considered for the given use case. If no context is defined, no limitations are set.
The structure of the context is depicted here:
{
...
"context": [
{
"type": "FACILITY",
"operator": "NOT", // optional, not available in every entity
"values": [
"string"
]
},
...
]
}Entries in the context array are evaluated with a logical
ANDItems of the
valuesarray are evaluated with a logicalOReach entity supports different types for context like:
CATEGORY,FACILITY_IDandFACILITY_GROUPThe
operatoris optional, and we currently only support the valueNOT. Not every entity supports this.
Example
Let us assume that we want to create a discount that applies only to certain facility groups and not to a specific article category.
Therefore, we introduce a context to the discount and define on which sales prices the discount is considered when routing an order.
{
// discount entity
...
"context": [
{
"type": "FACILITY_GROUP",
"values": [
"uuid-facility-group1",
"uuid-facility-group2"
]
},
{
"type": "CONTEXT",
"operator": "NOT",
"values": [
"uuid-category1"
]
},
]
}In this example the discount is taken into account when:
the given facility is in facility group
uuid-facility-group1oruuid-facility-group2
and
the article category is not
uuid-category1.
Last updated