---
id: FAS-COM-ORD-05
title: Purchased benefits
feature: FEAT-COM-ORD-05
product_area: commerce
module: orders
revision: 1
status: proposed
product_intent: proposed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
capabilities:
  - CAP-COM-ORD-013
scenarios:
  - id: FAS-COM-ORD-05-01
    title: A purchased allowance supports replay-safe use
    kind: behaviour
    exercises:
      - CAP-COM-ORD-013
    relies_on:
      - ATS-COM-ORD-013-01
      - ATS-COM-ORD-013-05
    preconditions: A single-copy e-book purchase carries a two-use download grant.
    steps:
      - do: 'Deliver the purchase, draw one use, replay its key, draw the remaining use and try once more.'
        provenance: test
        source: &ref_0
          - >-
            services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#gives the member a
            link and consumes one use per Idempotency-Key (the retry free), then refuses the third 409
            insufficient_entitlement
    expected: >-
      The replay leaves one use available; the second distinct draw exhausts the grant and another draw
      is refused.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-061
    provenance: test
    source: *ref_0
    expected_provenance: test
    expected_source: *ref_0
  - id: FAS-COM-ORD-05-02
    title: Cancellation ends availability without erasing use
    kind: interaction
    exercises:
      - CAP-COM-ORD-013
      - CAP-COM-ORD-014
    relies_on:
      - ATS-COM-ORD-013-08
      - ATS-COM-ORD-014-04
    preconditions: A delivered grant has one recorded use.
    steps:
      - do: Cancel the purchase and retry the download.
        provenance: proposed
        source:
          - >-
            services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#revokes the line’s
            grant with the reason, refuses the download 409 entitlement_not_active, and writes the
            history
    expected: 'The right is revoked, consumption remains recorded and download is refused.'
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#revokes the line’s
        grant with the reason, refuses the download 409 entitlement_not_active, and writes the history
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#revokes the line’s
        grant with the reason, refuses the download 409 entitlement_not_active, and writes the history
    candidate_bindings:
      - TST-COM-ORD-061
    binding_gap: FND-COM-ORD-079
  - id: FAS-COM-ORD-05-03
    title: Restoration and expiry preserve the use trail
    kind: lifecycle
    exercises:
      - CAP-COM-ORD-013
    relies_on:
      - ATS-COM-ORD-013-06
      - ATS-COM-ORD-013-09
    preconditions: A finite grant has a consumed use and a future validity end.
    steps:
      - do: 'Restore the use with authority, replay restoration, advance beyond the end and run expiry.'
        provenance: proposed
        source:
          - ATS-COM-ORD-013-06
          - ATS-COM-ORD-013-09
    expected: Restoration occurs once and elapsed availability ends without deleting history.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-013-06
      - ATS-COM-ORD-013-09
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-013-06
      - ATS-COM-ORD-013-09
  - id: FAS-COM-ORD-05-04
    title: Holder reads do not confer intervention authority
    kind: permission
    exercises:
      - CAP-COM-ORD-013
      - CAP-COM-ORD-011
    relies_on:
      - ATS-COM-ORD-013-10
      - ATS-COM-ORD-011-03
    preconditions: A holder and a stranger each have linked contacts.
    steps:
      - do: 'Read as each member and attempt restoration, grant and revocation as the holder.'
        provenance: proposed
        source:
          - ATS-COM-ORD-013-10
          - ATS-COM-ORD-011-03
    expected: Only the holder’s read succeeds and staff interventions are refused.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-013-10
      - ATS-COM-ORD-011-03
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-013-10
      - ATS-COM-ORD-011-03
  - id: FAS-COM-ORD-05-05
    title: Racing draws cannot spend the last allowance twice
    kind: regression
    exercises:
      - CAP-COM-ORD-013
    relies_on:
      - ATS-COM-ORD-013-12
    preconditions: A finite grant has two uses left and two competing consumers.
    steps:
      - do: >-
          Hold a two-use draw open after it locks the grant, start a one-use contender and commit the
          first draw.
        provenance: test
        source:
          - >-
            services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#lets
            the first draw the two left
          - >-
            services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#refuses
            the second once the first committed, and the ledger holds exactly the first’s uses
    expected: >-
      The first draw consumes both remaining uses; the waiting one-use draw is refused and the grant
      records two used units.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-066
    provenance: test
    source:
      - >-
        services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#lets
        the first draw the two left
      - >-
        services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#refuses
        the second once the first committed, and the ledger holds exactly the first’s uses
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#lets
        the first draw the two left
      - >-
        services-commerce:modules/entitlements/tests/integration/services/persistence/entitlements.integration.spec.js#refuses
        the second once the first committed, and the ledger holds exactly the first’s uses
evidence:
  - provenance: documented
    source: 'rhythm-v2-docs:specs/commerce/orders/planning/features/FEAT-COM-ORD-05-entitlements.md'
  - provenance: observed
    source:
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-013-grant-the-rights-a-purchase-carries-and-track-their-use.md
---

# Purchased benefits: Feature Acceptance Suite

## What the Feature Must Do as a Whole

Purchased benefits connect delivery to an allowance that its holder can use. The suite follows consumption, replay, restoration and expiry while distinguishing the holder’s access from staff intervention authority.

## Interactions Between Capabilities

Delivery supplies the grant and the download route spends it without spending again on replay. Revocation ends availability while preserving recorded use. The existing helper test covers that boundary, but a full cancellation-to-revocation chain remains proposed. The competing-draw case uses a real database lock and a waiting contender.

## Regression Record

| Revision | Change | Scenario | Why |
|---|---|---|---|
| 1 | initial | all | Establish the feature’s combined outcomes from the pinned specification and executable evidence. |
