forked from Shared/esg
Added car by motor
This commit is contained in:
@@ -22,6 +22,7 @@ import { AmitisProvider } from './amitis.provider';
|
||||
import {
|
||||
CentInsurCarProviderSupport,
|
||||
CarChassisPayload,
|
||||
CarMotorPayload,
|
||||
CarPlatePayload,
|
||||
} from '../shared/centinsur-car-provider.support';
|
||||
import {
|
||||
@@ -103,6 +104,7 @@ export class ParsianProvider extends BaseProvider<LegacyInquiryPayload, LegacyIn
|
||||
InquiryType.SHEBA,
|
||||
InquiryType.CAR_BY_PLATE,
|
||||
InquiryType.CAR_BY_CHASSIS,
|
||||
InquiryType.CAR_BY_MOTOR,
|
||||
InquiryType.THIRD_PARTY_CAR,
|
||||
InquiryType.POLICY_BY_CHASSIS,
|
||||
InquiryType.POLICY_BY_PLATE,
|
||||
@@ -137,6 +139,7 @@ export class ParsianProvider extends BaseProvider<LegacyInquiryPayload, LegacyIn
|
||||
this.hasSoapCredentials(policyByPlateConfig) ||
|
||||
this.hasSoapCredentials(policyByNationalCodeConfig) ||
|
||||
this.centInsurCarSupport.hasCarPolicyConfig(this.config, InquiryType.CAR_BY_PLATE) ||
|
||||
this.centInsurCarSupport.hasCarPolicyConfig(this.config, InquiryType.CAR_BY_MOTOR) ||
|
||||
this.centInsurCarSupport.hasCarPolicyConfig(this.config, InquiryType.THIRD_PARTY_CAR))
|
||||
);
|
||||
}
|
||||
@@ -178,6 +181,16 @@ export class ParsianProvider extends BaseProvider<LegacyInquiryPayload, LegacyIn
|
||||
);
|
||||
}
|
||||
|
||||
if (inquiryType === InquiryType.CAR_BY_MOTOR) {
|
||||
return this.centInsurCarSupport.inquireCarByMotor(
|
||||
this.config,
|
||||
payload as CarMotorPayload,
|
||||
(message, code, fallback, extras) =>
|
||||
this.formatProviderError(message, code, fallback, extras as never),
|
||||
context.signal,
|
||||
);
|
||||
}
|
||||
|
||||
if (inquiryType === InquiryType.THIRD_PARTY_CAR) {
|
||||
// Parsian third-party plate inquiries must use the one-factor plate
|
||||
// lookup. The national-code policy endpoint is not a substitute: it
|
||||
|
||||
Reference in New Issue
Block a user