---
id: TST-PFM-SEC-117
title: Delete user 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/security/tests/integration/services/invitations/delete-user.integration.spec.js
implements:
  - ATS-PFM-SEC-009-06
  - ATS-PFM-SEC-011-06
  - ATS-PFM-SEC-016-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/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      deleting a user the database will not let go
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#refuses
      with the sentence that tells the administrator what to do instead
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#names
      the refusal user_undeletable, so a screen can act on it without reading the sentence
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      the person exactly as they were
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      no former-user row: the insert went back with the delete
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#records
      the refused attempt under the code the database’s refusal carried
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      deleting the last administrator of a customer
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#refuses
      the delete as a lockout, naming the guard’s machine code
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      the person in place, because the count ran inside the delete’s own transaction
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      no former-user row, so nobody is remembered as deleted who is not
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#records
      the refused attempt with the guard’s reason
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      an administrator deleting their own account
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#refuses
      it, and says to ask another administrator
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      the person in place, with nothing remembered of a deletion
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#records
      the refused attempt, so an account that refuses to go still leaves the trail
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      deleting Rhythm’s last Rhythm Administrator
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#refuses
      the delete as the staff guard does, naming its machine code
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      the person in place, because the count ran inside the delete’s own transaction
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      their Rhythm Administrator grant standing, so somebody can still hand the role out
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      no former-user row, so nobody is remembered as deleted who is not
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#records
      the refused attempt with the staff guard’s reason
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      deleting a Rhythm Administrator while another one is left
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#deletes
      them, answering the id it removed
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#takes
      the person out of the directory: the staff guard only refuses the last one
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#remembers
      who they were, as every delete does
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#leaves
      Rhythm with the one administrator the guard counted
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#security:
      deleting a user who is not Rhythm staff, with no Rhythm Administrator left
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/invitations/delete-user.integration.spec.js#deletes
      them all the same: the staff guard asks nothing about a customer’s own people
dependency_evidence: >-
  The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here.
  The file declares no substituted collaborators.
evidence:
  - >-
    services-platform:modules/security/tests/integration/services/invitations/delete-user.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/security/tests/integration/services/invitations/delete-user.integration.spec.js
  explicit_no_doubles: true
  identified_double_boundaries: []
---
# Delete user 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 delete user.

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