Assignment Count Repository
Component Detail
Data Layer
low complexity
backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations
Description
Data access layer that maintains a denormalized assignment count field per peer mentor, updated by Supabase database triggers on inserts to the assignments table. Provides efficient count reads without expensive aggregate queries and exposes methods to query honorarium records and milestone history.
assignment-count-repository
Responsibilities
- Read current denormalized assignment count for a peer mentor
- Query honorarium milestone records for a mentor
- Persist new honorarium threshold crossing records
- Support count invalidation when assignments are deleted or voided
Interfaces
getAssignmentCount(mentorId)
getHonorariumRecords(mentorId)
saveHonorariumRecord(record)
getCountByOrganization(organizationId)
resetCount(mentorId)
getMilestoneHistory(mentorId)
bulkGetCounts(mentorIds)
Related Data Entities (3)
Data entities managed by this component