---
id: TST-COM-ORD-064
title: 'Entitlement interventions: the manual grant and the staff revoke'
kind: integration
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js
implements:
  - ATS-COM-ORD-013-07
  - ATS-COM-ORD-013-11
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 2
isolation: The suite creates its own test workspace records and removes them using the fixture cleanup.
evidence:
  - provenance: test
    source: >-
      services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js
    test_cases:
      - 'writes a manual grant with no order, line or obligation, the window stated, the reason in its notes'
      - 'records the grant_entitlement intervention on the new grant with the reason, and sends its audit event'
      - >-
        makes the grant drawable at once: the consume function drew one use and the Eligibility view held the
        two left
      - 'refuses a window that ends before it starts, writing neither the grant nor the intervention'
      - 'moves it to revoked with the staff reason, the used quantity standing'
      - takes it out of the Eligibility view and the consume function at once
      - records the revoke_entitlement intervention and sends its audit event
      - 'refuses a second revoke 409 entitlement_not_revocable, logging nothing more'
      - 'revokes it whatever its source, with the intervention and the revocation on the order’s history'
      - is not reinstated by an enforcement’s restore of the line
      - refuses an expired grant 409 entitlement_not_revocable
      - refuses an unknown grant 404
scenario_coverage:
  - scenario: ATS-COM-ORD-013-07
    test_cases:
      - 'writes a manual grant with no order, line or obligation, the window stated, the reason in its notes'
      - 'moves it to revoked with the staff reason, the used quantity standing'
      - 'refuses a second revoke 409 entitlement_not_revocable, logging nothing more'
      - 'revokes it whatever its source, with the intervention and the revocation on the order’s history'
      - 'refuses a window that ends before it starts, writing neither the grant nor the intervention'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-013-11
    test_cases:
      - takes it out of the Eligibility view and the consume function at once
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
dependency_evidence:
  provenance: test
  source: >-
    services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js
  declared_by_test: >-
    PostgreSQL, the persistence services, the consume function under the capability role, the Eligibility
    view, the execution contexts under `rhythm_commerce_app`. Doubled: the audit port (the fixture).
---

# Entitlement interventions: the manual grant and the staff revoke

## Verification Boundary

The suite exercises persistence or workflow operations against the local integration database.

## What This Suite Proves

The registered cases check entitlement interventions: the manual grant and the staff revoke with their fixture records and assertions. Scenario bindings name only the examples those cases exercise.

## What It Does Not Prove

A registered file supplies no run result or verified conformance by itself. Local fixtures do not establish deployed cross-service behavior or complete browser journeys.

## Real Dependencies and Test Doubles

PostgreSQL and the exercised Commerce persistence or workflow code are real. Remote service records, clocks and transports follow the suite’s fixtures.

## Must Not Be Doubled

The database constraints, role restrictions, locks and transactions exercised by this suite must use PostgreSQL.
