---
id: TST-PFM-MTD-039
title: associations merge
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-merge.integration.spec.js
implements:
  - ATS-PFM-MTD-019-07
  - ATS-PFM-MTD-019-09
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-merge.integration.spec.js'
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#counts
    the associations held by m, and says how many end instead of moving
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#counts
    the associations pointing to m, and says that one ends
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#blocks
    nothing for associations
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#reports
    the rows the plan promised, column by column
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    an association m held that s did not have to s, open
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    m’s association that repeats s’s, giving it s’s id, and leaves s’s as it was
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    m’s ended association to s and keeps the day it ended
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    m’s one-to-one association, s already holding its one place, and moves its key with it
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    an association pointing to m so it points to s
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    the association of s with m, which would link s with itself
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    m’s primary association to s as an ordinary one, s keeping its own primary
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#leaves
    no association of the tenant naming m on either side
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#never
    touches another tenant’s association of the same ids
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#says
    that the links colliding with one still in force end instead of moving, and only those
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    m’s open link that repeats s’s link with a future end date, today, leaving s’s link alone
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    m’s open link as it is when s’s link with the same pair has already ended
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    m’s link as it is when s’s link of the pair covers other days
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
    m’s own link with a future end date keeping that date
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    m’s one-to-one link when s’s link with a future end date still holds its one place
  - >-
    services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
    today a link of m that repeats s’s open one and had a future end date, never later than today
fixture_imports:
  - pg
  - '@rhythmsoftware/macroservice-record-merge/participant'
  - '@rhythmsoftware/macroservice-testing/stage'
  - ../../../../../db/config
  - ../support
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-019-07
    provenance: test
    source:
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
        an association m held that s did not have to s, open
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
        m’s association that repeats s’s, giving it s’s id, and leaves s’s as it was
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends
        the association of s with m, which would link s with itself
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#moves
        m’s primary association to s as an ordinary one, s keeping its own primary
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-019-09
    provenance: test
    source:
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#counts
        the associations held by m, and says how many end instead of moving
      - >-
        services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#reports
        the rows the plan promised, column by column
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Associations merge

## 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 bindings identify the detailed or feature scenarios whose outcomes have assertions in this suite. Original case references remain attached to the detailed scenarios so a reviewer can inspect the exact assertion. 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.
