Infrastructure medium complexity backend
0
Dependencies
1
Dependents
1
Entities
1
Integrations

Description

HTTP client wrapper for the HLF Dynamics portal API, handling authentication, request formation, retry logic, and error mapping. Abstracts the Dynamics-specific API contract from business logic services so the integration boundary is clearly isolated.

Feature: Peer Mentor Pause & Status Management

dynamics-portal-client

Summaries

The Dynamics 365 Portal API Client is the integration bridge between the internal peer mentorship platform and HLF's public-facing chapter website management system. By encapsulating all Dynamics-specific communication in a single, isolated component, the organization can adapt to changes in HLF's portal API without disrupting the broader application. This architectural isolation reduces vendor lock-in risk and lowers the cost of future API updates. The client's built-in retry logic and error handling ensure that transient network issues do not result in mentors being incorrectly listed or hidden, protecting both the organization's reputation and the mentor's standing in the program.

This medium-complexity integration component is a key external dependency risk in the project. Delivery depends on obtaining valid Dynamics portal credentials and API documentation from HLF — initiate this request at project kickoff to avoid blocking the HLF Website Sync Service. A sandbox/staging Dynamics environment is essential for integration testing; confirm its availability before committing to the sprint schedule. The authentication flow (including credential refresh) and exponential backoff retry logic add non-trivial testing surface area.

Plan for an integration testing phase against the real sandbox before UAT. If the Dynamics API is unavailable or underdocumented, this component may require a mock/stub strategy to unblock dependent service development.

An HTTP client abstraction layer over the HLF Dynamics portal REST or webhook API, this component isolates the integration boundary so business logic services like HLF Website Sync Service never call Dynamics directly. authenticate() and refreshCredentials() manage the token lifecycle — implement proactive refresh before expiry rather than reactive refresh on 401 responses to avoid race conditions under load. post() and patch() are the primary write methods, both delegating error handling to handleError() which maps Dynamics-specific HTTP error codes to typed application exceptions. Implement exponential backoff with jitter for retry on 5xx and network errors; surface isHealthy() as a readiness probe for deployment health checks.

All outbound calls should be logged at debug level with sanitized payloads for troubleshooting.

Responsibilities

  • Authenticate with HLF Dynamics portal using configured credentials
  • Execute REST or webhook calls to update peer mentor website visibility
  • Implement exponential backoff retry for transient failures
  • Map Dynamics API error codes to application-level exceptions

Interfaces

authenticate()
post(endpoint, payload)
patch(endpoint, payload)
handleError(response)
refreshCredentials()
isHealthy()

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (1)

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/dynamics-portal 5 endpoints
POST /api/v1/dynamics-portal/authenticate Authenticate with the Dynamics 365 portal and obtain a session token
POST /api/v1/dynamics-portal/records Create a new record in Dynamics via POST
PUT /api/v1/dynamics-portal/records/:recordId Update an existing Dynamics record via PATCH
GET /api/v1/dynamics-portal/records/:recordId Retrieve a record from Dynamics
DELETE /api/v1/dynamics-portal/records/:recordId Delete a record from Dynamics