W166: List documents for an entity
Returns one parent's attachments, newest first. Triggered when an order detail page opens its documents section.
Steps
- List by entity. Call
Documents.listByEntity(entityType, entityId).
Returns
The Document rows, ordered by createdAt descending.
Business rules
- The org-scoped query returns only the caller's rows; an unknown parent yields an empty list rather than a 404 (same behavior the old nested lists had).
Errors
None.