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.

Inheritors

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 deleteDocumentByFolder(folderId: String)
Link copied to clipboard
abstract suspend fun deleteDocumentByIds(ids: Set<String>)
Link copied to clipboard
abstract suspend fun favoriteDocumentByIds(ids: Set<String>)
Link copied to clipboard
abstract suspend fun getLastUpdatedAt(): List<Document>
Link copied to clipboard
abstract suspend fun listenForDocumentInfoById(id: String): Flow<DocumentInfo?>
Link copied to clipboard
abstract suspend fun listenForDocumentsByParentId(parentId: String): Flow<Map<String, List<Document>>>
Link copied to clipboard
abstract suspend fun loadDocumentById(id: String): Document?
Link copied to clipboard
abstract suspend fun loadDocumentByIds(ids: List<String>): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsByParentId(parentId: String): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsForFolder(folderId: String): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsForUser(userId: String): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsForUserAfterTime(orderBy: String, userId: String, instant: Instant): List<Document>
Link copied to clipboard
abstract suspend fun loadDocumentsWithContentByIds(ids: List<String>, orderBy: String): List<Document>
Link copied to clipboard
abstract suspend fun loadFavDocumentsForUser(orderBy: String, userId: 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 fun moveToFolder(documentId: String, parentId: String)
Link copied to clipboard
abstract suspend fun refreshDocuments()
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 search(query: String): List<Document>
Link copied to clipboard
abstract suspend fun stopListeningForFoldersByParentId(parentId: String)
Link copied to clipboard
abstract suspend fun unFavoriteDocumentByIds(ids: Set<String>)
Link copied to clipboard
abstract suspend fun updateStoryStep(storyStep: StoryStep, position: Int, documentId: String)