17 lines
493 B
Kotlin
17 lines
493 B
Kotlin
package be.simplenotes.domain.usecases.users.delete
|
|
|
|
import arrow.core.Either
|
|
import io.konform.validation.ValidationErrors
|
|
|
|
sealed class DeleteError {
|
|
object Unregistered : DeleteError()
|
|
object WrongPassword : DeleteError()
|
|
class InvalidForm(val validationErrors: ValidationErrors) : DeleteError()
|
|
}
|
|
|
|
data class DeleteForm(val username: String?, val password: String?, val checked: Boolean)
|
|
|
|
interface DeleteUseCase {
|
|
fun delete(form: DeleteForm): Either<DeleteError, Unit>
|
|
}
|