class UserRepository
Part of login.
Repository responsible for managing all the domain related network requests. UserRepository is the only domain related repository because the User object is the central access point of the domain
Companion |
ReusableRepositorySingleton enables Singleton Pattern with params companion object Companion : ReusableRepositorySingleton<UserRepository, RepositoryParams> |
lending |
the list LendingObject the logged in user is sharing val lending: LiveData<List<LendingObject>> |
selectedLendObject |
val selectedLendObject: MutableLiveData<LendingObject> |
users |
all the users from the database val users: LiveData<List<User>> |
using |
the list LendingObject the logged in user is using val using: LiveData<List<LendingObject>> |
addLendObject |
Method that makes a network call to POST a new LendingObject to the user's lending list and on success stores it in the DB suspend fun addLendObject(: String, : String, : String, : String, : String): Unit |
refreshUsers |
Method that makes a network GET call to fetch the total list of User, starting with the logged in, User, ordered by User.distance and store it in the DB suspend fun refreshUsers(: String, : String): Unit |
removeLendObject |
Method that makes a network call to DELETE an existing LendingObject from the user's lending list and on success stores remove it from the DB suspend fun removeLendObject(: String, : String, : String): Unit |
resetData |
suspend fun resetData(): Unit |