Service Layer high complexity backend
1
Dependencies
0
Dependents
2
Entities
1
Integrations

Description

HLF-specific service that synchronizes peer mentor visibility on the public-facing chapter website via webhook or API call to the HLF Dynamics portal. Removes paused or expired-cert mentors from public listings and re-adds them when reinstated.

Feature: Peer Mentor Pause & Status Management

hlf-website-sync-service

Summaries

The HLF Website Sync Service protects the organization's public reputation by ensuring only qualified, active peer mentors appear on the chapter website. When a mentor's certification lapses or their status is paused, this service automatically removes them from public listings — preventing prospective clients from contacting unqualified individuals. Conversely, it restores visibility immediately upon reinstatement, protecting mentor livelihoods and reducing administrative overhead. This automation eliminates manual website updates that previously required coordinator intervention, reducing human error risk and the reputational damage of stale listings.

The service directly supports trust in HLF's peer mentorship program.

This is a high-complexity backend service with an external integration dependency on the HLF Dynamics portal, making it one of the riskier components in the delivery plan. Development requires coordinating with the HLF team to obtain API credentials and documentation for the Dynamics portal — an external dependency that can delay timelines if access is slow. The retry logic and error alerting paths add testing surface area requiring integration test coverage against a sandbox Dynamics environment. Plan for at least one sprint of buffer for API negotiation.

Deployment must include monitoring for sync failures with an on-call alert path before go-live.

This backend service wraps the dynamics-portal-client to orchestrate mentor visibility state changes triggered by business events (pause, resume, cert expiry). Core interfaces include syncMentorVisibility(), hideMentorFromWebsite(), and restoreMentorOnWebsite() — each issuing API calls via the portal client with built-in retry. logSyncEvent() persists every operation against peer_mentor_status for audit reconciliation. Implement with an outbox pattern or job queue to ensure at-least-once delivery semantics — a failed HTTP call must not silently drop the visibility change.

Error paths should raise alerts after N consecutive retries. The service is feature-scoped (not shared) so its contract can evolve independently of other consumers.

Responsibilities

  • Call Dynamics portal API to hide paused or expired-cert peer mentors from public website
  • Restore visibility in Dynamics portal when pause is lifted and certification is valid
  • Handle API errors with retry logic and alert on persistent failures
  • Log all sync operations for audit and reconciliation

Interfaces

syncMentorVisibility(mentorId, isVisible)
hideMentorFromWebsite(mentorId)
restoreMentorOnWebsite(mentorId)
checkSyncStatus(mentorId)
retryFailedSync(mentorId)
logSyncEvent(mentorId, action, success, errorDetail?)

Relationships

Dependencies (1)

Components this component depends on

Related Data Entities (2)

Data entities managed by this component

Used Integrations (1)

External integrations and APIs this component relies on

API Contract

View full contract →
REST /api/v1/website-sync 4 endpoints
POST /api/v1/website-sync/:mentorId/sync-visibility Sync a mentor's visibility state to the HLF website
POST /api/v1/website-sync/:mentorId/hide Hide a mentor's profile from the HLF website
POST /api/v1/website-sync/:mentorId/restore Restore a mentor's profile visibility on the HLF website
GET /api/v1/website-sync/:mentorId/status Check the current sync status for a mentor on the website