Each fluid has its own doctype wildcard and one doctype per time step. Each available time step for a fluid depends of the available data from the energy provider. Here are the different time step:
gaz fluid / grdf | **`com.grandlyon.grdf.*`** | **`com.grandlyon.grdf.hour`**<br>**`com.grandlyon.grdf.day`**<br>**`com.grandlyon.grdf.month`**<br>**`com.grandlyon.grdf.year`**
water fluid / eau du grand lyon | **`com.grandlyon.egl.*`** | **`com.grandlyon.egl.day`**<br>**`com.grandlyon.egl.month`**<br>**`com.grandlyon.egl.year`**
| gaz fluid / grdf | **`com.grandlyon.grdf.*`**| **`com.grandlyon.grdf.hour`**<br>**`com.grandlyon.grdf.day`**<br>**`com.grandlyon.grdf.month`**<br>**`com.grandlyon.grdf.year`** |
| water fluid / eau du grand lyon | **`com.grandlyon.egl.*`**| **`com.grandlyon.egl.day`**<br>**`com.grandlyon.egl.month`**<br>**`com.grandlyon.egl.year`** |
### Structure
Field | Type | Description
----- | -----|------------
load | number | load (in kWh or L)
minute | number | minute of the date<br>*set to 0 except for minute serie*
hour | number | hour of the date<br>*set to 0 except for minute and hour series*
day | number | day of the date<br>*set to 1 for month and year series*
month | number | month of the date<br>*set to 1 for year series*
| ecogestureHash | string | Hash used to verify the content of ecogestures |
| challengeHash | string | Hash used to verify the content of challenges |
| duelHash | string | Hash used to verify the content of duels |
| quizHash | string | Hash used to verify the content of quiz |
| isFirstConnection | boolean | Boolean used to inform if the user connects for the first time |
| haveSeenFavoriteModal | boolean | Boolean used to inform if user has seen the favorite modal |
| haveSeenLastReport | boolean | Boolean used to inform if user has seen the last report |
| haveSeenOldFluidModal | Datetime or boolean | Used to inform if user has seen the modal display when his data are too old. Its value is false or a DateTime when he saw it |
| sendReportNotification | boolean | Boolean used to inform if user has seen the report notification |
| monthlyReportDate | DateTime | Date of the last monthly report |
shortDescription | string | short description of the ecogesture
longDescription | string | long description of the ecogesture
usage | string | usage of the ecogesture
fluidTypes | FluidType[] | Array of fluid type on which ecogesture can have an impact<br><br>*FluidType enum:*<br>- *ELECTRICITY = 0*<br>- *WATER = 1*<br>- *GAS = 2*<br>- *MULTIFLUID = 3*
nwh | number | negawattheure - impact of the ecogesture from 0 to 10
pack | number | pack number of the ecogesture (1 pack contain 2 ecogestures)
iconName | string | icon name for ecogesture
unlocked | boolean| (Optional) state for unlocked ecogesture
| shortName | string | short name of the ecogesture |
| longName | string | long name of the ecogesture |
| shortDescription | string | short description of the ecogesture |
| longDescription | string | long description of the ecogesture |
| usage | string | usage of the ecogesture |
| fluidTypes | FluidType[] | Array of fluid type on which ecogesture can have an impact<br><br>_FluidType enum:_<br>- _ELECTRICITY = 0_<br>- _WATER = 1_<br>- _GAS = 2_<br>- _MULTIFLUID = 3_ |
| nwh | number | negawattheure - impact of the ecogesture from 0 to 10 |
| pack | number | pack number of the ecogesture (1 pack contain 2 ecogestures) |
| iconName | string | icon name for ecogesture |
| unlocked | boolean | (Optional) state for unlocked ecogesture |
### Example
```
{
"shortName": "Contrôle du nuage",
...
...
@@ -104,110 +130,327 @@ unlocked | boolean| (Optional) state for unlocked ecogesture
}
```
## Challenge type
## Challenge
### Description
This doctype is used to store all available challenges.
This doctype is used to store all challenges.
### Doctype
**`com.grandlyon.ecolyo.challengetype`**
**`com.grandlyon.ecolyo.challenge`**
### Structure
Field | Type | Description
----- | -----|------------
type | TypeChallenge | type of challenge<br><br>*TypeChallenge enum:*<br>- *CHALLENGE = 0*<br>- *ACHIEVEMENT = 1*
title | string | title of the challenge
description | string | description of the challenge
level | number | level needed to unlock the challenge
duration | Duration | duration. (Duration from luxon)
fluidTypes | FluidType[] | Array of fluid type associated to the challenge<br><br>*FluidType enum:*<br>- *ELECTRICITY = 0*<br>- *WATER = 1*<br>- *GAS = 2*<br>- *MULTIFLUID = 3*
relationships | any | relation to available ecogestures for the challenge<br><br>*"availableEcogestures": {*<br>*"data": Ecogesture[]*<br>*}*
This doctype is used to store all additionnal information about a challenge started or ended by the user.
### Doctype
**`com.grandlyon.ecolyo.userchallenge`**
### Structure
Field | Type | Description
----- | -----|------------
startingDate | string | starting date of the the challenge
endingDate | string | ending date of the challenge
state | ChallengeState | state of the challenge
maxEnergy | number |
currentEnergy | number |
badge | BadgeState | state of the badge<br><br>BadgeState enum<br>- *FAILED = 0*<br>- *SUCCESS = 1*
fluidTypes | FluidType[] | fluid types set when user launch the challenge<br><br>*FluidType enum:*<br>- *ELECTRICITY = 0*<br>- *WATER = 1*<br>- *GAS = 2*<br>- *MULTIFLUID = 3*
relationships | any | relation to the challenge type and selected ecogestures for the challenge<br><br>*"challengeType": {*<br>*"data": ChallengeType[]*<br>*}*<br><br>*"selectedEcogestures": {*<br>*"data": Ecogesture[]*<br>*}*
| duel | UserDuelEntity | Complete Duel object with progress included |
| success | UserChallengeSuccess | Success state of the challenge<br><br>UserChallengeSuccess enum<br>- _ONGOING = 0_<br>- _LOST = 1_<br>- _WIN = 2_ |
| startDate | string null | starting date of the the challenge |
| endingDate | string null | ending date of the challenge |
### Example
```
{
"state": 1
"badge": 1,
"currentEnergy": -1,
"startingDate": "0001-01-01T00:00:00.000Z",
"endingDate": "2020-06-16T00:00:00.000+02:00",
"maxEnergy": -1,
"relationships": {
"challengeType": {
"data": {
"_id": "CHA00000001",
"_type": "com.grandlyon.ecolyo.challengetype"
}
},
"selectedEcogestures": {
"data": [
{
"_id": "0085",
"_type": "com.grandlyon.ecolyo.ecogesture"
},
{
"_id": "0092",
"_type": "com.grandlyon.ecolyo.ecogesture"
}
]
}
"_id": "eae3a79a05d677a739bdd2b46b009936",
"description": "foobar",
"duel": {
"description": "Je parie un ours polaire que vous ne pouvez pas consommer moins que #CONSUMPTION € en 1 semaine",
"duration": {
"days": 7
},
"fluidTypes": [
0,
1,
2
],
"id": "DUEL001",
"startDate": null,
"state": 4,
"threshold": -1,
"title": "Nicolas Hublot",
"userConsumption": 0
},
"endingDate": null,
"id": "CHALLENGE0001",
"progress": 15,
"quiz": {
"customQuestion": {
"interval": 30,
"period": {},
"questionLabel": "Quel jour ai-je le plus consommé la semaine dernière ?",
"result": 1,
"timeStep": 20,
"type": 0
},
"id": "QUIZ001",
"questions": [
{
"answers": [
{
"answerLabel": "Vapeur d'eau",
"isTrue": false
},
{
"answerLabel": "Fumée",
"isTrue": false
},
{
"answerLabel": "Gouttelettes d'eau et cristaux de glace",
"isTrue": true
}
],
"explanation": "Les nuages sont constitués de gouttelettes d'eau et parfois aussi de cristaux de glace",
"questionLabel": "De quoi les nuages sont-ils constitués ?",
"result": 1,
"source": "string"
},
{
"answers": [
{
"answerLabel": "86 km",
"isTrue": true
},
{
"answerLabel": "78 km",
"isTrue": false
},
{
"answerLabel": "56 km",
"isTrue": false
}
],
"explanation": "L’aqueduc du Gier est un des aqueducs antiques de Lyon desservant la ville antique de Lugdunum. Avec ses 86 km il est le plus long des quatre aqueducs ayant alimenté la ville en eau, et celui dont les structures sont le mieux conservées. Il doit son nom au fait qu'il puise aux sources du Gier, affluent du Rhône",
"questionLabel": "Quelle longueur faisait l’aqueduc du Gier pour acheminer l’eau sur Lyon à l’époque romaine ?",
"result": 1,
"source": "string"
},
{
"answers": [
{
"answerLabel": "Crémieux",
"isTrue": false
},
{
"answerLabel": "Crépieux-Charmy",
"isTrue": true
},
{
"answerLabel": "Charly",
"isTrue": false
}
],
"explanation": "Crépieux-Charmy est le principal champ captant de la Métropole de Lyon",
"questionLabel": "Quelle est le nom du principal champ de captage d’eau potable de la Métropole ?",
"result": 1,
"source": "string"
},
{
"answers": [
{
"answerLabel": "Pompe à air",
"isTrue": false
},
{
"answerLabel": "Pompe à cordes",
"isTrue": true
},
{
"answerLabel": "Pompe de Cornouailles",
"isTrue": false
}
],
"explanation": "Mise en fonctionnement en 1856, 3 pompes à vapeur dites de Cornouailles produisent quelque 20 000 m3 d'eau par jour. Ces pompes mesurent 20 m de haut et 13 m de large pour un poids de 200 tonnes. Leur balancier de 35 tonnes s'actionne toutes les 6 secondes, permettant ainsi l'envoi de 600 m3 d'eau par heure.",
"questionLabel": "Quelle type de pompes étaient utilisées à l'usine des eaux de Caluire jusqu'en 1910 ?",
| \_id | string | quiz id - respect the format _QUIZ00X_ |
| questions | QuestionEntity[] | Array of questions entities |
| customQuestion | CustomQuestionEntity | Custom question based on user's consumption |
### Example
```
{
"_id": "QUIZ001",
"questions": [
{
"questionLabel": "Quelle longueur faisait l’aqueduc du Gier pour acheminer l’eau sur Lyon à l’époque romaine ?",
"answers": [
{ "answerLabel": "86 km", "isTrue": true },
{
"answerLabel": "78 km",
"isTrue": false
},
{
"answerLabel": "56 km",
"isTrue": false
}
],
"explanation": "L’aqueduc du Gier est un des aqueducs antiques de Lyon desservant la ville antique de Lugdunum. Avec ses 86 km il est le plus long des quatre aqueducs ayant alimenté la ville en eau, et celui dont les structures sont le mieux conservées. Il doit son nom au fait qu'il puise aux sources du Gier, affluent du Rhône",
"source": "string"
},
{
"questionLabel": "Quelle type de pompes étaient utilisées à l'usine des eaux de Caluire jusqu'en 1910 ?",
"answers": [
{
"answerLabel": "Pompe à cordes",
"isTrue": true
},
{
"answerLabel": "Pompe de Cornouailles",
"isTrue": false
},
{
"answerLabel": "Pompe à air",
"isTrue": false
}
],
"explanation": "Mise en fonctionnement en 1856, 3 pompes à vapeur dites de Cornouailles produisent quelque 20 000 m3 d'eau par jour. Ces pompes mesurent 20 m de haut et 13 m de large pour un poids de 200 tonnes. Leur balancier de 35 tonnes s'actionne toutes les 6 secondes, permettant ainsi l'envoi de 600 m3 d'eau par heure.",
"source": "string"
},
{
"questionLabel": "Quelle est le nom du principal champ de captage d’eau potable de la Métropole ?",
"answers": [
{ "answerLabel": "Crémieux", "isTrue": false },
{
"answerLabel": "Crépieux-Charmy",
"isTrue": true
},
{
"answerLabel": "Charly",
"isTrue": false
}
],
"explanation": "Crépieux-Charmy est le principal champ captant de la Métropole de Lyon",
"source": "string"
},
{
"questionLabel": "De quoi les nuages sont-ils constitués ?",