---
id: TST-PFM-MTD-119
title: custom fields queries
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.queries.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/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record of a text field, its lengths in the configuration
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record of a currency field, its bounds keeping the places they were written with
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record of a list field, the archived option flagged and no description key at all
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record of a reference field, required none where the create named no level
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    an archived field whole, its archival as an ISO instant and its version bumped
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the other tenant its own field under the same key, never the first tenant's
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    undefined for a key the tenant never created on the object
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    undefined for a key the tenant created on another object
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record of each field asked for, archived ones included, in object then key order
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    only the pairs asked for, never a field whose key was asked of another object
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#leaves
    out an identity the tenant has no field for
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the other tenant its own field under the same key, never the first tenant's
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    nothing for no identities
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the unarchived fields in creation order, ties broken by key
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    each listed field as the whole mapped record
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#listed
    the field while it was live, before it was archived
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#leaves
    an archived field out when it is not asked for
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the archived field last, whole, when archived fields are asked for
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the other tenant its one field alone, never the first tenant's four
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    an empty list for an object the tenant has given no custom field
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    an object that was never registered as a 404
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    a retired object as a 404
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the tenant's unarchived rows in description order
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the row itself, every typed column as the database holds it
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#leaves
    an archived field out of the rows a description reads
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the other tenant its own row alone, under the key both tenants used
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    no row at all for an object the tenant has given no custom field
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    the whole mapped record when the tenant has the field the path names
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#answers
    an archived field, which a route may still read and restore
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    a key the tenant never created as a 404 naming the object and the key
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    a key the tenant created on another object as a 404 naming the object asked for
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    the other tenant a key only this tenant has, as a 404 rather than answering this tenant's field
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#moved
    this tenant's field to a second version, the other tenant's keeping the first
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    an update at the version the other tenant's row carries, the row read being this tenant's own
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    an update that narrows the decimal places the row it read carries
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    an archive of a row it read as locked, while an update of that same row is accepted
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#refuses
    a restore while the row it read carries no archival stamp, and accepts one once it does
  - >-
    services-platform:modules/metadata/tests/integration/services/persistence/custom-fields.queries.integration.spec.js#names
    the object and the key when the tenant has no such field at all, from the update, the archive and the
    restore alike
fixture_imports:
  - drizzle-orm
  - ../../../../services/persistence/custom-fields
  - ../../../../aws/api/metadata-api-mapper
  - ../../../../db/custom-fields.table
  - ../../../../services/registration/register-application
  - '@rhythmsoftware/macroservice-testing/execution-context'
  - '@rhythmsoftware/macroservice-testing/refusals'
  - '@rhythmsoftware/macroservice-testing/stage'
  - '@rhythmsoftware/macroservice-time/clock'
  - '@rhythmsoftware/macroservice-errors/errors'
  - ../../support
test_doubles: []
limitations: []
unmatched_specification: FND-PFM-MTD-083
binding_assertions: []
---

# Custom fields queries

## 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 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.
