@cid, @date_publi & @date_signature are now optional in LegiArticle.CONTEXTE.TEXTE

This commit is contained in:
Emmanuel 2023-11-28 07:21:21 +01:00
parent 47c0a0017d
commit 50691e6da1
2 changed files with 4 additions and 14 deletions

View file

@ -579,6 +579,7 @@ function auditTexte(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
const remainingKeys = new Set(Object.keys(data)) const remainingKeys = new Set(Object.keys(data))
for (const key of [ for (const key of [
"@autorite", "@autorite",
"@cid",
"@ministere", "@ministere",
"@nor", "@nor",
"@num", "@num",
@ -594,16 +595,6 @@ function auditTexte(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
auditEmptyToNull, auditEmptyToNull,
) )
} }
audit.attribute(
data,
"@cid",
true,
errors,
remainingKeys,
auditTrimString,
auditEmptyToNull,
auditRequire,
)
for (const key of ["@date_publi", "@date_signature"]) { for (const key of ["@date_publi", "@date_signature"]) {
audit.attribute( audit.attribute(
data, data,
@ -613,7 +604,6 @@ function auditTexte(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
remainingKeys, remainingKeys,
auditFunction((date) => date.replace(/^11992-12-27$/, "1992-12-27")), auditFunction((date) => date.replace(/^11992-12-27$/, "1992-12-27")),
auditDateIso8601String, auditDateIso8601String,
auditRequire,
) )
} }
audit.attribute( audit.attribute(

View file

@ -7,9 +7,9 @@ export interface LegiArticle {
CONTEXTE: { CONTEXTE: {
TEXTE: { TEXTE: {
"@autorite"?: string "@autorite"?: string
"@cid": string "@cid"?: string
"@date_publi": string "@date_publi"?: string
"@date_signature": string "@date_signature"?: string
"@ministere"?: string "@ministere"?: string
"@nature"?: LegiArticleTexteNature "@nature"?: LegiArticleTexteNature
"@nor"?: string "@nor"?: string