BulkUserActionService
Component Detail
Description
Backend service that receives bulk operation requests and executes them transactionally against the user store. It processes deactivation, role assignment, and org-unit transfer operations across all selected user records and produces a per-record result manifest so callers can surface partial failures. Every affected record is written to the audit trail regardless of individual operation outcome.
bulk-user-action-service
Sources & reasoning
Blueprint tags bulk-actions [v1.0], placing it after MVP. NHF's 1,400 local chapters (line 109) is the primary driver - individual user management at that scale is operationally impractical, motivating batch operations as a near-term follow-on to core User CRUD. No source doc phase evidence places it at MVP; the blueprint's v1.0 tag is authoritative. Target release is v1.0.
-
docs/source/likeperson.md · line 109Bredest organisasjonsstruktur: 12 landsforeninger, 9 regioner, 1 400 lokallag - aktivitetsfordeling mellom ledd må støttes.
-
docs/source/likeperson.md · line 188Coordinators and Peer Mentors are managed inside the admin portal (invitations, role assignment, deactivation) but never log in to it
Responsibilities
- Validate the incoming user ID list and operation parameters before execution
- Execute deactivate, assign-role, and move-org-unit operations within a database transaction
- Collect per-record success/failure results and return a structured result manifest
- Roll back the transaction on unrecoverable errors while preserving partial-success manifests where supported
- Write an audit log entry for every affected record including the actor, timestamp, and operation type
Interfaces
bulkDeactivate(userIds: string[], actorId: string): BulkResultManifest
bulkAssignRole(userIds: string[], roleId: string, actorId: string): BulkResultManifest
bulkMoveOrgUnit(userIds: string[], targetOrgUnitId: string, actorId: string): BulkResultManifest
validateBulkRequest(userIds: string[], operation: BulkActionType): ValidationResult
Related Data Entities (2)
Data entities managed by this component