---
id: TST-PFM-SEC-232
title: Workspaces.table database and service checks
kind: integration
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/tenants/tests/integration/db/tenants.table.integration.spec.js
implements:
  - ATS-PFM-SEC-002-06
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: Use the prepared test database and suite-owned fixture rows; retain shared seed records.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#tenants
      table: the constraints the database enforces
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a status outside the closed list by tenants_status_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a type outside the closed list by tenants_type_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      an edition outside the closed list by tenants_edition_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a legacy system outside the closed list by tenants_legacy_system_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a portal currency code mode outside the closed list by tenants_portal_currency_code_mode_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a sys_locked value outside the closed list by tenants_sys_locked_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a second row with the same id by the tenants_pk primary key
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row naming a customer that does not exist by tenants_customer_fk
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row naming a parent that does not exist by tenants_parent_fk
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      deleting a tenant that children still name as their parent by tenants_parent_fk
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a time zone that is an abbreviation by tenants_time_zone_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a time zone that is a fixed offset by tenants_time_zone_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      an Etc time zone by tenants_time_zone_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row with no time zone, naming the column
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row with no name, naming the column
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row with no customer, naming the column
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a row with no status, naming the column
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#tenants
      table: the sandbox hierarchy the trigger enforces
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#accepts
      a sandbox of a customer tenant of its own customer, the negative control
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a tenant that is not a sandbox but names a parent by tenants_sandbox_parent_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a sandbox that names no parent by tenants_sandbox_parent_check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a sandbox whose parent is not of type customer
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a sandbox whose parent belongs to another customer
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a sandbox of a sandbox, so a sandbox is never a parent
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      turning a tenant that has sandboxes into a sandbox itself
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      moving a tenant that has sandboxes to another customer, which would split the pair
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#refuses
      a parent and its sandbox written by one statement when the parent is of the wrong type
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#accepts
      a parent and its sandbox written by one statement when the pair is right, the negative control
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#tenants
      table: the id column
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#stores
      an id with dots, hyphens and underscores as it was given
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#stores
      a padded id trimmed, the normalization trigger running before the check
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#holds
      no domain column, the id being the tenant’s one identifier
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#holds
      no domain history table
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js#keeps
      no function or trigger that kept a domain (migrations 0095 and 20261017164245_tenant_identity)
dependency_evidence: >-
  The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here.
  The file declares no substituted collaborators.
evidence:
  - 'services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js'
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  Each binding names the scenario to which this file contributes assertions. A binding is not a
  recorded pass and does not extend the file’s dependency boundary.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: 'services-platform:modules/tenants/tests/integration/db/tenants.table.integration.spec.js'
  explicit_no_doubles: true
  identified_double_boundaries: []
---
# Workspaces.table database and service checks

## Verification Boundary

The file exercises database or service behavior through the local integration harness. The assertion references identify the source checks for workspaces.table.

## What This Suite Proves

The source assertions support the observations named in the bound scenarios. A scenario spanning multiple files must retain the other files’ contributions.

## What It Does Not Prove

This examination does not run the suite. Passing behavior, deployed conformance and the behavior of substituted dependencies require separate execution evidence.

## Real Dependencies and Test Doubles

The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here. The file declares no substituted collaborators.

## Must Not Be Doubled

Keep the queried database, applicable constraints and transaction boundaries real. Provider substitutes cannot establish delivery, cloud execution or cross-service recovery.
