UserController

class UserController(val userRepository: UserRepository, val deviceId: String)

Controller for user-related operations.

Constructors

Link copied to clipboard
constructor(userRepository: UserRepository, deviceId: String)

Properties

Link copied to clipboard

The current user, or null if not found.

Link copied to clipboard

The device ID of the user.

Link copied to clipboard
val user: User

The signed-in user; throws if none exists.

Link copied to clipboard

The repository for users.

Link copied to clipboard

Whether user data has finished loading.

Functions

Link copied to clipboard
suspend fun becomeOwner(): Boolean

Makes the user a campsite owner. An entrant is converted to a CampsiteOwner. Does not affect if user is owner or admin roles.

Link copied to clipboard
suspend fun createEntrant(name: String, email: String, phone: String): Boolean

Creates an entrant profile if none exists.

Link copied to clipboard
suspend fun setAllowNotifications(allow: Boolean)

Turns notifications on or off for the signed-in user (US 01.10.01).

Link copied to clipboard
suspend fun updateEntrant(name: String, email: String, phone: String): Boolean

Updates the current user's profile information.