From 2ee17b6b3ea5288009fa58f95edfb2f10d2c9b79 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Sat, 7 Dec 2024 07:39:41 +0100 Subject: [PATCH] Summarize LIEN in TEXTE_VERSION --- src/lib/summaries.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/lib/summaries.ts b/src/lib/summaries.ts index afb6572..168d655 100644 --- a/src/lib/summaries.ts +++ b/src/lib/summaries.ts @@ -859,12 +859,34 @@ export const summarizeTexteVersionProperties: Summarizer = (access, value) => { return summarizeLegalObjectToLink(access, "texte_version", value) } + if ( + access?.key === "@cidtexte" && + (access?.access?.key === "LIEN" || + (typeof access?.access?.key === "number" && + access?.access?.access?.key === "LIEN")) + ) { + return summarizeLegalIdToLink(access, value) + } + if ( + access?.key === "@id" && + (access?.access?.key === "LIEN" || + (typeof access?.access?.key === "number" && + access?.access?.access?.key === "LIEN")) + ) { + return summarizeLienId(access.access, access.parent) + } if (access?.key === "CID") { return summarizeLegalIdToLink(access, value) } if (access?.key === "CONTENU") { return { content: value as string, type: "html" } } + if ( + (access?.key === "LIEN" && !Array.isArray(value)) || + (typeof access?.key === "number" && access?.access?.key === "LIEN") + ) { + return summarizeLien(access, value) + } return undefined }