Fluent Commerce Logo
Docs

Sourcing Result Enricher Component

UI Component

Changed on:

7 Sept 2026

Overview

The Sourcing Result Enricher is a Mystique content component that transforms the compact Sourcing Audit data returned by the Sourcing Auditability API into a display-ready shape, then passes it to its descendants.It renders no visible UI of its own - it enriches the data and lays out its descendants against the result.
Plugin NameOMS
Admin components for managing a Fluent Commerce account.
2023-08-15

v1.0.0

OMS UI. Does not require to download.

Alias

fc.sourcing.result.enricher

Detailed technical description

What Gets Enriched

The Sourcing Result Enricher reads Sourcing Audit data from its `data` prop and rebuilds it into a form the display components can render directly. It looks up the Sourcing Profile carried on the audit and enriches each part of the result:
  • Strategy name - resolved from the profile by matching the audit strategy's `strategyRef` against a profile strategy's `ref`, across both `sourcingStrategies` and `sourcingFallbackStrategies`
  • Not-considered strategies - profile strategies of the audit's type (`sourcingStrategies` for `PRIMARY`, otherwise `sourcingFallbackStrategies`) that don't appear in the audit are appended with their `name` and `status` `NOT_CONSIDERED`, so the UI can show them even though the stored audit omits them
  • Conditions - each compact `{ p, a }` entry is merged with the matching profile Sourcing Condition (by position): 
    • `p` becomes `passed`
    • `a` becomes `actualValue`
    • the description is translated and rendered
  • Location criteria - each compact `{ n, a }` entry is merged with the matching profile Sourcing Criterion (by position): 
    • `n` becomes `normalisedValue`
    • `a` becomes `actualValue` 
    • the description and label are translated and rendered
  • Location missing items - `missingItemQuantities` is a positional array parallel to the audit's `items`: the value at each position is the missing quantity of the item at that same position. It is expanded into full item objects (`quantity` taken from that value); positions with quantity `0` are dropped
  • Fulfillment items - `fulfilments[].itemQuantities` uses the same positional/quantity form and is expanded into full item objects (positions with quantity `0` dropped)
  • Fulfillment location criteria - the criteria on `fulfilments[].location` are enriched with the same `{ n, a }``normalisedValue` / `actualValue` rule as location criteria

Input

The `data` is provided directly - there is no data-context fallback. It accepts:
  • A `sourcingAudits` query connection (`{ edges: [{ node }], pageInfo }`) - each `node` is enriched and the connection envelope is preserved. This is the standard binding, via `dataSource: "sourcingAudits"`
  • A single Sourcing Audit - enriched and returned as a single object
  • An array of Sourcing Audits - enriched element by element and returned as an array
When no `data` is provided, the result is empty.

Behavior

The component is a transparent wrapper: 
  • It does not mutate the source and passes the enriched copy to its descendants as a data override
  • It renders safely when data is incomplete - `null` or `undefined` is returned unchanged, an audit missing either `items` or `strategies` is passed through, and any part with no matching Profile entry keeps its raw values
  • Merging is positional and result-driven: each result entry is paired with the profile entry at the same index:
    • Where both set the same field, the result value wins
    • A result entry with no profile entry at its index is kept as-is
    • Profile entries beyond the result length are ignored
It is registered under `category: content`.

Explanation Through an Example

Conditions and Criteria

1{
2  "type": "PRIMARY",
3  "profile": {
4    "sourcingStrategies": [{
5      "ref": "Seattle_Metro",
6      "name": "Seattle Metro",
7      "sourcingConditions": [{
8        "name": "deliveryRegionIn",
9        "type": "fc.sourcing.condition.path",
10        "params": { "path": "fulfilmentChoice.address.region", "operator": "in", "value": "Seattle Metro" }
11      }],
12      "sourcingCriteria": [{
13        "name": "locationDistance",
14        "type": "fc.sourcing.criterion.locationDistance"
15      }]
16    }]
17  },
18  "items": [],
19  "strategies": [{
20    "strategyRef": "Seattle_Metro",
21    "conditions": [{ "p": true, "a": "Seattle Metro" }],
22    "locations":  [{ "criteria": [{ "n": 0.92, "a": 12.4 }] }]
23  }]
24}
1{
2  "strategies": [{
3    "strategyRef": "Seattle_Metro",
4    "name": "Seattle Metro",
5    "conditions": [{
6      "name": "deliveryRegionIn",
7      "type": "fc.sourcing.condition.path",
8      "params": {
9        "path": "fulfilmentChoice.address.region",
10        "operator": "in",
11        "value": "Seattle Metro"
12      },
13      "passed": true,
14      "actualValue": "Seattle Metro",
15      "description": "<translated + rendered>"
16    }],
17    "locations": [{
18      "criteria": [{
19        "name": "locationDistance",
20        "type": "fc.sourcing.criterion.locationDistance",
21        "normalisedValue": 0.92,
22        "actualValue": 12.4,
23        "description": "<translated + rendered>",
24        "label": "<translated>"
25      }]
26    }]
27  }]
28}

