diff --git a/src/expert-blame/dto/all-request.dto.ts b/src/expert-blame/dto/all-request.dto.ts index 0123123..76ff171 100644 --- a/src/expert-blame/dto/all-request.dto.ts +++ b/src/expert-blame/dto/all-request.dto.ts @@ -117,8 +117,7 @@ export class AllRequestDtoV2 { type: string; blameStatus: string; partiesInitialForms: { firstParty: string; secondParty: string }; - firstPartyVehicle: string; - secondPartyVehicle?: string; + partiesVehicles: { firstPartyVehicle: string; secondPartyVehicle: string }; } export class AllRequestDtoRsV2 { diff --git a/src/expert-blame/expert-blame.service.ts b/src/expert-blame/expert-blame.service.ts index 2a57914..414df9d 100644 --- a/src/expert-blame/expert-blame.service.ts +++ b/src/expert-blame/expert-blame.service.ts @@ -352,6 +352,15 @@ export class ExpertBlameService { const workflow = (doc.workflow ?? {}) as Record; const parties = (doc.parties ?? []) as Array<{ role?: string; + vehicle?: { + name?: string; + inquiry?: { + mapped?: { + MapTypNam?: string; + CarName?: string; + }; + }; + }; statement?: { admitsGuilt?: boolean; claimsDamage?: boolean; @@ -381,8 +390,19 @@ export class ExpertBlameService { firstParty: statementToFormKey(firstParty?.statement) ?? "", secondParty: statementToFormKey(secondParty?.statement) ?? "", }, - firstPartyVehicle: doc.parties[0]?.person?.vehicle?.name, - secondPartyVehicle: doc.parties[1]?.person?.vehicle?.name, + partiesVehicles: { + firstPartyVehicle: + firstParty?.vehicle?.name || + firstParty?.vehicle?.inquiry?.mapped?.MapTypNam || + firstParty?.vehicle?.inquiry?.mapped?.CarName || + "", + secondPartyVehicle: + secondParty?.vehicle?.name || + secondParty?.vehicle?.inquiry?.mapped?.MapTypNam || + secondParty?.vehicle?.inquiry?.mapped?.CarName || + "", + } + }; }