---
id: WF-COM-CAT-011
title: Realize Accounting's special-price handovers
trigger: >-
  The realization function translates Accounting’s retired special-price criteria into scoped audiences and
  stamps each completed handover. The code is available but has no runtime caller.
product_area: commerce
module: catalog
revision: 1
status: draft
design_intent: proposed
implementation_evidence: partially-observed
inference: []
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
implements:
  - CAP-COM-CAT-010
moves:
  - STATE-COM-CAT-006
crosses:
  - SVC-COM-CAT-pricing
idempotency: >-
  Realization reuses existing audiences and bindings and skips completed handovers. Recovery adopts an
  audience prepared before a failed stamp.
concurrency: >-
  No production caller or concurrent execution policy exists. Audience uniqueness can reject racing creation,
  but no complete overlapping-run guarantee has been established.
hops:
  - 'n': 1
    actor_or_service: Realization job
    action: List unrealized Accounting handovers in rank order.
    anchor: 'services-commerce:modules/pricing/services/persistence/pricing-audience-handovers.ts'
    seam: sync
    on_failure: Stop on a read failure.
    left_inconsistent: No realization change has occurred.
    observer: The requesting person or service receives the result and any returned refusal.
    provenance: documented
    source: >-
      services-commerce:modules/pricing/services/handovers/audience-handover-realization.ts:realizePricingAudienceHandovers
  - 'n': 2
    actor_or_service: Realization job
    action: Create or reuse an inactive eligibility audience scoped to the handover’s product and rank.
    anchor: >-
      services-commerce:modules/pricing/services/handovers/audience-handover-realization.ts:realizePricingAudienceHandovers
    seam: sync
    on_failure: Report an occupied rank and leave that handover pending.
    left_inconsistent: The unprocessed handover remains available for another run.
    observer: The run report or provisioning verification identifies incomplete work.
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/integration/services/handovers/audience-handover-realization.integration.spec.js#leaves
      a handover whose rank another audience of the tenant holds, naming the rank
  - 'n': 3
    actor_or_service: Realization job to the eligibility binding port
    action: Ask the supplied binding port to translate retained criteria into a definition and binding.
    anchor: 'services-commerce:modules/pricing/services/handovers/audience-handover-realization.ts'
    seam: sync
    on_failure: Keep refused criteria pending and return their explanation.
    left_inconsistent: A prepared inactive audience can remain without qualification.
    observer: The run report or provisioning verification identifies incomplete work.
    provenance: documented
    source: 'services-commerce:modules/pricing/services/handovers/audience-handover-realization.ts'
  - 'n': 4
    actor_or_service: Realization job
    action: 'Set the audience binding and activity, then stamp the Accounting handover complete.'
    anchor: 'services-commerce:modules/pricing/services/persistence/pricing-audience-handovers.ts'
    seam: sync
    on_failure: A failed stamp leaves completion pending for a later adoption pass.
    left_inconsistent: An activated audience can remain beside an unstamped handover.
    observer: The run report or provisioning verification identifies incomplete work.
    provenance: documented
    source: 'services-commerce:modules/pricing/services/persistence/pricing-audience-handovers.ts'
branches: []
waits:
  - Runtime invocation and a real binding adapter remain outstanding.
evidence:
  - >-
    services-commerce at c8b66a98: modules/pricing/services/handovers/audience-handover-realization.ts;
    services/persistence/pricing-audience-handovers.ts;
    tests/integration/services/handovers/audience-handover-realization.integration.spec.js.
controls: [TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-CRY-001, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-LOG-004, TC-LOG-005, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-007, TC-PI-001, TC-PI-003, TC-PI-005, TC-PRV-001, TC-PRV-002]
---

# Realize Accounting's special-price handovers

## What It Does

The realization function translates Accounting’s retired special-price criteria into scoped audiences and stamps each completed handover. The code is available but has no runtime caller.

## The Flow

```mermaid
sequenceDiagram
  participant J as Realization job (no caller)
  participant H as Accounting handovers
  participant P as Pricing audiences
  participant B as Binding port (fixture)
  J->>H: unrealized handovers
  loop each handover
    J->>P: create or adopt audience (inactive)
    J->>B: definition and binding from criteria
    J->>P: bind and activate
    J->>H: stamp realized
  end
```

## When Something Fails

Stop on a read failure. No realization change has occurred. Report an occupied rank and leave that handover pending. The unprocessed handover remains available for another run. Keep refused criteria pending and return their explanation. A prepared inactive audience can remain without qualification. A failed stamp leaves completion pending for a later adoption pass. An activated audience can remain beside an unstamped handover.

## Open Design Questions

Runtime wiring and dependency coverage remain limited as recorded in the module findings. No production caller or concurrent execution policy exists. Audience uniqueness can reject racing creation, but no complete overlapping-run guarantee has been established.
