From 858820df9b289bc6bd58f1f303b3870183840c2e Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Sat, 7 Dec 2024 21:54:44 +0100 Subject: [PATCH] When modified object belongs to a JORF text, this JORF text is the modifying text --- ...by_textes_modificateurs_to_git_markdown.ts | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts b/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts index dc5a0a3..9e9d0b5 100644 --- a/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts +++ b/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts @@ -1290,6 +1290,18 @@ async function registerLegiArticleModifiers( } } + // If article belongs directly to a text published in JORF then this JORF text is its texte créateur. + if (article.CONTEXTE.TEXTE["@cid"]?.startsWith("JORFTEXT")) { + await addTexteModificateurId( + context, + article.CONTEXTE.TEXTE["@cid"], + "CREATE", + articleId, + articleDateDebut, + articleDateFin, + ) + } + // If article has no texte créateur at all, then create a fake one. const texteModificateurIdByAction = (context.texteModificateurIdByActionById[ articleId @@ -1415,7 +1427,19 @@ async function registerLegiSectionTaModifiers( } } - // If article has no texte créateur at all, then use a fake one. + // If Section Texte Article belongs directly to a text published in JORF then this JORF text is its texte créateur. + if (sectionTa.CONTEXTE.TEXTE["@cid"].startsWith("JORFTEXT")) { + await addTexteModificateurId( + context, + sectionTa.CONTEXTE.TEXTE["@cid"], + "CREATE", + sectionTaId, + sectionTaDateDebut, + sectionTaDateFin, + ) + } + + // If Section Texte Article has no texte créateur at all, then use a fake one. const texteModificateurIdByAction = (context.texteModificateurIdByActionById[ sectionTaId ] ??= {})