forked from Shared/esg
initial commit
This commit is contained in:
22
src/common/interfaces/inquiry-provider.interface.ts
Normal file
22
src/common/interfaces/inquiry-provider.interface.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user