DocumentUploadManager
class DocumentUploadManager
Content copied to clipboard
Responsible for managing access to the DocumentUploadWorker and DraftDocumentDaoProxy. Used to start any document uploading required, managing the returned results and validation of documents.
All images passed into the worker are copied and stored separately in memory then the captured images. This is to allow the DocumentUploadManager and DocumentUploadWorker to work with their own version of the file, and the ability to compress if required before upload, without affecting outside usage.
Parameters
draftDocumentDaoProxy
DraftDocumentDaoProxy Dao proxy which interacts with the dao and document database are created
Types
Functions
saveAndUploadDocuments
Link copied to clipboard
suspend fun saveAndUploadDocuments(context: Context, documentsToUpload: List<DocumentToUpload>): List<Triple<Long?, DocumentToUpload, Boolean>>
Content copied to clipboard
Takes in a list of DocumentToUpload, generates entities from them and stores them into the database.
startPendingDraftDocumentsUpload
Link copied to clipboard
Will look into the local database and find all DraftDocumentEntity's that are in a DocumentStatus.INITIALIZED state or greater that qualify for uploading.