iaso
iaso copied to clipboard
SLEEP-1337 Add support for mobile bulk uploads
In Trypelim, we have performance issues on the form uploads. To improve the performance of the uploads, we're grouping forms and org units into zip files (batches of 2000 forms) and upload these with only 1 API call per zip file.
This PR adds a job to process these bulk uploads:
- A new API endpoint
/api/mobile/bulkupload/that takes azip_file. This endpoint simply uploads the file to S3, launches an async job, and returns HTTP 204. - The process job creates a record in the
APIImportfor future reference (and to be able to tag ashas_problem) and processes all files in the zip in a db transaction.
Related JIRA tickets : https://bluesquare.atlassian.net/browse/SLEEP-1337
Self proofreading checklist
- ~~[ ] Did I use eslint and black formatters~~
- [x] Is my code clear enough and well documented
- ~~[ ] Are my typescript files well typed~~
- [ ] New translations have been added or updated if new strings have been introduced in the frontend
- [x] My migrations file are included
- [x] Are there enough tests
- [ ] Documentation has been included (for new feature)
@mathvdh assigning you for review, I think Martin is too busy at the moment