Badge Criteria Integration
Component Detail
Description
Acts as the bridge between recruitment attribution events and the badge and recognition system. Evaluates recruitment milestones against badge criteria definitions and triggers badge award flows when thresholds are met.
badge-criteria-integration
Summaries
The Badge Criteria Integration component closes the loop between recruitment activity and recognition — it is what transforms a raw recruitment count into a tangible reward for peer mentors. By automatically evaluating whether a mentor has crossed a milestone threshold and triggering badge awards in real time, this component makes the programme's incentive structure feel immediate and fair, which is a well-established driver of sustained volunteer engagement. Because it is shared infrastructure that connects the recruitment feature to the broader achievement and recognition system, it multiplies the value of both — recruitment data feeds recognition outcomes, and recognition outcomes reinforce the behaviours that drive recruitment. This compounding effect is a key differentiator for programmes competing for volunteer time and energy.
As a shared component, the Badge Criteria Integration bridges two feature workstreams — the referral/recruitment feature and the achievement badges system — and therefore requires close coordination between the teams delivering both. This is a significant scheduling dependency: badge criteria definitions must be agreed and persisted in the badges system before this component can evaluate them, and the `referral-attribution-service` must be producing confirmed recruitment events before end-to-end badge award flows can be tested. Recommend a formal interface agreement between the two feature teams early in planning to prevent integration delays. The shared nature of this component also means that changes to the badge criteria schema or the attribution event format can have cross-feature impact, requiring regression testing on both sides.
This component acts as an event-driven subscriber and evaluator. It listens for confirmed recruitment events via `onRecruitmentConfirmed(mentorId, count)` — this can be implemented as a direct call from `referral-attribution-service.notifyBadgeService()` or as a message queue consumer depending on the infrastructure choices made for decoupling. `evaluateBadgeCriteria(mentorId)` fetches the current recruitment count from the attribution service and compares it against badge threshold definitions retrieved via `getRecruitmentBadgeDefinitions()`. Badge definitions should be treated as configuration data (fetched from the badges system's API or a shared database view) rather than hardcoded constants to allow threshold changes without a code deployment.
`triggerBadgeAward(mentorId, badgeId)` calls into the achievement badges system — ensure idempotency so that a duplicate recruitment event does not award the same badge twice.
Responsibilities
- Subscribe to confirmed recruitment events from attribution service
- Query badge criteria definitions for recruitment-related badges
- Evaluate whether mentor has crossed a badge threshold
- Trigger badge award in the achievement badges system
Interfaces
onRecruitmentConfirmed(mentorId, count)
evaluateBadgeCriteria(mentorId)
triggerBadgeAward(mentorId, badgeId)
getRecruitmentBadgeDefinitions()
Relationships
Related Data Entities (2)
Data entities managed by this component