Growth & Care Logging

Two logs per baby: growth — height and weight measurements over time — and activities — diaper changes, feeding sessions and formula, each with the fields that matter for its type (diaperType, durationMinutes, quantityOz, side for nursing). Activity logs are paged and can be filtered by baby, type and time range. The ids of deleted activities stay retrievable so an offline cache can be pruned.

All calls are on Factory.babyService.

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


Log Baby Growth

To log a baby’s growth record, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • request (required): Contains baby growth information.
Factory.babyService.logBabyGrowth(
        spaceId: String,
        babyId: String,
        request: LogBabyGrowthRequest
    ) -> IVPublisher<BabyGrowthEntry>

List Baby Growth

To fetch all growth records associated with a baby, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • limit (required): Maximum number of records to return.
  • skip (required): Number of records to skip.
Factory.babyService.listBabyGrowth(
        spaceId: String,
        babyId: String,
        limit: Int,
        skip: Int
    ) -> IVPublisher<ListBabyGrowthResponse>

Log Baby Activities

To log one or more baby activities, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • request (required): Contains baby activity information.
Factory.babyService.logActivity(
        spaceId: String,
        babyId: String,
        request: LogMultipleBabyActivityRequest
    ) -> IVPublisher<[BabyActivityLogModel]>

List Baby Activities

To fetch baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyIds (optional): Filter by one or more baby IDs.
  • type (optional): Filter by activity type(s).
  • from (optional): Start of the time range (epoch).
  • to (optional): End of the time range (epoch).
  • limit (required): Maximum number of records to return.
  • skip (required): Number of records to skip.
Factory.babyService.listActivities(
        spaceId: String,
        babyIds: [String]?,
        type: [String]?,
        from: Int64?,
        to: Int64?,
        limit: Int,
        skip: Int
    ) -> IVPublisher<ListBabyActivitiesResponse>

Delete Baby Activities

To delete one or more baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
  • request (required): Contains the activity IDs to delete.
Factory.babyService.deleteActivities(
        spaceId: String,
        request: DeleteBabyActivitiesRequest
    ) -> IVPublisher<Void>

Get Deleted Baby Activity Logs

To fetch all deleted baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
Factory.babyService.getDeletedBabyActivityLogs(
        spaceId: String
    ) -> IVPublisher<DeletedBabyActivityLogsModel>