diff --git a/docs/project_architecture/doctypes.md b/docs/project_architecture/doctypes.md index 2f4f692dba5c6228a0130fccce621b4c7e2d7452..854da2be76ebb37fdaa38b46fe1664b2c0e39a99 100644 --- a/docs/project_architecture/doctypes.md +++ b/docs/project_architecture/doctypes.md @@ -1,2 +1,213 @@ !!! info "" - :construction: Section under Construction :construction: \ No newline at end of file + :construction: Section under Construction :construction: + +# Timeseries doctypes + +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: +* minute +* hour +* day +* month +* year + +Here are the available doctypes: + +Fluid type | Doctype wildcard | Doctypes +---------- | -----------------|--------- +electricity fluid / enedis | **`com.grandlyon.enedis.*`** | **`com.grandlyon.enedis.minute`**<br>**`com.grandlyon.enedis.hour`**<br>**`com.grandlyon.enedis.day`**<br>**`com.grandlyon.enedis.month`**<br>**`com.grandlyon.enedis.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* +year | number | year of the date + +#### Example +``` +{ + "load": 770.18, + "minute": 0, + "hour": 0, + "day": 1, + "month": 1, + "year": 2020 +} +``` + +# User profile + +#### Description +This doctype is used to store all information about the user. + +#### Doctype +**`com.grandlyon.ecolyo.userprofile`** + +#### Structure +Field | Type | Description +----- | -----|------------ +level | number | challenge level of the user +challengeTypeHash | string | Hash used to verify the content of challenge type +ecogestureHash | string | Hash used to verify the content of ecogesture +haveSeenWelcomeModal | boolean | flag to inform is the user have seen the welcome modal + +#### Example +``` +{ + "challengeTypeHash": "c10bbfec554e735d58a5d7009c9964e4a6bc4c65", + "ecogestureHash": "71d475cead14a465d697de596ad21e9aebf3def2", + "haveSeenWelcomeModal": true, + "level": 2 +} +``` + +# Ecogesture + +#### Description +This doctype is used to store ecogestures. + +#### Doctype +**`com.grandlyon.ecolyo.ecogesture`** + +#### Structure +Field | Type | Description +----- | -----|------------ +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", + "longName": "Je règle la température de mon eau chaude entre 55 et 60 °C.", + "shortDescription": "", + "longDescription": "Bien souvent les chauffe-eau sont réglés pour une température de 70 °C dans le ballon, ce qui n’est pas économique et peut même être dangereux !", + "usage": "Eau chaude sanitaire", + "fluidTypes": [ + 0 + ], + "nwh": 6, + "pack": 8 +} +``` + +# Challenge type + +#### Description +This doctype is used to store all available challenges. + +#### Doctype +**`com.grandlyon.ecolyo.challengetype`** + +#### 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>*}* + +#### Example +``` +{ + "type": 1, + "title": "Ecolyo Royal", + "description": "Connecter l'application Ecolyo à votre distributeur d'énergie", + "level": 1, + "duration": { + "days": 0 + }, + "fluidTypes": [ + 0, + 1, + 2 + ], + "relationships": { + "availableEcogestures": { + "data": [ + { + "_id": "0085", + "_type": "com.grandlyon.ecolyo.ecogesture" + }, + { + "_id": "0092", + "_type": "com.grandlyon.ecolyo.ecogesture" + } + ] + } + } +} +``` + +# User challenge + +#### Description +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>*}* + +#### 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" + } + ] + } + }, +} +``` + + + + +