Assignment Counter Service
Component Detail
Description
Server-side service responsible for incrementing the assignment delivery count when a peer mentor marks an assignment as contacted or completed, evaluating which honorarium threshold tier is currently active, and exposing the current count and threshold configuration as part of the session bootstrap response. Threshold tiers are read from organization_settings JSON config, enabling per-tenant customization without code changes.
assignment-counter-service
Sources & reasoning
Core business logic for this feature. The feature description mandates a server-authoritative counter incremented on delivery status changes, threshold evaluation against org-configurable tiers, and surface of results in both the mobile bootstrap response and admin payroll overview. All of this belongs in a single cohesive service to prevent client-side manipulation.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Increment completed-assignment counter in assignment_deliveries on status transition
- Read threshold configuration (e.g. tier at 3, tier at 15) from organization_settings JSON block
- Evaluate current tier and next threshold for the requesting peer mentor per accounting period
- Expose count and threshold summary in session bootstrap payload consumed by mobile clients
- Provide threshold crossing data for the admin portal reimbursement overview
Interfaces
recordDelivery(assignmentId, mentorId, status): DeliveryRecord
getThresholdStatus(mentorId, orgId, period): ThresholdStatus
getBootstrapPayload(mentorId, orgId): ThresholdBootstrapData
getThresholdCrossings(orgId, period): MentorThresholdSummary[]
Relationships
Related Data Entities (2)
Data entities managed by this component