Package eu.yeger.koffee.utility

Functions

combineAsFilter
Link copied to clipboard
Creates a filter from a list of Bsons with AND semantics.
fun List<Bson>.combineAsFilter(): Bson
combineAsUpdate
Link copied to clipboard
Combines a list of Bsons with update semantics.
fun List<Bson>.combineAsUpdate(): Bson
encodeBase64
Link copied to clipboard
Encodes a ByteArray as Base64.
fun ByteArray.encodeBase64(): String
hasTwoDecimalPlaces
Link copied to clipboard
Checks if a Double has no more than two relevant decimal places.
fun Double.hasTwoDecimalPlaces(): Boolean
incrementBy
Link copied to clipboard
Creates an update Bson for incrementing numbers.
infix fun KProperty<Number??>.incrementBy(amount: Number): Bson
loadDockerSecrets
Link copied to clipboard
Loads Docker secrets from the file system.
fun loadDockerSecrets(fileName: String?): Map<String, String>
push
Link copied to clipboard
Creates an update Bson for pushing elements.
infix fun <T : Any?> KProperty<Iterable<T>??>.push(element: T): Bson
readDockerSecret
Link copied to clipboard
Reads a single Docker secret with the given name.
fun readDockerSecret(name: String): String?
respondWithResult
Link copied to clipboard
Responds to a call using the Result and its status code. Uses the data for Result.Successes and error for Result.Failures.
suspend fun ApplicationCall.respondWithResult(result: Result<*>)
to
Link copied to clipboard
Creates an update Bson.
infix fun <T : Any?> KProperty<T>.to(newValue: T): Bson
updateById
Link copied to clipboard
Updates an Entity by its id.
suspend fun <T : Entity> CoroutineCollection<T>.updateById(id: String, update: Bson): T?
upsert
Link copied to clipboard
Upserts an Entity.
suspend fun <T : Entity> CoroutineCollection<T>.upsert(entity: T, options: UpdateOptions): UpdateResult
validateItemDoesNotExist
Link copied to clipboard
Validates that the Item with the given id does not exist in the ItemRepository.
suspend fun ItemRepository.validateItemDoesNotExist(item: Item): Result<Item>
validateItemExists
Link copied to clipboard
Validates that the Item with the given id exists in the ItemRepository.
suspend fun ItemRepository.validateItemExists(itemId: String): Result<Item>
validateUserDoesNotExist
Link copied to clipboard
Validates that the User with the given id does not exist in the UserRepository.
suspend fun UserRepository.validateUserDoesNotExist(partialUser: PartialUser): Result<PartialUser>
validateUserExists
Link copied to clipboard
Validates that the User with the given id exists in the UserRepository.
suspend fun UserRepository.validateUserExists(userId: String): Result<User>

Properties

FUNDING_SUCCESSFUL
Link copied to clipboard
const val FUNDING_SUCCESSFUL: String
ID_OR_PASSWORD_INCORRECT
Link copied to clipboard
const val ID_OR_PASSWORD_INCORRECT: String
IMAGE_DELETED_SUCCESSFULLY
Link copied to clipboard
const val IMAGE_DELETED_SUCCESSFULLY: String
IMAGE_TOO_LARGE
Link copied to clipboard
const val IMAGE_TOO_LARGE: String
IMAGE_UPLOADED_SUCCESSFULLY
Link copied to clipboard
const val IMAGE_UPLOADED_SUCCESSFULLY: String
INVALID_FUNDING_AMOUNT
Link copied to clipboard
const val INVALID_FUNDING_AMOUNT: String
INVALID_ITEM_DATA
Link copied to clipboard
const val INVALID_ITEM_DATA: String
INVALID_PURCHASE_AMOUNT
Link copied to clipboard
const val INVALID_PURCHASE_AMOUNT: String
INVALID_USER_DATA
Link copied to clipboard
const val INVALID_USER_DATA: String
ITEM_DELETED_SUCCESSFULLY
Link copied to clipboard
const val ITEM_DELETED_SUCCESSFULLY: String
ITEM_UPDATED_SUCCESSFULLY
Link copied to clipboard
const val ITEM_UPDATED_SUCCESSFULLY: String
ITEM_WITH_THAT_ID_ALREADY_EXISTS
Link copied to clipboard
const val ITEM_WITH_THAT_ID_ALREADY_EXISTS: String
LAST_PURCHASE_ALREADY_REFUNDED
Link copied to clipboard
const val LAST_PURCHASE_ALREADY_REFUNDED: String
NO_ADMINISTRATOR_PRIVILEGES
Link copied to clipboard
const val NO_ADMINISTRATOR_PRIVILEGES: String
NO_IMAGE_FOR_THAT_USER_ID
Link copied to clipboard
const val NO_IMAGE_FOR_THAT_USER_ID: String
NO_ITEM_WITH_THAT_ID
Link copied to clipboard
const val NO_ITEM_WITH_THAT_ID: String
NO_REFUNDABLE_PURCHASE
Link copied to clipboard
const val NO_REFUNDABLE_PURCHASE: String
NO_USER_WITH_THAT_ID
Link copied to clipboard
const val NO_USER_WITH_THAT_ID: String
PURCHASE_SUCCESSFUL
Link copied to clipboard
const val PURCHASE_SUCCESSFUL: String
REFUND_EXPIRED
Link copied to clipboard
const val REFUND_EXPIRED: String
REFUND_NOT_POSSIBLE
Link copied to clipboard
const val REFUND_NOT_POSSIBLE: String
REFUND_SUCCESSFUL
Link copied to clipboard
const val REFUND_SUCCESSFUL: String
USER_DELETED_SUCCESSFULLY
Link copied to clipboard
const val USER_DELETED_SUCCESSFULLY: String
USER_UPDATED_SUCCESSFULLY
Link copied to clipboard
const val USER_UPDATED_SUCCESSFULLY: String
USER_WITH_THAT_ID_ALREADY_EXISTS
Link copied to clipboard
const val USER_WITH_THAT_ID_ALREADY_EXISTS: String