Test Scenarios
26 scenarios proving CAP-PFM-SEC-004; 11 bound to an existing test.
01 Check separate staff permissions for retirement actionspermissionapinegativetest
- Proves
BR-CAP-PFM-SEC-004-01 - Preconditions
- Prepare a deletion request and a customer-administrator identity.
- Steps
- Attempt requesting, holding, releasing, cancelling, reading, listing and recovering deletion.
- Expected
- The administrator is refused and the existing request is unchanged.
- Data
- Use the records described in the setup.
- Bound to
- Source
- services-platform:modules/tenants/tests/e2e/tenant-deletion-requests.e2e.spec.js#may not ask for a tenant to be deleted
04 Check calendar waits and the production minimumboundaryunittest
- Proves
BR-CAP-PFM-SEC-004-04 - Preconditions
- Prepare previously used, never-activated and disposable workspaces.
- Steps
- Request their removal and attempt an eleven-day production configuration.
- Expected
- Normal requests wait thirty days, never-activated requests one day and disposable short waits apply only outside production; the short production configuration fails.
- Data
- Use the records described in the setup.
- Bound to
- Source
- services-platform:modules/tenants/tests/integration/services/deletion/request-deletion.integration.spec.js#makes a tenant that has been in use wait the full period
10 Check recovery preserves eligibility and requires purge failurefailureapinegativetest
- Proves
BR-CAP-PFM-SEC-004-10 - Preconditions
- Prepare a scheduled request and a completed purge.
- Steps
- Resume the schedule twice and attempt purge retry.
- Expected
- Eligibility stays fixed; a second running schedule and a retry without purge failure each return 409 without changing the request.
- Data
- Use the records described in the setup.
- Bound to
- Source
- services-platform:modules/tenants/tests/e2e/tenant-deletion-recovery.e2e.spec.js#leaves the request scheduled, and its eligibility exactly where it was: a resume cannot bring a deletion forward
11 Check retained identity and identifier retirementinvariantapitest
- Proves
BR-CAP-PFM-SEC-004-11 INV-DOM-PFM-SEC-002-01 - Preconditions
- Prepare a deletion that can complete.
- Steps
- Read the request’s copied identity and try provisioning under the removed workspace identifier.
- Expected
- The request retains the workspace name and customer; provisioning with the retired identifier fails.
- Data
- Complete a workspace removal in the test database before reading the retained request.
- Bound to
- Source
- services-platform:modules/tenants/tests/integration/services/deletion/request-deletion.integration.spec.js#copies the tenant name and customer, so the record still reads after the tenant is gone
12 Workspace lifecycle: provisioning_failed to deletion_pendingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-02 - Preconditions
- Use an isolated workspace lifecycle in provisioning_failed state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Request retirement of the disabled failed setup with its name and reason.",
"expect": "Read the resulting workspace lifecycle as deletion_pending; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/request-deletion.ts:REQUESTABLE_TENANT_LIFECYCLE_STATES",
"services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5."
]
}
]
- Expected
- Read the resulting workspace lifecycle as deletion_pending; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/request-deletion.ts:REQUESTABLE_TENANT_LIFECYCLE_STATES,services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5.
13 Workspace lifecycle: active to deletion_pendingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-02 - Preconditions
- Use an isolated workspace lifecycle in active state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Request retirement of the disabled active workspace with its current version.",
"expect": "Read the resulting workspace lifecycle as deletion_pending; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/request-deletion.ts:requestTenantDeletion",
"services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5."
]
}
]
- Expected
- Read the resulting workspace lifecycle as deletion_pending; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/request-deletion.ts:requestTenantDeletion,services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5.
14 Workspace lifecycle: deletion_pending to activetransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-07 - Preconditions
- Use an isolated workspace lifecycle in deletion_pending state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Cancel before the destructive task takes the request lock.",
"expect": "Read the resulting workspace lifecycle as active; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/deletion-holds.ts",
"services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5."
]
}
]
- Expected
- Read the resulting workspace lifecycle as active; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/deletion-holds.ts,services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5.
15 Workspace lifecycle: deletion_pending to deletingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-08 - Preconditions
- Use an isolated workspace lifecycle in deletion_pending state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Deliver the gating notices, advance beyond eligibility and execute the destructive task.",
"expect": "Read the resulting workspace lifecycle as deleting; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/begin-destruction.ts",
"services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5."
]
}
]
- Expected
- Read the resulting workspace lifecycle as deleting; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/begin-destruction.ts,services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5.
16 Workspace lifecycle: active to deletingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-10 - Preconditions
- Use an isolated workspace lifecycle in active state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Apply the operator restore-recovery action first in dry-run mode and then to the run-owned restored workspace.",
"expect": "Read the resulting workspace lifecycle as deleting; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/persistence/tenants.ts:forceTenantDeletingAfterRestore",
"services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5."
]
}
]
- Expected
- Read the resulting workspace lifecycle as deleting; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/persistence/tenants.ts:forceTenantDeletingAfterRestore,services-platform at ad3f6a65: modules/tenants/services/lifecycle/lifecycle-transitions.ts; services/persistence/tenants.ts; services/provisioning/*; services/deletion/*; services/access/tenant-availability.ts; db/tenants.table.ts; docs/tenants/tenant-lifecycle-plan.md §2.2, §4, §5.
17 Workspace retirement request: scheduled to heldtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-06 - Preconditions
- Use an isolated workspace retirement request in scheduled state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Place a reasoned hold; also inspect the automatic hold after the requester loses authority.",
"expect": "Read the resulting workspace retirement request as held; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/deletion-holds.ts; begin-destruction.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as held; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/deletion-holds.ts; begin-destruction.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
18 Workspace retirement request: held to scheduledtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-06 - Preconditions
- Use an isolated workspace retirement request in held state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Release the hold close to eligibility and inspect the revised deadline and reminder.",
"expect": "Read the resulting workspace retirement request as scheduled; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/deletion-holds.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as scheduled; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/deletion-holds.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
19 Workspace retirement request: scheduled to cancelledtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-07 - Preconditions
- Use an isolated workspace retirement request in scheduled state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Cancel the scheduled request before destructive execution.",
"expect": "Read the resulting workspace retirement request as cancelled; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/deletion-holds.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as cancelled; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/deletion-holds.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
20 Workspace retirement request: held to cancelledtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-07 - Preconditions
- Use an isolated workspace retirement request in held state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Cancel the held request before destructive execution.",
"expect": "Read the resulting workspace retirement request as cancelled; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/deletion-holds.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as cancelled; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/deletion-holds.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
21 Workspace retirement request: scheduled to executingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-08 - Preconditions
- Use an isolated workspace retirement request in scheduled state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Deliver required notices and let the eligible watcher start destruction.",
"expect": "Read the resulting workspace retirement request as executing; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/begin-destruction.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as executing; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/begin-destruction.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
22 Workspace retirement request: executing to failedtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-10 - Preconditions
- Use an isolated workspace retirement request in executing state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Fail the named purge job after a completed removal step and run the failure handler.",
"expect": "Read the resulting workspace retirement request as failed; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/tenant-purge-failure.ts",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as failed; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/tenant-purge-failure.ts,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
23 Workspace retirement request: failed to executingtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-10 - Preconditions
- Use an isolated workspace retirement request in failed state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Retry the failed named purge as authorized staff.",
"expect": "Read the resulting workspace retirement request as executing; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/operator-recovery.ts:retryTenantPurge",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as executing; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/operator-recovery.ts:retryTenantPurge,services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
24 Workspace retirement request: executing to completedtransitionapiproposed
- Proves
BR-CAP-PFM-SEC-004-11 - Preconditions
- Use an isolated workspace retirement request in executing state, with the required authority and guard fixtures.
- Steps
- [
{
"do": "Complete every participant inventory and execute finalization; inspect retained counts and the external ledger attempt.",
"expect": "Read the resulting workspace retirement request as completed; inspect the associated records and recorded history for this transition.",
"provenance": "proposed",
"source": [
"services-platform:modules/tenants/services/deletion/tenant-purge-workflow.ts (finalize)",
"services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5."
]
}
]
- Expected
- Read the resulting workspace retirement request as completed; inspect the associated records and recorded history for this transition.
- Data
- A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
- Source
- services-platform:modules/tenants/services/deletion/tenant-purge-workflow.ts (finalize),services-platform at ad3f6a65: modules/tenants/db/tenant-deletion-requests.table.ts, tenant-deletion-notices.table.ts; services/deletion/*; docs/tenants/tenant-lifecycle-plan.md §5.
25 Manage a workspace retirement request with maintain workspace information and operating statusinteractionapinegativeproposed
- Proves
BR-CAP-PFM-SEC-002-03 BR-CAP-PFM-SEC-004-07 - Preconditions
- A disabled active workspace is eligible for retirement.
- Steps
- Request retirement, try enabling the workspace, cancel before destruction, and read both axes.
- Expected
- The enabling attempt fails; cancellation restores active lifecycle while business status remains disabled.
- Data
- An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
- Source
- services-platform:modules/tenants/tests/integration/services/persistence/tenants.integration.spec.js#ignores a lifecycle state a write input carries, rather than letting a client set the system axis,services-platform:modules/tenants/tests/integration/services/deletion/deletion-holds.integration.spec.js#leaves the tenant disabled: calling off a deletion restores nobody access
26 Manage a workspace retirement request with prepare a workspace for customer useinteractionapinegativeproposed
- Proves
BR-CAP-PFM-SEC-003-05 BR-CAP-PFM-SEC-004-02 - Preconditions
- A failed setup has a disabled workspace and completed participant work.
- Steps
- Request retirement instead of retrying setup, then attempt a setup retry against the pending retirement.
- Expected
- Retirement owns the lifecycle and setup cannot reactivate the workspace.
- Data
- An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
- Source
- services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#does the missing work and not the finished work when it is provisioned again,services-platform:modules/tenants/tests/integration/services/deletion/request-deletion.integration.spec.js#refuses a tenant that is still live, because people must lose access first