---
id: WF-ACC-TRX-017
title: Move a document to another batch and correct its details
trigger: >-
  Staff correct batching or permitted descriptive and date fields on existing
  financial documents.
product_area: accounting
module: transactions
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Andrew’s A-6 and A-7 (reassign batch; reopen non-money fields),
  services-accounting:docs/architecture/accounting-2.0/02-decisions.md#2.8
  Andrew's acceptance decisions of 2026-10-18 (about 15:35 UTC)
implementation_evidence: observed
inference: []
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-ACC-TRX-015
moves: []
crosses:
  - SVC-ACC-TRX-transactions
hops:
  - 'n': 1
    actor_or_service: Batch reassignment
    action: >-
      Check kind and lifecycle eligibility and both batch states, requiring a
      same-unit eligible destination; selecting the existing batch is a no-op.
    anchor: >-
      services-accounting:modules/transactions/services/document-edits/batch-reassignment.ts:reassignBatch
    seam: sync
    on_failure: Reject a move that violates batch eligibility.
    left_inconsistent: The complete transaction is undone.
    observer: The API response reports the outcome and applicable refusal code.
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/document-edits/batch-reassignment.ts:reassignBatch;
      services-accounting:modules/transactions/tests/integration/services/document-edits/reassign-and-edit.integration.spec.js#it
      is refused batch_not_open on a reassignment out of the batch
  - 'n': 2
    actor_or_service: Batch reassignment
    action: >-
      Move a receipt's same-batch allocations with its header and record the
      move without changing customer debt.
    anchor: >-
      services-accounting:modules/transactions/services/document-edits/batch-reassignment.ts:reassignBatch
    seam: sync
    on_failure: Undo all work in the transaction.
    left_inconsistent: The complete transaction is undone.
    observer: The API response reports the outcome and applicable refusal code.
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/document-edits/batch-reassignment.ts:reassignBatch;
      services-accounting:modules/transactions/tests/integration/services/document-edits/reassign-and-edit.integration.spec.js#it
      moves the allocation rows batched with it
  - 'n': 3
    actor_or_service: Detail edits
    action: >-
      Validate editable details and required explanations, and record old-date
      offsets and new-date facts for eligible accounting corrections.
    anchor: >-
      services-accounting:modules/transactions/services/document-edits/detail-edits.ts:redateFacts
    seam: sync
    on_failure: Reject the command and undo its transaction.
    left_inconsistent: The complete transaction is undone.
    observer: The API response reports the outcome and applicable refusal code.
    provenance: observed
    source: >-
      services-accounting:modules/transactions/services/document-edits/detail-edits.ts:redateFacts;
      services-accounting:modules/transactions/tests/integration/services/document-edits/reassign-and-edit.integration.spec.js#it
      negates the facts on the old accounting date and restates them on the new
      one, the originals untouched
idempotency: >-
  Each move or edit has a keyed result, and console multi-document moves derive
  separate document keys.
concurrency: >-
  Document locks protect edits while batch-specific locking checks posting
  eligibility.
branches: []
waits: []
evidence:
  - >-
    services-accounting at f47cb263: services/document-edits/*;
    services/batches-for-documents.ts; aws/api/document-edits.routes.ts.
  - >-
    react-console at baf6dae3:
    lib/accounting/transactions/batch-reassignment.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-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-003, TC-PI-005, TC-PRV-001, TC-PRV-002]
---
# Move a document to another batch and correct its details

## What It Does

Reassignment changes posting grouping without moving customer money. Date correction preserves the earlier knowledge history through additional financial facts.

## The Flow

```mermaid
flowchart TD
  h0["Batch reassignment"]
  h1["Batch reassignment"]
  h0 --> h1
  h2["Detail edits"]
  h1 --> h2
```

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

The unresolved matters are recorded in the module findings; this workflow does not establish additional product approval.
