Added car by motor

This commit is contained in:
SepehrYahyaee
2026-09-29 16:31:40 +03:30
parent 83c5810399
commit 36deb87582
14 changed files with 471 additions and 36 deletions
@@ -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