Source:
apps/erp-backend/src/ledger-core/reconciliation/reconciliation.controller.ts.GET /api/entities/:entityId/ledger/allocations
List Allocations for a specific Ledger Entry Line. Returns allreconciliationAllocationSchema rows where either the debit or credit side matches the given line.
- Path param:
entityId(UUID) - Query param:
lineId(UUID, required) - Success response: Array of
reconciliationAllocationSchema - Status: 200
POST /api/entities/:entityId/ledger/allocations
Create a single Allocation between two lines. The caller supplies the idempotency id. The debit line must be on the debit side, the credit line on the credit side, both must belong to the same Open-Item Account, and the amount must not exceed either line’s open amount.- Path param:
entityId(UUID) - Body:
CreateReconciliationAllocationDto(fromcreateReconciliationAllocationSchema)
- Success response:
reconciliationAllocationSchema - Status: 201
DELETE /api/entities/:entityId/ledger/allocations/:allocationId
Delete an Allocation. This restores the open amounts of the two lines it settled.- Path params:
entityId(UUID),allocationId(UUID) - Success response:
reconciliationAllocationSchema(the deleted allocation) - Status: 200
POST /api/entities/:entityId/ledger/allocations/match
Auto-match a selection of Open-Item lines. The server splits the selection by side, greedily decomposes into debit/credit pairs, and creates every Allocation in one transaction. The selection must contain at least two lines, at least one debit and one credit, and all lines must belong to the same Open-Item Account.- Path param:
entityId(UUID) - Body:
MatchLinesDto(frommatchLinesSchema)
- Success response:
matchLinesResultSchema—{ allocations, settledLines, openTotal } - Status: 201