Data Layer medium complexity backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Handles batch persistence of activity records produced by the bulk registration fan-out. It wraps individual activity inserts in a single database transaction to ensure all-or-nothing consistency and exposes query helpers used by the service layer.

Feature: Bulk Registration

bulk-activity-repository

Sources & reasoning

Line 84 explicitly describes bulk registration as logging collectively for fixed activities with a weekly group training example, and notes Blindeforbundet deprioritizes it - justifying should_have rather than must_have. Line 346 places it in Fase 2 (v1.0 by ordinal mapping). Dependency on coordinator-proxy-reporting is intentional: bulk is a superset of proxy attribution and reuses its authorization and outbox mechanics.

  • enten enkeltvis eller samlet for faste aktiviteter (f.eks. ukentlig trening med mange deltakere). Blindeforbundet bruker ikke proxy-rapportering på samme måte og prioriterer dette lavt.
  • Pausefunksjon og bulkregistrering for koordinatorer

Responsibilities

  • Insert multiple activity records atomically within a single transaction
  • Roll back the entire batch if any individual insert fails
  • Provide a query method to retrieve all activity records for a given bulk submission batch ID
  • Expose a count helper for activity records per mentor within a date range

Interfaces

insertBatch(records: NewActivityRecord[]): Promise<ActivityRecord[]>
getByBatchId(batchId: string): Promise<ActivityRecord[]>
countByMentorAndRange(mentorId: string, from: Date, to: Date): Promise<number>

Related Data Entities (1)

Data entities managed by this component