From b787ebd9450830ce109e7b78b54deec98a6cc3de Mon Sep 17 00:00:00 2001 From: philc Date: Tue, 3 Dec 2024 22:13:51 +0100 Subject: [PATCH] frenchlocation schema --- apxtri/models/Odmdb.js | 1 - schema/frenchlocation.json | 58 +++++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/apxtri/models/Odmdb.js b/apxtri/models/Odmdb.js index b7ae8ac..80aad77 100644 --- a/apxtri/models/Odmdb.js +++ b/apxtri/models/Odmdb.js @@ -328,7 +328,6 @@ Odmdb.Schema = (objectPathname, validschema, lg = "en") => { ); } }); - if (!res.data.schema.apxid) { return { status: 406, diff --git a/schema/frenchlocation.json b/schema/frenchlocation.json index 9999fd1..a5e08f5 100644 --- a/schema/frenchlocation.json +++ b/schema/frenchlocation.json @@ -1,19 +1,24 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "/schema/frenchlocation", + "$id": "adminapi/schema/frenchlocation", "title": "French adresse location system from https://api-adresse.data.gouv.fr/search/?q=8+bd+du+port+massy that respect GeoCodeJSON", "description": "Manage properly postal adresse", "type": "object", "properties": { + "locationid": { + "title": " A unique id of this zone", + "description": "Build with latitude(4 digits)_longitude(4 digits)_zoning define a unique id oflocation", + "type": "string" + }, "type": { "title": "Type of result found, housenumber is a physical adresse, street position at street, locality: lieud it, municipality", "type": "string" }, - "housenumber":{ - "title":"number with ince bis ter A B" + "housenumber": { + "title": "number with ince bis ter A B" }, - "street":{ - "title":"Name of street" + "street": { + "title": "Name of street" }, "name": { "title": "Number plaque and street name (no town)", @@ -35,10 +40,10 @@ "title": "City name", "type": "string" }, - "zoning":{ - "title":"Number of kilometer around this position", - "type":"integer", - "minimum":0 + "zoning": { + "title": "Number of kilometer around this position", + "type": "integer", + "minimum": 0 }, "position": { "type": "object", @@ -59,5 +64,38 @@ "title": "Contexte of this address Department number, Department Name, Region ", "type": "string" } + }, + "required": [ + "locationid", + "position" + ], + "additionalProperties": false, + "apxid": "locationid", + "apxuniquekey": [ + "locationid" + ], + "apxidx": [ + { + "name": "lst_locationid", + "type": "array", + "keyval": "locationid" + }, + { + "name": "frenchlocation", + "type": "view", + "keyval": "locationid", + "objkey": [ + "postcode", + "city", + "label" + ], + "filter": "" + } + ], + "apxaccessrights": { + "pagans": { + "C": [], + "R": [] + } } -} +} \ No newline at end of file