Service Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Backend service that processes bulk deactivation and role reassignment requests against multiple user accounts. Operations over 100 records are queued as background jobs with status tracking so the UI remains responsive during large batches.

Feature: Bulk Actions

bulk-user-action-service

Sources & reasoning

Line 109 documents NHF's scale of 1,400 lokallag, making one-by-one user management impractical at that size. The blueprint marks this feature as v1.0, consistent with it building on the foundational user-crud and role-assignment MVP capabilities. It is not called out in the Phase 1 MVP prose, so phased to v1.0 per blueprint evidence rather than defaulting to MVP.

  • docs/source/likeperson.md · line 109
    **Bredest organisasjonsstruktur:** 12 landsforeninger, 9 regioner, 1 400 lokallag - aktivitetsfordeling mellom ledd må støttes.

Responsibilities

  • Validate that all provided user IDs exist and are eligible for the requested operation
  • Execute synchronous bulk deactivation or role reassignment for batches of up to 100 records
  • Enqueue background jobs for batches exceeding 100 records and return a job ID for progress polling
  • Emit progress and completion events consumable by the toolbar widget
  • Log each bulk operation with actor identity, affected IDs, and outcome for audit purposes

Interfaces

bulkDeactivate(userIds: string[], actorId: string): BulkOperationResult
bulkReassignRole(userIds: string[], newRoleId: string, actorId: string): BulkOperationResult
enqueueJob(operation: BulkOperation): string
getJobStatus(jobId: string): JobStatus

Related Data Entities (3)

Data entities managed by this component