1
0
forked from Yara724/api

Fixed mismatched userId on field expert for claim

This commit is contained in:
SepehrYahyaee
2026-06-20 11:53:18 +03:30
parent d355771518
commit 5a89a0ff16
26 changed files with 144 additions and 414 deletions

View File

@@ -5633,6 +5633,7 @@ export class RequestManagementService {
userId: firstPartyUserId,
phoneNumber: normalizeIranMobile(formData.firstPartyPhoneNumber) ??
formData.firstPartyPhoneNumber,
clientId: (client as any)?._id ?? (client as any)?._doc?._id,
nationalCodeOfInsurer: firstPartyPlate.nationalCodeOfInsurer,
nationalCodeOfDriver: firstPartyPlate.nationalCodeOfDriver,
insurerLicense: firstPartyPlate.insurerLicense,
@@ -5813,11 +5814,14 @@ export class RequestManagementService {
`Client not found for company: ${clientName}`,
);
}
const resolvedClientId =
(client as any)?._id ?? (client as any)?._doc?._id;
return {
role,
person: {
userId,
phoneNumber: normalizeIranMobile(phoneNumber) ?? phoneNumber,
...(resolvedClientId ? { clientId: resolvedClientId } : {}),
nationalCodeOfInsurer: plateDto.nationalCodeOfInsurer,
nationalCodeOfDriver: plateDto.nationalCodeOfDriver,
insurerLicense: plateDto.insurerLicense,