Service Layer high complexity backend
2
Dependencies
2
Dependents
1
Entities
0
Integrations

Description

Handles server-side creation of one activity record per selected peer mentor within a single atomic database transaction. Accepts a bulk payload containing shared activity metadata and an array of target user IDs, enforces duplicate detection per NHF requirements, and links each created record to the submitting coordinator and its respective peer mentor owner.

Feature: Bulk Registration

bulk-activity-service

Sources & reasoning

A dedicated bulk service is required to atomically fan out a single coordinator submission into N per-mentor activity rows. The atomic transaction requirement, duplicate detection (NHF), and organization-scoped mentor validation go well beyond the single-activity scope of the existing Activity Service.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Accept bulk payload (activity metadata + target user ID array) and create one activity row per user in a single transaction
  • Link each created activity to the coordinator as submitter and the respective peer mentor as owner
  • Run duplicate detection flagging date/type/peer-mentor combinations that already have a record
  • Return per-mentor creation results including any duplicate or validation warnings
  • Validate that all target user IDs belong to the coordinator's organization before processing

Interfaces

createBulkActivities(payload: BulkActivityPayload): Future<BulkActivityResult>
validateBulkPayload(payload: BulkActivityPayload): ValidationResult
detectDuplicates(mentorIds: List<String>, date: DateTime, typeId: String): Future<List<DuplicateWarning>>
getOrganizationMentors(organizationId: String): Future<List<PeerMentor>>

Relationships

Dependencies (2)

Components this component depends on

Dependents (2)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component