Bulk Activity Service
Component Detail
Service Layer
high complexity
backend
2
Dependencies
1
Dependents
2
Entities
0
Integrations
Description
Backend API handler that accepts a batch registration payload of shared activity fields plus an array of peer mentor user IDs. Validates cross-tenant access, enforces the batch size cap, and expands the batch into individual activity rows inside a single database transaction with full rollback on any failure.
bulk-activity-service
Responsibilities
- Validate that every submitted peer mentor ID belongs to the coordinator's organization to prevent cross-tenant leakage
- Enforce a 100-participant batch size cap and return a structured error with a clear message if exceeded
- Expand the batch payload into individual activity records within a single database transaction so partial failures roll back cleanly
- Return per-record success or error results in the batch response for client-side feedback
- Support the mutation outbox by accepting the bulk payload as a single queued item and handling per-record error responses from the sync service
Interfaces
POST /api/v1/activities/bulk
validateBatchPayload(payload)
validateParticipantOrganization(participantIds, coordinatorId)
expandBatch(sharedFields, participantIds)
createActivitiesTransaction(activityRecords)
buildBatchResult(results)
Relationships
Dependencies (2)
Components this component depends on
Related Data Entities (2)
Data entities managed by this component