UserUseCase

io.letsstreamit.services.profile.application.usecases.UserUseCase
class UserUseCase(userService: UserService)

UserUseCase responsible for handling user related use cases

Value parameters

userService

UserService to interact with the database

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addUser(user: User): Future[Either[Exception, String]]

addUser adds a user to the database

addUser adds a user to the database

Value parameters

user

user to be added

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise

def addVideo(email: String, videoId: String): Future[Either[Exception, String]]

addVideo adds a video to the user's list of videos

addVideo adds a video to the user's list of videos

Value parameters

email

email of the user

videoId

id of the video

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise

def fetchUser(email: String): Future[Option[User]]

fetchUser fetches a user by email

fetchUser fetches a user by email

Value parameters

email

email of the user

Attributes

Returns

Future[Option[User]] user if found, None otherwise

def updateUser(user: User): Future[Either[Exception, String]]

updateUser updates a user in the database

updateUser updates a user in the database

Value parameters

user

user to be updated

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise