From 2504650646caf0def5f02702c6da4552bc95f165 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Thu, 12 Oct 2023 13:48:49 +0200 Subject: [PATCH] =?UTF-8?q?sch=C3=A9mas=20json=20:=20d=C3=A9placement=20fi?= =?UTF-8?q?chiers=20;=20ajout=20champ=20'type'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- categories/category.schema.json | 14 +++++++++++ equipment.schema.json | 4 +++ mouvements/movement.schema.json | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 categories/category.schema.json create mode 100644 mouvements/movement.schema.json diff --git a/categories/category.schema.json b/categories/category.schema.json new file mode 100644 index 0000000..4884ae8 --- /dev/null +++ b/categories/category.schema.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["category"] + }, + "name": { + "type": "string" + } + }, + "required": ["name"] +} diff --git a/equipment.schema.json b/equipment.schema.json index 1f38c1e..0df6ed6 100644 --- a/equipment.schema.json +++ b/equipment.schema.json @@ -2,6 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { + "type": { + "type": "string", + "enum": ["equipment"] + }, "category" : { "type": "string" }, diff --git a/mouvements/movement.schema.json b/mouvements/movement.schema.json new file mode 100644 index 0000000..bd579f1 --- /dev/null +++ b/mouvements/movement.schema.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["movement"] + }, + "direction" : { + "description": "Entrée ou sortie", + "type": "string", + "enum": ["entrée", "sortie"] + }, + "inputNature": { + "description": "Nature de l'entrée", + "type": "string", + "enum": ["Achat", "Don", "Récupération", "Location / Prêt"] + }, + "outputNature": { + "description": "Nature de la sortie", + "type": "string", + "enum": ["Vente", "Don", "Besoin", "Autre (perte, vol, ...)", "Location / Prêt"] + }, + "amount": { + "description": "Quantité ajoutée ou retirée", + "type": "integer", + "minimum": 1 + } + "equipment": { + "type": "string" + } + "date" : { + "description": "Date de l'opération", + "type": "string", + "format": "datetime" + } + "comment": { + "description": "Commentaire additionnel", + "type": "string" + } + }, + "required": ["direction", "inputNature", "outputNature", "amount", "equipment", "date", "comment"] +}