Files
esg/src/common/interfaces/inquiry-provider.interface.ts
2026-06-09 14:07:37 +03:30

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;
}