forked from Yara724/api
the serial letter normalization added to the code to normalize the Heh , Ya , Kaf and etc to the correct character
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
import { SandHubDbService } from "src/sand-hub/entity/db-service/sand-hub.db.service";
|
||||
import { SandHubModel } from "src/sand-hub/entity/schema/sand-hub.schema";
|
||||
import { ExternalInquirySettingsService } from "src/client/external-inquiry-settings.service";
|
||||
import { PlateNormalizerService } from "src/utils/plate-normalizer/plate-normalizer.service";
|
||||
import type { ExternalInquiryType } from "src/common/types/external-inquiry.types";
|
||||
import type { MockInquiryCompanyContext } from "src/common/types/external-inquiry.types";
|
||||
import { SandHubDetailDto, SandHubInquiryOptions } from "./dto/sand-hub.dto";
|
||||
@@ -39,6 +40,7 @@ export class SandHubService {
|
||||
private readonly httpService: HttpService,
|
||||
private readonly sandHubDbService: SandHubDbService,
|
||||
private readonly externalInquirySettings: ExternalInquirySettingsService,
|
||||
private readonly plateNormalizer: PlateNormalizerService,
|
||||
) {}
|
||||
|
||||
private clientRefFrom(options?: SandHubInquiryOptions): string | undefined {
|
||||
@@ -162,8 +164,8 @@ export class SandHubService {
|
||||
nationalCodeOfInsurer: nationalCode,
|
||||
plate: {
|
||||
leftDigits: Number(payload.part1 ?? payload.leftTwoDigits ?? 16),
|
||||
centerAlphabet: String(
|
||||
payload.part2 ?? payload.serialLetter ?? "12",
|
||||
centerAlphabet: this.plateNormalizer.normalizePlateText(
|
||||
String(payload.part2 ?? payload.serialLetter ?? "12"),
|
||||
),
|
||||
centerDigits: Number(payload.part3 ?? payload.threeDigits ?? 498),
|
||||
ir: Number(payload.part4 ?? payload.rightTwoDigits ?? 60),
|
||||
|
||||
Reference in New Issue
Block a user