Package eu.yeger.koffee.model.dto

Types

Credentials
Link copied to clipboard
Login-credentials.
class Credentials(id: String,password: String) : Credential
Funding
Link copied to clipboard
DTO class for funding.
data class Funding(amount: Double)
PartialUser
Link copied to clipboard
DTO class for creating and updating Users.
data class PartialUser(id: String,name: String,isAdmin: Boolean,password: String?)
Purchase
Link copied to clipboard
DTO class for purchases.
data class Purchase(itemId: String,amount: Int)
Result
Link copied to clipboard
Functional Result class with HTTP status information.
sealed class Result<T : Any>
Token
Link copied to clipboard
DTO class for JWTs.
data class Token(token: String,expiration: Long)
UserListEntry
Link copied to clipboard
DTO class for metadata of Users.
data class UserListEntry(id: String,name: String)
UserProfile
Link copied to clipboard
DTO class for metadata and balance of Users.
data class UserProfile(id: String,name: String,balance: Double)

Functions

andThen
Link copied to clipboard
Transforms the data of Results if they are Result.Successes.
suspend fun <T : Any, U : Any> Result<T>.andThen(transformation: SuspendFunction1<T, Result<U>>): Result<U>
asDomainUser
Link copied to clipboard
Extension method for turning PartialUsers into Users without Transactions.
fun PartialUser.asDomainUser(profileImage: ProfileImage?): User
asProfile
Link copied to clipboard
Extension method for turning Users into UserProfiles by extracting metadata and calculating their balances.
fun User.asProfile(): UserProfile
asUserListEntry
Link copied to clipboard
Extension method for turning a User into a UserListEntry by extracting its metadata.
fun User.asUserListEntry(): UserListEntry
map
Link copied to clipboard
Transforms the data of Results if they are Result.Successes.
suspend fun <T : Any, U : Any> Result<T>.map(transformation: SuspendFunction1<T, U>): Result<U>
mapFailureStatus
Link copied to clipboard
Transforms the failure status of Results if they are Result.Failures.
suspend fun <T : Any> Result<T>.mapFailureStatus(transformation: SuspendFunction1<HttpStatusCode, HttpStatusCode>): Result<T>
withResult
Link copied to clipboard
Consumes the data of Results if they are Result.Successes.
suspend fun <T : Any> Result<T>.withResult(consumer: SuspendFunction1<T, Unit>): Result<T>