diff --git a/src/request-management/dto/run-inquiries-v3.dto.ts b/src/request-management/dto/run-inquiries-v3.dto.ts index b165b37..5d9b436 100644 --- a/src/request-management/dto/run-inquiries-v3.dto.ts +++ b/src/request-management/dto/run-inquiries-v3.dto.ts @@ -89,6 +89,16 @@ export class RunInquiriesV3Dto { @IsOptional() @IsString() insurerLicense?: string; + + @ApiPropertyOptional({ + example: "1", + description: + "Driving licence type code from GET /lookups/driving-licence-types. " + + "Optional — used in V4 FileMaker flow.", + }) + @IsOptional() + @IsString() + licenseType?: string; } /** @@ -152,4 +162,14 @@ export class RunInquiriesVinV3Dto { @IsOptional() @IsString() insurerLicense?: string; + + @ApiPropertyOptional({ + example: "1", + description: + "Driving licence type code from GET /lookups/driving-licence-types. " + + "Optional — used in V4 FileMaker flow.", + }) + @IsOptional() + @IsString() + licenseType?: string; } diff --git a/src/request-management/entities/schema/partyRole.enum.ts b/src/request-management/entities/schema/partyRole.enum.ts index 2b94764..69c2442 100644 --- a/src/request-management/entities/schema/partyRole.enum.ts +++ b/src/request-management/entities/schema/partyRole.enum.ts @@ -23,6 +23,8 @@ export class Person { @Prop() nationalCodeOfDriver?: string; @Prop() insurerLicense?: string; @Prop() driverLicense?: string; + /** Driving licence type code from the Fanavaran lookup (GET /lookups/driving-licence-types). */ + @Prop() licenseType?: string; @Prop({ type: Boolean }) driverIsInsurer?: boolean; diff --git a/src/request-management/request-management.service.ts b/src/request-management/request-management.service.ts index 05de3ff..1caf80d 100644 --- a/src/request-management/request-management.service.ts +++ b/src/request-management/request-management.service.ts @@ -8690,6 +8690,8 @@ export class RequestManagementService { party.person.insurerLicense = partyData.insurerLicense; if (partyData.driverLicense) party.person.driverLicense = partyData.driverLicense; + if ((partyData as any).licenseType) + (party.person as any).licenseType = (partyData as any).licenseType; if (!party.vehicle) party.vehicle = {} as any; party.vehicle.plateId = this.plateToPlateIdString(partyData.plate); @@ -9502,6 +9504,8 @@ export class RequestManagementService { party.person.insurerLicense = partyData.insurerLicense; if (partyData.driverLicense) party.person.driverLicense = partyData.driverLicense; + if ((partyData as any).licenseType) + (party.person as any).licenseType = (partyData as any).licenseType; if (!party.vehicle) party.vehicle = {} as any; party.vehicle.plateId = partyData.vin; // store VIN as vehicle identifier @@ -11117,6 +11121,7 @@ export class RequestManagementService { clientId: p.person?.clientId ? String(p.person.clientId) : undefined, + licenseType: p.person?.licenseType ?? undefined, }, insurance: p.insurance ? { @@ -11211,6 +11216,7 @@ export class RequestManagementService { driverIsInsurer: p.person?.driverIsInsurer, userId: p.person?.userId ? String(p.person.userId) : undefined, clientId: p.person?.clientId ? String(p.person.clientId) : undefined, + licenseType: p.person?.licenseType ?? undefined, }, insurance: p.insurance ? { company: p.insurance.company, @@ -11317,6 +11323,7 @@ export class RequestManagementService { driverIsInsurer: p.person?.driverIsInsurer, userId: p.person?.userId ? String(p.person.userId) : undefined, clientId: p.person?.clientId ? String(p.person.clientId) : undefined, + licenseType: p.person?.licenseType ?? undefined, }, insurance: p.insurance ? { company: p.insurance.company,