Facilities

interface Facilities

Facilities feature — manage the facilities associated with the authenticated member.

This interface provides operations to retrieve, update, delete, monitor, and nominate facilities. Implementations connect to backend services and manage local persistence internally; developers interact only with these methods.

Capabilities

  • Get: retrieve all facilities for the current member.

  • Update: change verification status of a facility.

  • Delete: remove a facility from the member’s list.

  • Monitoring: start/stop monitoring facilities for presence and updates (leverages geofencing/proximity if available).

  • Nomination: submit a new facility for consideration and retrieve a list of past nominations.

Platform & threading

  • All functions are suspend and must be called from a coroutine.

  • Errors surface as Throwable and should be handled at call sites.

Typical flows

  • Initialization: call get to fetch facilities and display them in UI.

  • Status change: call update when a facility is verified or blacklisted.

  • Removal: call delete when a facility should no longer appear.

  • Real-time monitoring: call startMonitoring at login/onboarding, and stopMonitoring at logout or when presence tracking is no longer needed.

  • New facility suggestion: use nominateFacility to submit a new club. Check its status later by calling getNominatedFacilities.

Functions

Link copied to clipboard
abstract suspend fun delete(facilityId: Int): AFResult

Deletes a facility from the member’s list.

Link copied to clipboard
abstract suspend fun get(): List<Facility>

Retrieves the list of facilities associated with the current member.

Link copied to clipboard
Link copied to clipboard
abstract suspend fun isMonitoringActive(): Boolean
Link copied to clipboard
abstract suspend fun nominateFacility(clubName: String, address1: String, address2: String?, city: String, stateCode: String, zipCode: String, latitude: Double?, longitude: Double?, phoneNumber: String?, email: String?, managerName: String?, currentlyAMember: Boolean?, metadata: Map<String, String?>?): AFResult

Submits a new facility for nomination.

Link copied to clipboard
abstract suspend fun startMonitoring(): Boolean

Starts monitoring presence events for the member’s facilities.

Link copied to clipboard
abstract suspend fun stopMonitoring(): Boolean

Stops monitoring facilities.

Link copied to clipboard
abstract suspend fun update(facilityId: Int, verified: Boolean): AFResult

Updates the verification status of a facility.