fix(licence): validate driving licence IDs and preserve verified captions

This commit is contained in:
SepehrYahyaee
2026-10-03 15:08:16 +03:30
parent b20250b4b3
commit d9a8ec4b2f
11 changed files with 319 additions and 7 deletions
+5 -2
View File
@@ -45,6 +45,7 @@ import {
VEHICLE_KINDS_REFRESH_MS,
} from "./vehicle-kind-search";
import { gregorianDateInIran } from "src/helpers/iran-datetime";
import { normalizeDrivingLicenceTypes, type DrivingLicenceType } from "./driving-licence-types";
type TejaratAccidentReasonRow = {
id: number;
@@ -188,8 +189,10 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
return await this.getClientRemoteLookup("dmg-pay-method");
}
async getDrivingLicenceTypes(): Promise<any> {
return await this.getClientRemoteLookup("driving-licence-types");
async getDrivingLicenceTypes(): Promise<DrivingLicenceType[]> {
return normalizeDrivingLicenceTypes(
await this.getClientRemoteLookup("driving-licence-types"),
);
}
async getAccidentCulpritType(): Promise<any> {