ItemRepository

Repository for Items.

Author

Jan Müller
interface ItemRepository

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getAll
Link copied to clipboard
Retrieves all Items from the repository.
abstract suspend fun getAll(): List<Item>
getById
Link copied to clipboard
Retrieves an Item from the repository.
abstract suspend fun getById(id: String): Item?
hashCode
Link copied to clipboard
open override fun hashCode(): Int
hasItemWithId
Link copied to clipboard
Checks if the repository contains a specific Item.
abstract suspend fun hasItemWithId(id: String): Boolean
insert
Link copied to clipboard
Inserts an Item into the repository.
abstract suspend fun insert(item: Item)
removeById
Link copied to clipboard
Removes an Item from the repository.
abstract suspend fun removeById(id: String)
toString
Link copied to clipboard
open override fun toString(): String
updateAmount
Link copied to clipboard
Updates the amount of an Item from the repository.
abstract suspend fun updateAmount(id: String, change: Int)

Inheritors

MongoItemRepository
Link copied to clipboard

Extensions

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>