---
id: TST-PFM-MTD-120
title: custom fields rules
kind: integration
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js
implements:
  - ATS-PFM-MTD-006-01
  - ATS-PFM-MTD-006-02
  - ATS-PFM-MTD-006-03
  - ATS-PFM-MTD-006-06
  - ATS-PFM-MTD-006-07
  - ATS-PFM-MTD-006-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/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#reads
    the well-known Boat’s length rule as its description carries it
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#reads
    exposure staff for a field that stores no rule
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    the rules of a field the object does not have, as not found
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#replaces
    the whole set and answers it as stored
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#stores
    one row per kind, and exposure staff as none
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#removes
    the kinds a replacement leaves out
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    a condition naming a field the object does not have, and leaves the rules unchanged
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    a set that is not the rules contract
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#accepts
    a condition exactly at the stored size limit
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    a condition one byte over the stored size limit as invalid rules, and leaves the rules unchanged
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    a unique rule while nothing can check the object’s values for uniqueness
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#accepts
    a unique rule once the record store’s check answers without refusing
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    the rules of an archived field
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#removes
    a field’s rules when the field is archived
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
    the archive naming each dependent property and rule, and leaves the field and the rules unchanged
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#archives
    it once the rules are emptied
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#archives
    the dependent property itself, whose rule names another
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#does
    not apply to a native object: a contacts field its rule depends on is archived
fixture_imports:
  - drizzle-orm
  - '@rhythmsoftware/macroservice-errors/errors'
  - '@rhythmsoftware/macroservice-testing/refusals'
  - ../../../../db/custom-field-rules.table
  - ../../../../db/custom-fields.table
  - ../../../../services/persistence/custom-fields
  - ../../../../../custom-objects/tests/integration/support
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-006-01
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#removes
        the kinds a replacement leaves out
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#stores
        one row per kind, and exposure staff as none
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-006-02
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
        a condition naming a field the object does not have, and leaves the rules unchanged
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#accepts
        a condition exactly at the stored size limit
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
        a condition one byte over the stored size limit as invalid rules, and leaves the rules unchanged
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-006-03
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
        a unique rule while nothing can check the object’s values for uniqueness
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-006-06
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
        the archive naming each dependent property and rule, and leaves the field and the rules unchanged
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#archives
        it once the rules are emptied
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-006-07
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#removes
        a field’s rules when the field is archived
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#refuses
        the rules of an archived field
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-006-09
    provenance: test
    source:
      - >-
        services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.rules.integration.spec.js#does
        not apply to a native object: a contacts field its rule depends on is archived
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Custom fields rules

## Verification Boundary

This integration suite checks record descriptions and field configuration 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.
