17 lines
525 B
Kotlin
17 lines
525 B
Kotlin
package be.simplenotes.domain.usecases.users.register
|
|
|
|
import arrow.core.Either
|
|
import be.simplenotes.domain.model.PersistedUser
|
|
import be.simplenotes.domain.usecases.users.login.LoginForm
|
|
import io.konform.validation.ValidationErrors
|
|
|
|
sealed class RegisterError
|
|
object UserExists : RegisterError()
|
|
class InvalidRegisterForm(val validationErrors: ValidationErrors) : RegisterError()
|
|
|
|
typealias RegisterForm = LoginForm
|
|
|
|
interface RegisterUseCase {
|
|
fun register(form: RegisterForm): Either<RegisterError, PersistedUser>
|
|
}
|