Source:
apps/erp-backend/src/bank-core/bank-movement/bank-movement.controller.ts. Domain terms come from apps/erp-backend/CONTEXT.md; the internal-transfer model is fixed by ADR 0025.All routes are nested under a Bank Account, not directly under the Entity. The base path is
/api/entities/:entityId/bank-accounts/:bankAccountId/movements. :movementId is a UUID.GET /movements
List Movements on a Bank Account. Returns bankMovementsPageSchema, a paginated { rows, nextCursor } object.
- Query:
ListBankMovementsQueryDto(greplist-bank-movements-query.dto.tsfor the exact filters, which include a cursor, page size, date range, and status filter).
GET /movements/:movementId/match-candidates
List Invoices and Ledger Entries that could plausibly settle this Movement (per Sintropix’s matching heuristics).
- Response:
bankMovementMatchCandidatesSchema.
GET /movements/:movementId/reconciliation
Return the Movement’s current booking or match state and the Ledger Lines that discharge it.
- Response:
bankMovementReconciliationSchema.
GET /movements/:movementId/erwin-context
Compact reconciliation context tailored for Erwin (the AI assistant) as it decides how to book a Movement. Present in the public surface because Erwin authenticates as the User via a Key Lease.
- Response:
erwinBankMovementContextSchema.
POST /movements
Create a manual Bank Movement on the account. Requires x-audit-actor for API-key callers.
- Body:
CreateBankMovementDto. - Response:
createBankMovementResultSchema.
PATCH /movements/:movementId
Edit an existing Movement (for example, correct a description or counterparty).
- Body:
UpdateBankMovementDto. - Response:
updateBankMovementResultSchema.
DELETE /movements/:movementId
Remove a Movement. Booked or matched Movements are refused; unbook or unmatch first.
- Response:
deleteBankMovementResultSchema.
POST /movements/:movementId/book
Book a Movement to a Ledger Entry. Sintropix generates the balanced Ledger Entry from the Movement plus the booking instructions in the body.
- Body:
BookBankMovementDto(target account, dimension values, partner, memo). - Response:
reconcileBankMovementResultSchema.
POST /movements/:movementId/match
Match a Movement to an existing document (Invoice or Ledger Entry) rather than booking a new entry. Sintropix records an Allocation between the Movement’s counter-account line and the matched document’s open-item line.
- Body:
MatchBankMovementDto. - Response:
reconcileBankMovementResultSchema.
POST /movements/:movementId/transfer
Mark this Movement as one leg of an Internal Transfer. Per ADR 0025, an Internal Transfer is a composed act rather than a first-class aggregate, so both legs must be identified before the transfer is booked.
- Body:
TransferBankMovementDto. - Response:
bankMovementWithStatusSchema.