Add health check and retry logic and circuit breaker

This commit is contained in:
SepehrYahyaee
2026-09-28 17:01:53 +03:30
parent 22371f4a03
commit 03fa5e0f20
67 changed files with 3101 additions and 410 deletions
@@ -1,6 +1,7 @@
import { InquiryType } from '../enums/inquiry-type.enum';
import { ProviderName } from '../enums/provider-name.enum';
import { AttemptTrail } from '../helpers/provider-resilience.helper';
import type { OutboundRequestTrace } from '../helpers/http-client.helper';
/**
* Contract every external provider adapter must fulfill.
@@ -22,6 +23,10 @@ export interface ProviderExecutionContext {
trackingCode: string;
/** Absolute timestamp when the inquiry wall-clock budget expires. */
deadlineAt?: number;
/** Signal for cancelling the currently active provider attempt. */
signal?: AbortSignal;
/** Mutable trail of HTTP attempts for client summary + logs. */
attemptTrail?: AttemptTrail;
/** Sanitized outbound HTTP calls made during this inquiry, including retries. */
outboundRequests?: OutboundRequestTrace[];
}