---
id: TST-PFM-TNL-067
title: Platform batched workspace removal
kind: integration
product_area: platform
module: tenant-lifecycle
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
implements:
  - ATS-PFM-TNL-017-01
  - ATS-PFM-TNL-017-06
  - ATS-PFM-TNL-017-13
  - ATS-PFM-TNL-018-01
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Run-owned target and comparison workspace records in the prepared test database; owner access is limited to
  fixture arrangement, independent inspection and cleanup of those records.
evidence:
  - 'services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js'
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../services/deletion/request-deletion
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../services/deletion/tenant-purge-workflow
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../services/lifecycle/asset-prefix-store
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../services/lifecycle/participants
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../services/lifecycle/remote-participants
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../../../../data-jobs/data-jobs.settings
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js
    imports ../../deletion-support
binding_scope: >-
  Each implements link names a scenario whose retained cited checks all occur in this file. Partial assertions
  for other scenarios remain evidence only.
partial_scenario_evidence:
  - scenario: ATS-PFM-TNL-002-02
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#refuses
        the purge as planned for other participants rather than skipping one
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-015-02
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#tells
        the people the plan owes a last notice to
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-02
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#runs
        one step per participant, in the planned order, and completes every one of them
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#asks
        a participant for another batch until it answers done, rather than looping inside one invocation
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#purges
        accounting.transactions before accounting.configuration, which it depends on
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#removes
        the tenant row itself
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-08
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#checks
        that nothing is left before it finalizes, and asks every participant to count
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#leaves
        no row of the tenant in any table a participant declares
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-09
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#leaves
        the other tenant of the same customer exactly as it was
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-10
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#keeps
        the customer, because the deleted tenant was not its last
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#keeps
        the deletion’s own job rows, which are the record of what was done
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-12
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#leaves
        no row of the tenant in any table a participant declares
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-018-02
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#keeps
        the deletion’s own job rows, which are the record of what was done
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-018-03
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#writes
        the permanent deletion record outside the database, keyed by the tenant
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-018-06
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge.integration.spec.js#records
        on the request what was removed, and the counts it verified
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
---
# Platform batched workspace removal

## Verification Boundary

The suite invokes production lifecycle services or persistence against its test database. Each fixture and directly called participant belongs to the repository named in the register; this is a local integration boundary.

## What This Suite Proves

Batched workspace removal is the inspected subject. The implements links identify scenarios whose cited checks occur in this file. The original test-title references delimit those checks; partial contributions to other combined scenarios remain evidence only.

## What It Does Not Prove

Source inspection supplies no passing run. The suite does not establish console behavior, deployment configuration, complete removal in every application or recovery from a provider failure beyond its declared seams. A local zero inventory covers declared and seeded resources only.

## Real Dependencies and Test Doubles

The local deletion harness runs the production workflow definition, task handler, job engine and Platform persistence. It advances a controlled clock and supplies recording mail, in-memory storage and ledger, remote-application, search and portal-provider seams. These doubles establish orchestration behavior rather than provider removal.

## Must Not Be Doubled

Keep the production service or persistence function and the database constraints, row policies and guarded removal functions under test real. For dispatcher cases, keep route selection and authorization real as well. Provider and remote-application seams must remain explicit and cannot stand in for deployed cross-application qualification.
