---
id: WF-ACC-TRX-018
title: Purge a workspace’s transactions
trigger: Workspace deletion invokes the registered Accounting transactions participant.
product_area: accounting
module: transactions
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-ACC-TRX-020
moves: []
crosses:
  - SVC-ACC-TRX-transactions
hops:
  - 'n': 1
    actor_or_service: Transactions participant
    action: >-
      Check deletion eligibility before each purge batch and reject an active
      workspace.
    anchor: >-
      services-accounting:modules/transactions/services/lifecycle/transactions-participant.ts:accountingTransactionsParticipant
    seam: sync
    on_failure: Reject lifecycle deletion admission.
    left_inconsistent: Deletion has removed no rows.
    observer: The lifecycle execution records deletion progress.
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/lifecycle/transactions-participant.ts:accountingTransactionsParticipant;
      services-accounting:modules/transactions/tests/integration/services/lifecycle/transactions-participant.integration.spec.js#it
      refuses to purge a live tenant, with nothing removed
  - 'n': 2
    actor_or_service: Transactions participant
    action: >-
      Remove dependent rows before parent and configuration records, retaining
      lifecycle progress between deletion batches.
    anchor: >-
      services-accounting:modules/transactions/services/lifecycle/transactions-participant.ts:accountingTransactionsParticipant
    seam: sync
    on_failure: Lifecycle execution retries the failed deletion batch.
    left_inconsistent: Deletion may have removed only part of the workspace's data.
    observer: The lifecycle execution records deletion progress.
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/lifecycle/transactions-participant.ts:accountingTransactionsParticipant
idempotency: >-
  Deleting rows already removed has no further effect, allowing lifecycle
  retries to continue.
concurrency: >-
  Deletion admission is checked locally; exclusion of concurrent writers
  elsewhere depends on Platform and is unverified here.
branches: []
waits: []
evidence:
  - >-
    services-accounting at f47cb263:
    services/lifecycle/transactions-participant.ts, snapshot-purge-steps.ts.
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-DAT-004, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-005]
---
# Purge a workspace’s transactions

## What It Does

Lifecycle purge removes the module’s retained financial data in dependency order. A failed batch can leave deletion partially complete until lifecycle retry.

## The Flow

```mermaid
flowchart TD
  h0["Transactions participant"]
  h1["Transactions participant"]
  h0 --> h1
```

The numbered hops identify the participating services, synchronization boundary and evidence. Branch conditions in the frontmatter explain where preparation, completion and recovery diverge.

## When Something Fails

Each hop records its rollback, retry or compensation boundary and the result visible to callers or operators. External outcomes can remain unresolved after local preparation commits; the listed recovery behavior defines what remains pending.

## Open Design Questions

Verify Platform-wide writer exclusion during deletion; the local participant establishes deletion state rather than that complete concurrency guarantee.