Missing and Fulfillment Item Quantities

1{
2  "items": [
3    { "orderItemRef": "OI-1", "productRef": "SKU_1", "productName": "Merino Beanie" },
4    { "orderItemRef": "OI-2", "productRef": "SKU_2", "productName": "Wool Scarf" }
5  ],
6  "strategies": [{
7    "strategyRef": "Seattle_Metro",
8    "locations":   [{ "missingItemQuantities": [0, 2] }],
9    "fulfilments": [{ "itemQuantities": [1, 3] }]
10  }]
11}
1{
2  "strategies": [{
3    "strategyRef": "Seattle_Metro",
4    "locations": [
5      { "missingItemQuantities": [
6        { "orderItemRef": "OI-2", "productRef": "SKU_2", "productName": "Wool Scarf", "quantity": 2 }
7      ] }
8    ],
9    "fulfilments": [
10      { "itemQuantities": [
11        { "orderItemRef": "OI-1", "productRef": "SKU_1", "productName": "Merino Beanie", "quantity": 1 },
12        { "orderItemRef": "OI-2", "productRef": "SKU_2", "productName": "Wool Scarf", "quantity": 3 }
13      ] }
14    ]
15  }]
16}

Properties

NameTypeRequiredDefaultDescription
`data``SourcingAuditConnection` / `SourcingAudit` / `SourcingAudit[]`NoNone
  • The Sourcing Audit data to enrich:
    • A `sourcingAudits` query connection (`edges` / `node`) - each `node` is enriched and the connection envelope is preserved
    • A single audit is returned as a single object
    • An array is enriched element by element and returned as an array
  • Bind it via `dataSource: "sourcingAudits"`; when no data is provided, the result is empty (there is no data-context fallback)

Configuration example

1{
2  "component": "fc.provider.graphql.paginated",
3  "props": {
4    "query": "query sourcingAudits($entityType: String!, $entityId: ID!, $first: Int) { sourcingAudits(entityType: $entityType, entityId: $entityId, first: $first) { edges { cursor node { entityType entityRef type status createdOn profile { ref version } items { orderItemRef productRef productName quantity } strategies { strategyRef status conditions locationCount locations { locationRef locationName criteria missingItemQuantities } fulfilments { fulfilmentRef selectedLocationPosition itemQuantities location { locationRef locationName criteria } } } } } pageInfo { hasNextPage } } }",
5    "variables": {
6      "entityType": "ORDER",
7      "entityId": "{{params.id}}",
8      "first": 10
9    },
10    "descendants": [
11      {
12        "component": "fc.sourcing.result.enricher",
13        "dataSource": "sourcingAudits",
14        "props": {
15          "descendants": [
16            {
17              "component": "fc.list",
18              "props": {
19                "attributes": [
20                  { "label": "Entity Ref", "template": "{{node.entityRef}}" },
21                  { "label": "Active Strategy", "template": "{{node.strategies.0.name}}" }
22                ]
23              }
24            }
25          ]
26        }
27      }
28    ]
29  }
30}

Version History

2026-09-07

v26.9.7

Initial release.

Recommended Placement

Use the Sourcing Result Enricher in the Sourcing tab, wrapping the components that render a Sourcing Request's detail - strategies, conditions, considered locations, and fulfillments.Bind it to the `sourcingAudits` query result via `dataSource: "sourcingAudits"` - the enricher walks the connection's `edges` and enriches each `node` - so its descendants can read the enriched strategy names, condition and criterion results, and resolved item quantities.