getAttachmentsGroupedByDate

suspend fun getAttachmentsGroupedByDate(module: ZuperModule, moduleUid: String, page: Int, pageSize: Int, filters: ZyncAttachmentFilters? = null): AttachmentGroupResult

Get paginated attachments grouped by date with simple result-based API. Client handles loading states externally.

This API provides immediate results:

  • Returns cached data grouped by date immediately if available

  • Performs sync and returns Success/Error result with grouped data

  • Background delta sync for subsequent calls

The grouping follows the format:

  • group_label: Human-readable date (e.g., "Thursday, 19 June 2025")

  • date: ISO date string (YYYY-MM-DD)

  • attachments: List of attachments for that date, sorted newest first

Return

AttachmentGroupResult with success/error state and grouped data

Parameters

module

Module to filter by (e.g., ZuperModule.JOB)

moduleUid

UID of the module instance

page

Page number (1-based)

pageSize

Number of items per page

filters

Optional filters for date range and media type