MemberActivityEvent

sealed class MemberActivityEvent

A discrete change to the member's calendar / activities feed.

Subscribe via com.advantahealth.api.activities.Activities.activityEvents (Kotlin coroutines) or com.advantahealth.api.activities.Activities.subscribeToActivityEvents (callback bridge for Swift). Use these events as a "refresh now" signal — every emission corresponds to a server-confirmed change that actually altered what the Mobile API will return for com.advantahealth.api.activities.Activities.get.

Duplicates are filtered out. If a submission is rejected as a duplicate (e.g. a selfie for a date that already has one, a self-report on a date that already exists, an automatic visit the server collapses into an existing entry), no event fires — because the calendar didn't change. If the result is a 2xx network failure for any other business-validation reason (status == false), no event fires either, for the same reason.

Offline submissions are deferred. A submission queued to the offline outbox (AFResult.queued == true) does NOT fire an event immediately, because the calendar on the server hasn't changed yet. The event fires later when the outbox flush actually delivers the submission to the server.

See SharedFlow semantics: replay = 0, so a subscriber that attaches after an event has fired does NOT receive that event on attach. This avoids spurious refreshes on screen revisit. Pair this with com.advantahealth.api.activities.Activities.get to fetch the current month state when the screen first opens.

Inheritors

Types

Link copied to clipboard

A member visit was accepted by the backend and appears on the calendar. Source: a geofence-driven automatic visit, or a direct call to com.advantahealth.api.activities.Activities.submitAutomaticVisit that was delivered and acknowledged by the server.

Link copied to clipboard

A member visit was removed from the calendar via com.advantahealth.api.activities.Activities.deleteAutomaticVisit.

Link copied to clipboard

A FitAtHome selfie was added via com.advantahealth.api.fitathome.FitAtHome.submitSelfie and confirmed by the server. Duplicate submissions (server rejects with status == false) do not fire this event.

Link copied to clipboard
data class SelfieRemoved(val date: String) : MemberActivityEvent

A FitAtHome selfie was removed via com.advantahealth.api.fitathome.FitAtHome.deleteSelfie.

Link copied to clipboard

A self-report was added via com.advantahealth.api.selfreport.SelfReport.submit and confirmed by the server.

Link copied to clipboard
Link copied to clipboard
data class StepsAdded(val jobId: String?) : MemberActivityEvent

SmartWalking steps were promoted by the backend and are now queryable on the calendar. Fires once per successful sync cycle, when com.advantahealth.api.smartwalking.model.SmartWalkingEvent.SyncProcessed fires on the SmartWalking event stream.