UserRepository

Repository for Users.

Author

Jan Müller
interface UserRepository

Functions

addProfileImage
Link copied to clipboard
Adds a ProfileImage to a User from the repository.
abstract suspend fun addProfileImage(id: String, profileImage: ProfileImage)
addTransaction
Link copied to clipboard
Adds a Transaction to a User from the repository.
abstract suspend fun addTransaction(id: String, transaction: Transaction)
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getAll
Link copied to clipboard
Retrieves all Users from the repository.
abstract suspend fun getAll(): List<User>
getById
Link copied to clipboard
Retrieves a User from the repository.
abstract suspend fun getById(id: String): User?
hashCode
Link copied to clipboard
open override fun hashCode(): Int
hasUserWithId
Link copied to clipboard
Checks if the repository contains a specific User.
abstract suspend fun hasUserWithId(id: String): Boolean
insert
Link copied to clipboard
Inserts a User into the repository.
abstract suspend fun insert(user: User)
removeById
Link copied to clipboard
Removes a User from the repository.
abstract suspend fun removeById(id: String)
removeProfileImage
Link copied to clipboard
Removes the ProfileImage of a User from the repository.
abstract suspend fun removeProfileImage(id: String)
toString
Link copied to clipboard
open override fun toString(): String
update
Link copied to clipboard
Updates a User from the repository.
abstract suspend fun update(id: String, name: String, isAdmin: Boolean, password: String?)

Inheritors

MongoUserRepository
Link copied to clipboard

Extensions

validateUserDoesNotExist
Link copied to clipboard
Validates that the User with the given id does not exist in the UserRepository.
suspend fun UserRepository.validateUserDoesNotExist(partialUser: PartialUser): Result<PartialUser>
validateUserExists
Link copied to clipboard
Validates that the User with the given id exists in the UserRepository.
suspend fun UserRepository.validateUserExists(userId: String): Result<User>