Activity Summary & Insights

The summary is the raw activity record for a pet over a time range — filtered and sorted with the same QueryItem / SortItem used for events. The insight is the backend’s interpretation of it: trends and anomalies worth surfacing.

All calls are on Factory.petService.

Pre-requisite: The user has to be signed in to perform the following operations.


Get Pet Activity Summary

To fetch the pet activity summary, The following method can be used:

  • spaceId (required): The space ID of the user.
  • petId (required): The ID of the pet.
  • queryItems: [ .init(key: .from, value: .greaterThenOrEqual(value: “(fromEpoch)”)), .init(key: .date, value: .greaterThenOrEqual(value: eventsEndDate.string)) ]
  • sortItem: .init(ascending: [.date])
Factory.petService.getPetActivitySummary(
        spaceId: String, 
        petId: String, 
        queryItems: [QueryItem], 
        sortItem: SortItem?
    ) -> IVPublisher<PetActivityResponse>

Get Pet Activity Insight

To get pet activity insight, The following method can be used:

  • spaceId (required): The space ID of the user.
  • petId (required): The ID of the pet.
Factory.petService.getPetActivityInsight(
        spaceId: String, 
        petId: String, 
    ) -> IVPublisher<PetActivityInsightResponse>