forked from Shared/esg
23 lines
676 B
TypeScript
23 lines
676 B
TypeScript
import { InquiryType } from '../enums/inquiry-type.enum';
|
|
import { ProviderName } from '../enums/provider-name.enum';
|
|
|
|
/**
|
|
* Contract every external provider adapter must fulfill.
|
|
* Keeps orchestration logic decoupled from provider implementations (Strategy pattern).
|
|
*/
|
|
export interface InquiryProvider<TRequest = unknown, TResponse = unknown> {
|
|
readonly name: ProviderName;
|
|
readonly supportedInquiryTypes: InquiryType[];
|
|
isEnabled(): boolean;
|
|
execute(
|
|
inquiryType: InquiryType,
|
|
payload: TRequest,
|
|
context: ProviderExecutionContext,
|
|
): Promise<TResponse>;
|
|
}
|
|
|
|
export interface ProviderExecutionContext {
|
|
requestId: string;
|
|
trackingCode: string;
|
|
}
|