---
id: TST-PFM-ELG-450
title: Eligibility definitions checks
kind: integration
product_area: platform
module: eligibility
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - >-
    modules/eligibility/tests/integration/services/persistence/definitions.integration.spec.js
implements:
  - ATS-PFM-ELG-001-01
  - ATS-PFM-ELG-001-02
  - ATS-PFM-ELG-001-03
  - ATS-PFM-ELG-001-14
  - ATS-PFM-ELG-005-03
  - ATS-PFM-ELG-005-04
  - ATS-PFM-ELG-005-08
environment: local
implementation_state: implemented
latest_result: not-run
conformance: not-verified
estimated_minutes: 5
isolation: Prepared local test database with suite-owned fixture keys and cleanup.
evidence:
  - provenance: test
    source: >-
      services-platform:modules/eligibility/tests/integration/services/persistence/definitions.integration.spec.js
    cases:
      - definitions.queries.integration.spec.js
      - >-
        answers the definition active under the id it was given, with the tags
        trimmed and folded
      - >-
        stores the draft as version 1 of the definition, with the expression’s
        hash
      - stamps the definition with the acting user and version 1
      - >-
        refuses a second definition with the same id (key) in the tenant, naming
        it
      - 'accepts the same id in another tenant, because ids are unique per tenant'
      - 'refuses an id that is not a configuration id, before anything is written'
      - >-
        accepts a one-character id and one of 63 characters (the boundaries of
        the grammar)
      - refuses an id of 64 characters
      - refuses a reuse scope outside the three
      - >-
        refuses a draft whose expression is not a JSON object, and writes no
        definition either
      - refuses more than twenty tags
      - >-
        changes the name, tags and portal message at the version read, and moves
        the version
      - leaves what the update omits as it was
      - >-
        refuses a change at a version that is no longer current, and leaves the
        row as it was
      - 'refuses an update that names the key, which never changes'
      - refuses a definition of another tenant as not found
      - clears the description when the update gives null
      - 'refuses a replacement that is archived, and leaves the definition active'
      - refuses a definition as its own replacement
      - deprecates an active definition and records its replacement
      - refuses to deprecate a definition that is already deprecated
      - restores a deprecated definition to active and forgets its replacement
      - restores an archived definition to active
      - refuses to restore a definition that is already active
      - refuses a lifecycle move at a version that is no longer current
      - >-
        refuses while an active binding follows it, counting the binding, and
        leaves it active
      - >-
        refuses while another definition’s published version references it,
        counting the reference
      - >-
        refuses while the current draft of another definition references it,
        counting the reference
      - >-
        refuses while the published version of a deprecated definition
        references it
      - >-
        archives it once every definition that referenced it is archived,
        whatever its dependency rows still say (DEF-ELIG-0275)
      - >-
        archives the definition a draft referenced once that draft’s definition
        is archived
      - archives the bound definition once its binding is suspended
      - refuses a new draft of an archived definition
      - answers the definition and no draft
      - writes no version for it
  - provenance: documented
    source: >-
      services-platform:modules/eligibility/tests/integration/services/persistence/definitions.integration.spec.js:suite
      header
    note: >-
      The source header describes the verification boundary and declared
      substitutions.
proof_limit: >-
  Only the named scenario checkpoints have a verified source binding; execution
  has not been attempted.
---

# Eligibility definitions checks

## Verification Boundary

This suite checks the module through real local service and database code at the entry points used by its test cases.

## What This Suite Proves

The mapped scenarios identify the capability and feature checkpoints this file exercises. The source test titles preserve the assertion-level evidence.

## What It Does Not Prove

Registration supplies no execution result or conformance decision. Checks beyond the file’s reachable assertions remain unverified, including production configuration.

## Real Dependencies and Test Doubles

The suite exercises its real module dependencies and declares no test doubles. Its source header and imports identify the database, transaction and service boundaries it uses.

## Must Not Be Doubled

The module behavior under assertion, transaction boundary and database constraint being checked remain real. Fixture setup cannot stand in for the asserted write or refusal.
