---
id: TST-COM-ORD-069
title: The register delivering its own grant obligations through the worker
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/register/grant-handler.integration.spec.js
implements:
  - ATS-COM-ORD-013-04
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/register/grant-handler.integration.spec.js
    test_cases:
      - >-
        makes one grant of two uses (per grant, not per unit) for the buyer from the two unit obligations,
        both completed with it as their record
      - >-
        logs the attempts in process, writes order.entitlements_granted once, and acknowledges a redelivery as
        stale
      - >-
        fails the obligation of a purchase that names no specification, not retryable, with obligation_failed
        raised
      - >-
        dispatches one enforce obligation per delivered unit and the register revokes the grant with the cause
        as the reason
      - 'reinstates the grant on a restore, with the grant as the record'
scenario_coverage:
  - scenario: ATS-COM-ORD-013-04
    test_cases:
      - >-
        fails the obligation of a purchase that names no specification, not retryable, with obligation_failed
        raised
    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/register/grant-handler.integration.spec.js
  declared_by_test: >-
    PostgreSQL, the persistence services, the worker, the handler, the enforcement handler, the table-backed
    registry (the Merchandise participant's row, which the worker consults for the acknowledgement SLA and
    never calls), the execution contexts under `rhythm_commerce_app`. Doubled: the financial facts port (the
    fixture), the dispatcher's nudge (counted), the queue publisher (never reached), the audit and adjustment
    ports (fixtures).
---

# The register delivering its own grant obligations through the worker

## Verification Boundary

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

## What This Suite Proves

The registered cases check the register delivering its own grant obligations through the worker 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.
