HLF Dynamics Sync Service
Component Detail
Description
Service responsible for synchronising peer mentor certification status changes with the external HLF Dynamics portal. On expiry or auto-pause events, sends a webhook to Dynamics to remove the peer mentor from public listings. On renewal, reinstates the peer mentor.
hlf-dynamics-sync-service
Summaries
The HLF Dynamics Sync Service ensures that the public-facing HLF Dynamics portal always reflects the accurate compliance status of peer mentors. When a mentor's certification expires or is auto-paused, this service immediately triggers removal from public listings, protecting prospective clients and the organisation's reputation from exposure to non-compliant mentors. Conversely, when a mentor renews, reinstatement is handled automatically without coordinator intervention. This bi-directional synchronisation eliminates manual portal updates, reduces the window of exposure to reputational risk, and ensures regulatory obligations tied to public listings are met consistently and at scale.
This service is medium complexity and represents a critical external integration dependency. Unlike internal components, its delivery timeline is partially constrained by HLF Dynamics API availability, documentation quality, and the responsiveness of the external team for authentication credential provisioning. A sandbox or staging Dynamics environment should be secured early to unblock development. Retry logic for transient Dynamics API failures must be specified and tested, as silent sync failures would leave the public portal in an incorrect state without alerting coordinators.
Logging and error surfacing to the coordinator dashboard are acceptance criteria that require coordination with the dashboard team.
The service exposes syncCertificationExpired(mentorId) and syncCertificationRenewed(mentorId) as the primary integration points, internally calling sendWebhook(eventType, payload) with appropriate Dynamics API payloads. getSyncStatus(mentorId) allows callers and the dashboard to query the last known sync outcome. With no declared internal dependencies, this service owns its own Dynamics API client, meaning it must manage authentication (likely OAuth2 or API key), token refresh, and HTTP retry logic internally. Implement exponential backoff with a configurable max-retry count.
All webhook dispatch attempts — success or failure — must be persisted to an audit log so coordinator dashboard queries have a reliable source of truth for sync state.
Responsibilities
- Send certification-expired webhook to Dynamics on auto-pause
- Send certification-renewed webhook to Dynamics on renewal
- Handle Dynamics API authentication and retry on transient failures
- Log sync events and surface errors to coordinator dashboard
Interfaces
syncCertificationExpired(mentorId)
syncCertificationRenewed(mentorId)
sendWebhook(eventType, payload)
getSyncStatus(mentorId)
Relationships
Related Data Entities (2)
Data entities managed by this component
Used Integrations (1)
External integrations and APIs this component relies on