DocumentRepository

DocumentRepository is the repository for using simple CRUD operations in Document. The implementations of this interface shouldn't control order (sorting) or oder configurations, those need to be passed as parameters.

Functions

Link copied to clipboard
abstract suspend fun deleteByUserId(userId: String)

Deleted all the documents of a User

Link copied to clipboard
abstract suspend fun deleteDocument(document: Document)
Link copied to clipboard
abstract suspend fun deleteDocumentByIds(ids: Set<String>)
Link copied to clipboard
abstract suspend fun loadDocumentById(id: String): Document?
Link copied to clipboard
abstract suspend fun loadDocumentsForUser(orderBy: String, userId: String): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsWithContentByIds(ids: List<String>, orderBy: String): List<Document>
Link copied to clipboard
abstract suspend fun moveDocumentsToNewUser(oldUserId: String, newUserId: String)

Moves all tickets from one user to another. Use this we would like to pass all the data of documents to another user. When the offline user becomes a new online user, all documents should be moved to the new online user.

Link copied to clipboard
abstract suspend override fun saveDocument(document: Document)

Saves document. Both with content and meta data.

Link copied to clipboard
abstract suspend override fun saveDocumentMetadata(document: Document)

Saves the document meta data. Use this was updating the content of the document is not necessary. This is a much lighter operation than saveDocument, because it is not necessary to save/update all lines of content.

Link copied to clipboard
abstract suspend override fun saveStoryStep(storyStep: StoryStep, position: Int, documentId: String)
Link copied to clipboard
abstract suspend fun updateStoryStep(storyStep: StoryStep, position: Int, documentId: String)