---
id: TST-PFM-MTD-053
title: custom object records merge
kind: integration
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js
implements:
  - ATS-PFM-MTD-014-05
  - ATS-PFM-MTD-019-08
  - 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/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#counts
    the values naming the merged contacts, in the sentence staff read
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#counts
    the one value naming the merged organization, in the singular
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#says
    so when no value names a merged record
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#blocks
    nothing for a reference property
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#reports
    as many values moved as the plan counted, for contacts and for organizations
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#names
    the surviving contact in every property that named a merged one
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#leaves
    a property that already named the survivor, and one naming another contact, as they were
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#leaves
    the property naming an organization alone when contacts are merged
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#names
    the surviving organization in the property that named the merged one
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#leaves
    another workspace’s record of the same ids as it was, through both merges
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#stamps
    the value row with the merge’s actor and keeps its key
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#moves
    nothing a second time when the same merge is applied again
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#keeps
    the old value and shows the survivor, as one update
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#attributes
    the change to the merge: its source, its actor and its merge id
  - >-
    services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#writes
    no revision for a record the merge did not change
fixture_imports:
  - drizzle-orm
  - pg
  - '@rhythmsoftware/macroservice-record-merge/participant'
  - '@rhythmsoftware/macroservice-testing/stage'
  - '@rhythmsoftware/macroservice-testing/execution-context'
  - ../../../../../db/config
  - ../../../services/persistence/custom-objects
  - ../../../services/persistence/custom-object-records
  - ../../../db/record-revisions.table
  - ../support
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-014-05
    provenance: test
    source:
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#keeps
        the old value and shows the survivor, as one update
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#attributes
        the change to the merge: its source, its actor and its merge id
    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-08
    provenance: test
    source:
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#names
        the surviving contact in every property that named a merged one
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#leaves
        a property that already named the survivor, and one naming another contact, as they were
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#leaves
        another workspace’s record of the same ids as it was, through both merges
    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/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#counts
        the values naming the merged contacts, in the sentence staff read
      - >-
        services-platform:modules/custom-objects/tests/integration/db/custom-object-records-merge.integration.spec.js#moves
        nothing a second time when the same merge is applied again
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Custom object records merge

## Verification Boundary

This integration suite checks custom objects and records 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.
