---
id: TST-PFM-SEC-245
title: Workspace deletion requests 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/services/persistence/tenant-deletion-requests.integration.spec.js
implements:
  - ATS-PFM-SEC-004-03
  - ATS-PFM-SEC-004-05
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/services/persistence/tenant-deletion-requests.integration.spec.js#tenant
      deletion requests persistence: createTenantDeletionRequest
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#answers
      a scheduled request with the facts it was given
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#mints
      a `tdr_` id
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#stores
      the eligibility it was given, in the wire form of an instant
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#stores
      when it was requested
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#stamps
      version 1 with the caller as creator
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#persists
      exactly the record it answered
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#writes
      the three notices it was given
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#writes
      every notice pending, with no attempt yet
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#refuses
      a second open request for the same tenant, by the index and not only by the service
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#leaves
      exactly one request behind after the duplicate is refused
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#allows
      a second request once the first is cancelled, as a new row with a new eligibility
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#refuses
      a reason the table will not take, as an InvalidRequest naming the bound
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#writes
      no notices when the request itself is refused
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#tenant
      deletion requests persistence: the state changes
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#holding
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#turns
      a scheduled request held
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#records
      who held it and why
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when the request is already held, keeping the first hold
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when the request is cancelled
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#releasing
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#turns
      a held request scheduled again, at the new eligibility
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#records
      who released it and when
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when the request was never held
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#cancelling
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#cancels
      a scheduled request
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#cancels
      a held request
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#records
      who cancelled it and why
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing once the request is executing, which is the point of no return
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#leaves
      the executing request exactly as it was after refusing the cancel
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#beginning
      execution
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#turns
      a scheduled request executing and names the purge job
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when the request is held, so a hold really does stop destruction
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when the request is cancelled
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#settling
      a request under the purge job that owns it
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#completes
      the request for the job it names
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when another job now owns the purge, so a superseded finalization completes nothing
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#fails
      the request for the job it names
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#matches
      nothing when another job now owns the purge, so a retry is never failed by the attempt it
      replaced
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#leaves
      the retried request exactly as it was after refusing the superseded job’s failure
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#naming
      the schedule job
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#records
      the execution that owns the request
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#replaces
      it, which is how an operator resume supersedes the old execution
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#tenant
      deletion requests persistence: the notices a request owes
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#appending
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#adds
      a notice to the request
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#mints
      a `tdn_` id
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#ignores
      a notice whose schedule slot is already taken, so a re-run sends nothing twice
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#leaves
      the request with the notices it had when a re-run adds nothing
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#accepts
      the same kind at a different instant, which is what a release owes
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#answers
      nothing and writes nothing when given no notices
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#the
      maximum a request keeps
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#keeps
      exactly the maximum once it is reached (the premise)
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#still
      keeps exactly the maximum after one more is appended
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#keeps
      the notice that was appended
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#never
      drops the requested notice, which destruction waits for
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#never
      drops the newest one-day reminder, the other notice destruction waits for
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#recording
      what a send came to
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#marks
      a notice delivered and stamps when
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#keeps
      the recipients it was given
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#counts
      every attempt, so a notice presented forty times reads differently from one presented once
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#keeps
      the reason a failed send failed
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#stamps
      no delivery instant on a failure
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#answers
      nothing for a notice that does not exist
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#the
      notices destruction waits for
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#lists
      both gating notices while neither has been sent
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#drops
      a delivered one from the list
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#counts
      a suppressed notice as sent, which is the development and test path
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#still
      lists a failed notice, so a send that never worked never lets a tenant be deleted
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#ignores
      a seven-day reminder that was never sent: only two kinds gate destruction
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/persistence/tenant-deletion-requests.integration.spec.js#answers
      the wire form of every instant it carries
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/services/persistence/tenant-deletion-requests.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/services/persistence/tenant-deletion-requests.integration.spec.js
  explicit_no_doubles: true
  identified_double_boundaries: []
---
# Workspace deletion requests 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 workspace deletion requests.

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