From 1b39619e5e13fb626f9b0cb27134de49d199417b Mon Sep 17 00:00:00 2001 From: antoineludeau <52679050+antoineludeau@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:56:52 +0200 Subject: [PATCH] Added bal schema to address, common toponym and district meta schemas --- lib/api/address/schema.js | 5 +++-- lib/api/common-toponym/schema.js | 5 +++-- lib/api/district/schema.js | 5 +++-- lib/api/schema.js | 11 ++++++++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/api/address/schema.js b/lib/api/address/schema.js index fd42c312..0007fbf0 100644 --- a/lib/api/address/schema.js +++ b/lib/api/address/schema.js @@ -1,5 +1,5 @@ import {object, string, number, boolean, array, date} from 'yup' -import {banID, geometrySchema, labelSchema, cadastreSchema} from '../schema.js' +import {banID, geometrySchema, labelSchema, cadastreSchema, balSchema} from '../schema.js' const PositionTypes = ['entrance', 'building', 'staircase identifier', 'unit identifier', 'utility service', 'postal delivery', 'parcel', 'segment', 'other'] @@ -9,7 +9,8 @@ const positionSchema = object({ }) const metaSchema = object({ - cadastre: cadastreSchema + cadastre: cadastreSchema, + bal: balSchema, }) export const banAddressSchema = object({ diff --git a/lib/api/common-toponym/schema.js b/lib/api/common-toponym/schema.js index 053e2372..dc302cdb 100644 --- a/lib/api/common-toponym/schema.js +++ b/lib/api/common-toponym/schema.js @@ -1,8 +1,9 @@ import {object, array, date} from 'yup' -import {banID, geometrySchema, labelSchema, cadastreSchema} from '../schema.js' +import {banID, geometrySchema, labelSchema, cadastreSchema, balSchema} from '../schema.js' const metaSchema = object({ - cadastre: cadastreSchema + cadastre: cadastreSchema, + bal: balSchema, }) export const banCommonToponymSchema = object({ diff --git a/lib/api/district/schema.js b/lib/api/district/schema.js index 6a0bdf78..0188b9cb 100644 --- a/lib/api/district/schema.js +++ b/lib/api/district/schema.js @@ -1,12 +1,13 @@ import {object, array, date, bool} from 'yup' -import {banID, labelSchema, inseeSchema} from '../schema.js' +import {banID, labelSchema, inseeSchema, balSchema} from '../schema.js' const configSchema = object({ useBanId: bool() }) const metaSchema = object({ - insee: inseeSchema + insee: inseeSchema, + bal: balSchema, }) export const banDistrictSchema = object({ diff --git a/lib/api/schema.js b/lib/api/schema.js index 557fb80f..d52c5fbc 100644 --- a/lib/api/schema.js +++ b/lib/api/schema.js @@ -1,4 +1,4 @@ -import {object, string, number, array} from 'yup' +import {object, string, number, array, date, boolean} from 'yup' export const banID = string().trim().uuid() @@ -19,3 +19,12 @@ export const inseeSchema = object({ export const cadastreSchema = object({ ids: array().of(string().trim()) }) + +export const balSchema = object({ + idRevision: string().trim(), + dateRevision: date(), + codeAncienneCommune: string().trim(), + nomAncienneCommune: string().trim(), + isLieuDit: boolean() +}) +