feat(#10706): add bulk operation document model#11222
Open
vikrantwiz02 wants to merge 2 commits into
Open
Conversation
Introduce the @medic/bulk-operations shared library holding the document model that the bulk operation framework shares across delete, move and merge: the log document (medic-logs) read by the polling endpoint, and the per-action documents (medic-sentinel) that Sentinel processes in batches. buildBulkOperation assembles both from per-action operation lists. The per-item params live in a base64 json attachment so advancing an action's cursor does not rewrite the whole list.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
First piece of the bulk operation framework from the #10706 design: the shared document model that delete, move and merge all build on.
Adds the
@medic/bulk-operationsshared library with:archive,set-contact,delete-user), statuses, and document id prefixesbuildBulkOperation(actionOperations, date), which builds the log document (medic-logs, read by the polling endpoint) and one action document per action type (medic-sentinel, processed by Sentinel in batches), cross-linked both waysoperationsattachment, so advancing an action's cursor later does not rewrite the whole listNo dependency on the archiving work, so it can land on its own. The queue helper that writes these docs and the
GET /api/v1/bulk-operations/{id}polling endpoint follow next.Part of #10706
Code review checklist
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.