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

View file

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