---
id: TST-PFM-MTD-040
title: associations table
kind: integration
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/associations/tests/integration/db/associations.table.integration.spec.js
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Prepared integration database and the suite fixture records; fixture teardown restores or removes its own
  rows.
evidence:
  - 'services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js'
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#modules/associations/db/associations.table.ts
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#tests/integration/services/persistence/associations.integration.spec.js
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    a well-formed row, open, not primary and unkeyed, so each refusal below is about what it spoils
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a second association with the same id in the tenant, by the primary key
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a type the tenant does not have, by the type foreign key
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    an end before the start, by the dates check
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    an association that starts and ends on the same day, the dates being inclusive
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a from key that names another record than the from record, by the keys check
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a to key that names another record than the to record, by the keys check
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a sys_locked value outside the two the standard defines, by the locked check
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a blank record id: the trigger nulls it and the column refuses the null
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a second open association of one type between one pair, by associations_open_pair_uidx
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    the same pair again once the first association has ended, which is dated history
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a second open association holding the same to key, by associations_one_to_uidx
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    a second association of the same to record when neither carries the key (many-to-many)
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a second open association holding the same from key, by associations_one_from_uidx
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    a new keyed owner once the old owner’s association has ended
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses
    a second open primary of one from record and type, by associations_primary_uidx
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#accepts
    a second association of the from record that is not primary
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#shows a
    tenant its own associations and never another tenant’s, with no predicate in the statement
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#refuses,
    under the tenant policy, an association written into another tenant
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#reads a
    record’s associations from the from side through associations_from_idx under the tenant policy
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#reads a
    record’s associations from the to side through associations_to_idx under the tenant policy
  - >-
    services-platform:modules/associations/tests/integration/db/associations.table.integration.spec.js#reads
    both directions of a record, as the list does, through the two indexes together
fixture_imports:
  - drizzle-orm
  - '@rhythmsoftware/macroservice-testing/refusals'
  - '@rhythmsoftware/macroservice-testing/stage'
  - ../../../db/association-types.table
  - ../../../db/associations.table
  - ../support
test_doubles: []
limitations: []
unmatched_specification: FND-PFM-MTD-083
binding_assertions: []
---

# Associations table

## Verification Boundary

This integration suite checks relationship definitions and links within the local test harness. The registered file and pinned revision define its boundary.

## What This Suite Proves

The suite contains executable checks for this module, but no matching detailed scenario is established in this back-fill. The executable coverage finding records that mapping gap. Assertions are evidence of implemented checks; no execution result is claimed.

## What It Does Not Prove

The register does not establish a current passing run or full specification conformance. Behavior outside the suite’s fixtures and assertions remains unverified.

## Real Dependencies and Test Doubles

The fixture uses PostgreSQL and the imported persistence or API code. The fixture imports identify the setup seams; this register makes no broader claim that dependencies are undoubled.

## Must Not Be Doubled

The operation under examination and its asserted stored outcomes must remain real within the declared harness. A fixture cannot replace the write, refusal or transactional effect that the bound scenario checks.
