From bea4fba5eb30e45bd9ed768f0474e871f26773d9 Mon Sep 17 00:00:00 2001 From: Audrey Lebret Date: Mon, 22 Aug 2022 11:02:34 +0200 Subject: [PATCH] feat(demographie): ajout collection (#1357) * feat(demographie): ajout collection * fix(demographie): string pour les dept * fix(demographie): retours PR --- .../config/routes.json | 52 +++++++++++++++ .../informations-demographiques.settings.json | 66 +++++++++++++++++++ .../models/reponses-epds.settings.json | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 back/strapi/api/informations-demographiques/config/routes.json create mode 100644 back/strapi/api/informations-demographiques/models/informations-demographiques.settings.json diff --git a/back/strapi/api/informations-demographiques/config/routes.json b/back/strapi/api/informations-demographiques/config/routes.json new file mode 100644 index 000000000..b4a904c51 --- /dev/null +++ b/back/strapi/api/informations-demographiques/config/routes.json @@ -0,0 +1,52 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/informations-demographiques", + "handler": "informations-demographiques.find", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/informations-demographiques/count", + "handler": "informations-demographiques.count", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/informations-demographiques/:id", + "handler": "informations-demographiques.findOne", + "config": { + "policies": [] + } + }, + { + "method": "POST", + "path": "/informations-demographiques", + "handler": "informations-demographiques.create", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/informations-demographiques/:id", + "handler": "informations-demographiques.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/informations-demographiques/:id", + "handler": "informations-demographiques.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/back/strapi/api/informations-demographiques/models/informations-demographiques.settings.json b/back/strapi/api/informations-demographiques/models/informations-demographiques.settings.json new file mode 100644 index 000000000..221169dd6 --- /dev/null +++ b/back/strapi/api/informations-demographiques/models/informations-demographiques.settings.json @@ -0,0 +1,66 @@ +{ + "kind": "collectionType", + "collectionName": "informations_demographiques", + "info": { + "name": "Informations démographiques", + "description": "Informations démographiques des utilisateurs" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": false + }, + "attributes": { + "genre": { + "type": "enumeration", + "enum": [ + "homme", + "femme", + "nonPrecise" + ] + }, + "age": { + "type": "enumeration", + "enum": [ + "moinsDe18ans", + "entre18_25ans", + "entre25_30ans", + "entre30_35ans", + "entre35_40ans", + "entre40_45ans", + "plusDe45ans" + ] + }, + "entourage_dispo": { + "type": "enumeration", + "enum": [ + "oui", + "non", + "jeNeSaisPas" + ] + }, + "situation": { + "type": "enumeration", + "enum": [ + "vousAttendez1Enfant", + "vousAvezEnfantDeMoinsDe2ans", + "vousAvezDesEnfantsDePlusDe2ans" + ] + }, + "code_postal": { + "type": "string" + }, + "ville": { + "type": "string" + }, + "departement": { + "type": "string" + }, + "region": { + "type": "string" + }, + "reponses_epds": { + "model": "reponses-epds" + } + } +} \ No newline at end of file diff --git a/back/strapi/api/reponses-epds/models/reponses-epds.settings.json b/back/strapi/api/reponses-epds/models/reponses-epds.settings.json index 8497fc893..3ba60ab08 100644 --- a/back/strapi/api/reponses-epds/models/reponses-epds.settings.json +++ b/back/strapi/api/reponses-epds/models/reponses-epds.settings.json @@ -71,4 +71,4 @@ "model": "widget-epds-sources" } } -} \ No newline at end of file +}