fetchContracts

suspend fun fetchContracts(sortAndFilter: ZyncContractSortAndFilter, page: Int, pageSize: Int): GetContractsResult

Fetch paginated list of contracts with sorting and filtering.

This method implements an offline-first pagination approach:

  • Page 1: Returns cached data immediately with optional background sync

  • Page 2+: Fetches from API only, no caching

Return

GetContractsResult containing paginated contract list or error

Parameters

sortAndFilter

Sort and filter criteria for contracts

page

Page number (1-indexed)

pageSize

Number of contracts per page