Data Layer low complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Data layer adapter for the assignment_status_tracking table. Records per-assignment milestone events (e.g. threshold reached at count 3 or 15) with user, organization, threshold count, label, and timestamp. Prevents duplicate inserts via unique constraint on (user_id, organization_id, threshold_count).

Feature: Assignment Threshold Tracking

assignment-status-tracking-table

Responsibilities

  • Insert milestone records when a threshold is crossed for a user in an organization
  • Check for existing milestone record to ensure idempotency
  • Query milestone history for a user within an organization for display in the widget
  • Support paginated queries of milestone events per organization for coordinator overview

Interfaces

insertMilestone(record: AssignmentStatusTrackingRecord) → Promise<void>
milestoneExists(userId: string, organizationId: string, thresholdCount: number) → Promise<boolean>
getMilestoneHistory(userId: string, organizationId: string) → Promise<AssignmentStatusTrackingRecord[]>
getOrganizationMilestones(organizationId: string, page: number, pageSize: number) → Promise<PaginatedResult<AssignmentStatusTrackingRecord>>