Linked records
Link a To-do to a record by sending exactly one ofinvoiceId, bankMovementId, or ledgerEntryId when you create it. The record must belong to the same Entity. The link is set on creation and cannot be changed later.
When the linked record goes away, Sintropix keeps the To-do and clears its link, so it becomes stand-alone. This happens when you:
- Delete the Invoice or the Bank Movement.
- Unbook the Ledger Entry (its status becomes
deleted). - Cancel the Scheduled Entry (its status becomes
cancelled).
The To-do object
The link object
link.kind tells you which record the To-do points to. Each kind carries the fields you need to display the record and open it in the app.
GET /api/entities/:entityId/todos
List the To-dos of an Entity, open and completed, oldest first. Pass one link filter to list only the To-dos of that record. With no filter, the response holds every To-do of the Entity.
Query parameters
Send at most one filter. Sending two returns
400.
Response 200: an array of To-do objects.
POST /api/entities/:entityId/todos
Create a To-do. You supply the id, so a retried request with the same id returns 409 instead of creating a duplicate.
Body
Send at most one link id. Omit all three for a stand-alone To-do.
Response
201: the created To-do object, including link.
PATCH /api/entities/:entityId/todos/:todoId
Edit the text of a To-do, check it off, or reopen it. Send at least one field.
Body
Sintropix sets
completedAt for you. Checking off a To-do that is already completed keeps its original completedAt.
Response 200: the updated To-do object.
DELETE /api/entities/:entityId/todos/:todoId
Delete a To-do permanently.
Response 200: the deleted To-do object.
Errors
To-do domain errors carry acode and a params object in the body.

