forked from Yara724/api
Merge upstream API changes and resolve Fanavaran role mapping
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
parseFanavaranId,
|
||||
type FanavaranCarPolicyProduct,
|
||||
} from "src/lookups/fanavaran-last-car-policy";
|
||||
import { resolvePolicyholderFromParty } from "./fanavaran-party-roles";
|
||||
import type { InquiryParticipantRoleAssignments } from "src/request-management/inquiry-participant-resolver";
|
||||
|
||||
export type FanavaranClaimProduct = FanavaranCarPolicyProduct;
|
||||
|
||||
@@ -101,6 +103,8 @@ export function fanavaranInsuranceLineIdForProduct(
|
||||
type BlamePartyForCarBodyPolicy = {
|
||||
role?: string;
|
||||
person?: { nationalCodeOfInsurer?: unknown };
|
||||
participants?: Array<Record<string, any>>;
|
||||
participantRoles?: Partial<InquiryParticipantRoleAssignments>;
|
||||
insurance?: {
|
||||
carBodyInsurance?: {
|
||||
policyId?: unknown;
|
||||
@@ -168,6 +172,7 @@ export function pickCarBodyPolicyNationalCode(
|
||||
): string | null {
|
||||
const party = firstCarBodyParty(blame);
|
||||
return (
|
||||
resolvePolicyholderFromParty(party, "car-body").nationalCode ??
|
||||
nonEmptyText(party?.person?.nationalCodeOfInsurer) ??
|
||||
nonEmptyText(party?.insurance?.carBodyInsurance?.ownerNationalCode) ??
|
||||
nonEmptyText(party?.insurance?.carBodyInsurance?.insurerNationalCode)
|
||||
|
||||
Reference in New Issue
Block a user