diff --git a/docs/easycozy/commands.md b/docs/easycozy/commands.md new file mode 100644 index 0000000000000000000000000000000000000000..3e4bc3c0311e3934f9f61c71dfcaeba7eadb1218 --- /dev/null +++ b/docs/easycozy/commands.md @@ -0,0 +1,86 @@ +Here are common commands use on dev environment. + +# App + +## Install a specific version of an app + +```bash +$ cd /easy-cozy +$ docker-compose exec cozy ./cozy apps update home --domain "[name].cozy.self-data.alpha.grandlyon.com" git://github.com/doubleface/cozy-collect.git#build-debug +``` + +# Konnector + +## Install a specific version of a konnector + +```bash +$ cd /easy-cozy +# cozy-stack konnectors uninstall ${konn} --domain ${url} +$ docker-compose exec cozy ./cozy konnectors uninstall grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" +grdfgrandlyon has been uninstalled +# cozy-stack konnectors install ${konn} --domain ${url} +$ docker-compose exec cozy ./cozy konnectors install grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-adict-konnector.git#build +grdfgrandlyon (0.1.5-a3f6f05d9fde7c705b811658b3ce3667a9d7d0b5) has been installed on [name].cozy.self-data.alpha.grandlyon.com +``` + +## Update the version of a konnector + +```bash +$ cd /easy-cozy +# cozy-stack konnectors update ${konn} --domain ${url} +$ docker-compose exec cozy ./cozy konnectors update grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" +grdfgrandlyon has been upgraded to 0.1.5-d4bbe7350ecf13d13734f559c538e3c0ee8dc7ae +``` +## Run a konnector from the stack + +```bash +$ cd /root/easy-cozy +# cozy-stack konnectors run ${konn} --domain ${url} +$ docker-compose exec cozy ./cozy konnectors run grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" +``` + +# Instance + +## Set log level to debug for an instance + +```bash +$ cd /root/easy-cozy +# cozy-stack instances debug ${url} true +$ docker-compose exec cozy ./cozy instances debug --domain "[name].cozy.self-data.alpha.grandlyon.com" true +``` + + +# Stack + +## Check stack version + +```bash +$ cd /easy-cozy +$ docker-compose exec cozy ./cozy version +``` + +## Update stack version + +Update version in the Dockerfile on gitlab. + +**On serveur :** + +1. git pull or change localy the version in cozy-stack/Dockerfile +2. create the docker image using: + + ```bash + cd /easy-cozy/build + ./build-docker-image.sh + ``` + +3. Start the container based on the built image + + ```bash + cd .. + docker-compose up -d cozy + ``` + +!!! info "Error encounter" + Docker container was not launched, when consulting logs we can see the folowing error + > ./cozy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./cozy) + We have replaced debian:stable-slim with unbuntu:20.10 as installer for our docker build: [https://forge.grandlyon.com/pocs/cozy/easy-cozy/-/commit/48a30a03f209169e0f1ebb0d106bb4361e7cd167](https://forge.grandlyon.com/pocs/cozy/easy-cozy/-/commit/48a30a03f209169e0f1ebb0d106bb4361e7cd167) diff --git a/docs/easycozy/scripts.md b/docs/easycozy/scripts.md new file mode 100644 index 0000000000000000000000000000000000000000..b8388bfcd4918a02f0dc30faf32d380a4ff1b85b --- /dev/null +++ b/docs/easycozy/scripts.md @@ -0,0 +1,32 @@ +# Easy Cozy scripts + +Easy cozy project comes with 2 main scripts: +- create-instance.sh: used to create an instance for a user +- remove-instance.sh: used to remove an instance for a specific user + +In addition of these scripts we have added custom scripts for some specific needs. All these scripts are available in the "admin_scripts" folder + +# Scripts for instances + +| Scripts | Args | Description | +|-------------------|-------------------|----------------------------------------------------------| +| reset_instance.sh | instance_url | Remove and recreate again the instance for a given user | + +# Scripts for applications + +| Scripts | Args | Description | +|--------------------------|-------------------|-------------------------------------------------------------------------------| +| update_all_ecolyo_dev.sh | none | update Ecolyo with last version from build-dev branch on all instances | +| update_ecolyo_master.sh | instance_url | update Ecolyo with last version from build branch on a specific instance | +| update_ecolyo_dev.sh | instance_url | update Ecolyo with last version from build-dev branch on a specific instance | +| update_ecolyo_test.sh | instance_url | update Ecolyo with last version from build-test branch on a specific instance | +| update_pilote_master.sh | instance_url | update Pilote with last version from build-dev branch on a specific instance | +| update_pilote_dev.sh | instance_url | update PIlote with last version from build-test branch on a specific instance | + +# Scripts for konnectors + +| Scripts | Args | Description | +|---------------------------------|-------------------|----------------------------------------------------------------------------------------| +| update_enedis_konnector_prod.sh | instance_url | update Enedis konnector with last version from build branch on a specific instance | +| update_enedis_konnector_dev.sh | instance_url | update Enedis konnector with last version from build-dev branch on a specific instance | + diff --git a/docs/ecolyo/functionalities/challenge.md b/docs/ecolyo/functionalities/challenge.md index 3545ddb5d240126807b448741156ff0598ce8361..90930bed2c55b46b566d65a421b25ebded18f4ff 100644 --- a/docs/ecolyo/functionalities/challenge.md +++ b/docs/ecolyo/functionalities/challenge.md @@ -29,55 +29,122 @@ If it is a right answer, the quiz result is incremented by one. At the end of every quiz, we're creating a custom question. Here are the fields used to create a custom question -| Field | Type | Description | -| -------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | CustomQuestionType | Type of custom qusetion: DATA or CALCULATION. | -| timeStep | TimeStep | Time step of the result value (DAY / WEEK / MONTH / YEAR). For CALCULATION type it's represent daily / weekly / monthly / yearly average. | -| interval | TimeStep | Interval in which the data will be searched (DAY / WEEK / MONTH / YEAR) | -| period | CustomPeriod | Use to define a specific period for the interval { day? / month? / year? }. If not assigned the period will be the last interval (example: last week) | -| result | UserQuizState | Indicate the state of the custom question (UNLOCKED, CORRECT, UNCORRECT) | +| Field | Type | Description | +| ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| type | CustomQuestionType | Type of custom qusetion: DATE or MAXLOAD or AVERAGE. | +| timeStep | TimeStep | Time step of the result value (DAY / WEEK / MONTH / YEAR). For MAXLOAD or AVERAGE type, it represents daily / weekly / monthly / yearly average. | +| interval | TimeStep | Interval in which the data will be searched (DAY / WEEK / MONTH / YEAR) | +| period | CustomPeriod | Case day / month / year:<br/>Use to define a specific period for the interval { day? / month? / year? }. <br/>Case weekday:<br/>Only usable with AVERAGE type and DAY timestep: Allow to specify a weekday on which average is made. If used with another type, period will not be taken into account.<br/>If not assigned the period will be the last interval (example: last week) | +| singleFluid | boolean | Indicate if all connected fluid should be taken into account.<br/>If set to true only the first connected fluid will be taken into account in this order: electricity, gas, water. #unit and #fluid in the question label will be replace by the unit and the name of the fluid | +| result | UserQuizState | Indicate the state of the custom question (UNLOCKED, CORRECT, UNCORRECT) | Calculation of custom question is done by conbinaison of all parameters: -#### Type DATA +#### Type DATE - If _period_ is empty. -Retrieve the **max load** of day/month/year (define by _timeStep_) from the last week, month, year (define by _interval_). -=> example: What day did I consumme the most on the last week ? -type = CustomQuestionType.DATA -timeStep = TimeStep.DAY -interval = TimeStep.WEEK -period = {} + Retrieve the **date** of day/month/year (define by _timeStep_) from the last week, month, year (define by _interval_). + + ``` + example: What day did I consumme the most on the last week ? + type = CustomQuestionType.DATA + timeStep = TimeStep.DAY + interval = TimeStep.WEEK + period = {} + singleFluid = false + ``` + + ``` + example: What day did I consumme the most #fluid in #unit on the last week ? + type = CustomQuestionType.DATA + timeStep = TimeStep.DAY + interval = TimeStep.WEEK + period = {} + singleFluid = true + ``` - If _period_ is not empty -Retrieve the **max load** of day/month/year (define by _timeStep_) from week, month, year (define by _interval_) of _period_ -=> example: What month did I consumme the most on year 2020 ? -type = CustomQuestionType.DATA -timeStep = TimeStep.MONTH -interval = TimeStep.YEAR -period = {year: 2020} + Retrieve the **date** of day/month/year (define by _timeStep_) from a week, month, year (define by _interval_) of _period_ + + ``` + example: What month did I consumme the most on year 2020 ? + type = CustomQuestionType.DATA + timeStep = TimeStep.MONTH + interval = TimeStep.YEAR + period = { year: 2020 } + singleFluid = false + ``` -#### Type CALCULATION +#### Type MAXLOAD - If _period_ is empty -Retrieve the **average** of day/month/year (define by _timeStep_) from the last week, month, year (define by _interval_). -=> example: Which is your daily average consumption on last week ? -type = CustomQuestionType.CALCULATION +Retrieve the **maxload** value of day/month/year (define by _timeStep_) from the last week, month, year (define by _interval_). + +``` +example: Which is your daily max consumption on the last week ? +type = CustomQuestionType.MAXLOAD timeStep = TimeStep.DAY interval = TimeStep.WEEK period = {} +singleFluid = false +``` - If _period_ is not empty -Retrieve the **average** of day/month/year (define by _timeStep_) from week, month, year (define by _interval_) of _period_ -=> example: Which is your daily average consumption on january ? -type = CustomQuestionType.DATA +Retrieve the **maxload** value of day/month/year (define by _timeStep_) from a week, month, year (define by _interval_) of _period_ + +``` +example: Which is your daily max consumption on january 2020 ? +type = CustomQuestionType.MAXLOAD timeStep = TimeStep.DAY interval = TimeStep.MONTH -period = {month: 1} +period = { month: 1, year: 2020 } +singleFluid = false +``` + +#### Type AVERAGE + +- If _period_ is empty + + Retrieve the **average** of day/month/year (define by _timeStep_) from the last week, month, year (define by _interval_). + + ``` + example: Which is your daily average consumption on last week ? + type = CustomQuestionType.AVERAGE + timeStep = TimeStep.DAY + interval = TimeStep.WEEK + period = {} + singleFluid = false + ``` + + - If _period_ is not empty + + Retrieve the **average** of day/month/year (define by _timeStep_) from a week, month, year (define by _interval_) of _period_ + + ``` + example: Which is your daily average consumption on january 2020 ? + type = CustomQuestionType.AVERAGE + timeStep = TimeStep.DAY + interval = TimeStep.MONTH + period = { month: 1, year: 2020 } + singleFluid = false + ``` + + - If _period_ is weekday + + Retrieve the **average** of the _weekday_ from a week, month, year (define by _interval_). + + ``` + example: Which is your daily average consumption on wednesdays of last month? + type = CustomQuestionType.AVERAGE + timeStep = TimeStep.DAY + interval = TimeStep.MONTH + period = { weekday: 3 } + singleFluid = false + ``` Then, two randoms answers are generated after defining the right answer. diff --git a/docs/ecolyo/functionalities/ecogesture.md b/docs/ecolyo/functionalities/ecogesture.md index cb9f8a51eb6bbab4ad4f25184b247b3e6974750d..14d1bdddcb9072ab8acabcec342e77ed83a0e53d 100644 --- a/docs/ecolyo/functionalities/ecogesture.md +++ b/docs/ecolyo/functionalities/ecogesture.md @@ -1,12 +1,20 @@ # Ecogesture +## Description + +An ecogesture is a gesture that encourages user to take action for reduce their own consumption. + +It includes different information such as icon, name, long and short description, its efficiency on the consumption and which fluid is affected. + +Also, an ecogesture can be used for an action challenge. + ## All ecogestures screen This screen display the full list of ecogestures. User can filter ecogesture by usage. ## Ecogestures filtered by profile -This screen display is based on a filtered ecogesture list that fit to the user profile type. +This screen display is based on a filtered ecogesture list that fit to the user profile type. The user can also filter ecogesture by usage. Following rules are used to filter the ecogesture: @@ -22,12 +30,15 @@ OR - the ecogesture has gas fluid and profile type has an individual heating which use gas fluid. ### Case ecogesture usage is ECS ->`ECS = Eau chaude sanitaire` + +> `ECS = Eau chaude sanitaire` We will display the ecogesture if: + - the ecogesture has electricity fluid and profile type has an individual hot water which use electricity fluid. OR + - the ecogesture has gas fluid and profile type has an individual hot water which use gas fluid. ### Case ecogesture usage is ECS @@ -50,4 +61,4 @@ We will display the ecogesture. ### Case ecogesture usage is air conditioning -We will NOT display the ecogesture. \ No newline at end of file +We will NOT display the ecogesture. diff --git a/docs/ecolyo/project_architecture/doctypes.md b/docs/ecolyo/project_architecture/doctypes.md index 2436f0d57245f9eeb713cd6c15a9a051f8e5ee39..8fe946e34f79543274929e788af7a6a6ed867cd0 100644 --- a/docs/ecolyo/project_architecture/doctypes.md +++ b/docs/ecolyo/project_architecture/doctypes.md @@ -4,21 +4,21 @@ 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: -- **half an hour** - use com.grandlyon.*.minute doctype -- **week** - use com.grandlyon.*.day doctype -- **day** - use com.grandlyon.*.day doctype -- **month** - use com.grandlyon.*.month doctype -- **year** - use com.grandlyon.*.year doctype +- **half an hour** - use com.grandlyon.\*.minute doctype +- **week** - use com.grandlyon.\*.day doctype +- **day** - use com.grandlyon.\*.day doctype +- **month** - use com.grandlyon.\*.month doctype +- **year** - use com.grandlyon.\*.year doctype ### Doctype Here are the available doctypes: -| Fluid type | Doctype wildcard | Doctypes | -| ------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Fluid type | Doctype wildcard | Doctypes | +| ------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | electricity fluid / enedis | **`com.grandlyon.enedis.*`** | **`com.grandlyon.enedis.minute`**<br>**`com.grandlyon.enedis.day`**<br>**`com.grandlyon.enedis.month`**<br>**`com.grandlyon.enedis.year`** | -| gaz fluid / grdf | **`com.grandlyon.grdf.*`** | **`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.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 @@ -56,19 +56,22 @@ This doctype is used to store all information about the user. ### Structure -| Field | Type | Description | -| ---------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| id | string | Profile id | -| 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 | -| explorationHash | string | Hash used to verify the content of exploration | -| isFirstConnection | boolean | Boolean used to inform if the user connects for the first time | -| 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 | +| Field | Type | Description | +| ------------------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| id | string | Profile id | +| 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 | +| explorationHash | string | Hash used to verify the content of exploration | +| isFirstConnection | boolean | Boolean used to inform if the user connects for the first time | +| lastConnectionDate | DateTime | Date of the last user connection | +| haveSeenLastAnalysis | boolean | Boolean used to inform if user has seen the last analysis | +| 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 | +| sendAnalysisNotification | boolean | Boolean used to inform if user has seen the analysis notification | +| monthlyAnalysisDate | DateTime | Date of the last monthly analysis | +| profileType | ProfileType | User consumption profile | +| isProfileTypeCompleted | boolean | Check if a user has completed his consumption profile | ### Example @@ -78,13 +81,35 @@ This doctype is used to store all information about the user. "challengeHash": "4cbcafe514788757c377534f1a407e022c29e38c", "duelHash": "48371ffabb2853b0503b882f11e1fa8e730bac76", "ecogestureHash": "9798a0aaccb47cff906fc4931a2eff5f9371dd8b", - "haveSeenLastReport": true, + "haveSeenLastAnalysis": true, "haveSeenOldFluidModal": false, "isFirstConnection": false, - "monthlyReportDate": "2021-01-03T00:00:00.000+01:00", + "lastConnectionDate": "2021-03-08T17:33:18.727Z", + "monthlyAnalysisDate": "2021-01-03T00:00:00.000+01:00", "quizHash": "11372a56c03edef1d6656f8a76d5ec457174f2c1", "explorationHash": "cdbc7a84d041318253a10b3cc0c02f9020c78c0b", - "sendReportNotification": false + "sendAnalysisNotification": false, + "profileType": { + "area": "123", + "coldWater": "individual", + "constructionYear": "between_1948_and_1974", + "cookingFluid": 0, + "floor": "not_applicable", + "hasInstalledVentilation": "yes", + "hasReplacedHeater": "yes", + "heating": "individual", + "hotWater": "individual", + "hotWaterEquipment": "solar", + "hotWaterFluid": 0, + "housingType": "individual_house", + "individualInsulationWork": [ + "roof_insulation" + ], + "occupantsNumber": 1, + "outsideFacingWalls": "2", + "warmingFluid": 0 + }, + "isProfileTypeCompleted": true } ``` @@ -100,33 +125,53 @@ This doctype is used to store ecogestures. ### 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 | +| Field | Type | Description | +| --------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id | string | ecogesture id | +| shortName | string | short name of the ecogesture | +| longName | string | long name of the ecogesture | +| longDescription | string | long description of the ecogesture | +| usage | Usage | usage of the ecogesture<br><br>_Usage enum:_<br>- _ALL = 0_<br>- _HEATING = 1_<br>- _AIR_CONDITIONING = 2_<br>- _ECS = 3_<br>- _COLD_WATER = 4_<br>- _ELECTRICITY_SPECIFIC = 5_<br>- _COOKING = 6_ | +| 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_ | +| impactLevel | number | impact level of the ecogesture | +| efficiency | number | efficiency of the ecogesture | +| difficulty | number | difficulty of the ecogesture | +| room | Room | room affected by the ecogesture<br><br>_Room enum:_<br>- _ALL = 0_<br>- _BATHROOM = 1_<br>- _KITCHEN = 2_<br>- _LAUNDRY = 3_<br>- _TOILET = 4_ | +| season | Season | season suited to the ecogesture<br><br>_Season enum:_<br>- _NONE = 'Sans saison'_<br>- _WINTER = 'Hiver'_<br>- _SUMMER = 'Eté'_ | +| equipment | boolean | used to know if one or more equipment are affected by the ecogesture | +| equipmentType | EquipmentType[] | equipment affected by the ecogesture<br><br>_EquipmentType enum:_<br>- _AIR_CONDITIONING = 0_<br>- _COMPUTER = 1_<br>- _MICROWAVE = 2_<br>- _OVEN = 3_<br>- _WASHING_MACHINE = 4_<br>- _DISHWASHER = 5_<br>- _COOKING_PLATES = 6_<br>- _DRYER = 7_<br>- _REFREGIRATOR = 8_<br>- _GARDEN = 9_<br>- _WATER_HEATER = 10_<br>- _FAN = 11_<br>- _CURTAIN = 12_<br>- _INTERNET_BOX = 13_<br>- _VENTILATION = 14_<br>- _FREEZER = 15_<br>- _BOILER = 16_<br>- _HYDRAULIC_HEATING = 17_ | +| equipmentInstallation | boolean | used to know if it is required an installation | +| investment | string or null | investment required | +| action | boolean | used to know if the ecogesture is used for action challenge | +| actionName | string or null | action description of the ecogesture | +| actionDuration | number | duration required to do an action challenge | ### 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", + "shortName": "Déesse des eaux", + "longName": "Je coupe l'eau de la douche pendant que je me savonne.", + "longDescription": "Si vous n’êtes pas frileux, coupez l'eau pendant que vous vous savonnez : l'économie en eau peut aller jusqu'à 50% !", + "usage": 3, "fluidTypes": [ - 0 + 1 + ], + "impactLevel": 5, + "investment": null, + "room": [ + 1 ], - "nwh": 6, - "pack": 8 + "difficulty": 1, + "efficiency": 4, + "season": "Sans saison", + "action": true, + "actionDuration": 3, + "actionName": "Je coupe l'eau de la douche pendant que je me savonne.", + "equipment": false, + "equipmentInstallation": true, + "equipmentType": [], + } ``` @@ -193,6 +238,7 @@ This doctype is used to store all additionnal information about a challenge star | progress | ChallengeProgress | Number of stars earned by the user for each challenge<br><br>ChallengeProgress enum<br>- _quizzProgress: number_<br>- _explorationProgress: number_<br>- _actionProgress: number_ | | quiz | UserQuiz | Complete Quiz object with progress | | exploration | UserExploration | Complete Exploration object with progress | +| action | UserActionEntity | Complete Action object | | 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 | @@ -335,6 +381,51 @@ This doctype is used to store all additionnal information about a challenge star "target": 3, "type": 2 }, + "action": { + "ecogesture": { + "_id": "ECOGESTURE0004", + "_rev": "3-da2ad5c7b81e4260e2254c98ec6ee971", + "_type": "com.grandlyon.ecolyo.ecogesture", + "action": true, + "actionDuration": 3, + "actionName": "Je coupe l'eau de la douche pendant que je me savonne.", + "cozyMetadata": { + "createdAt": "2021-03-08T09:52:41.029Z", + "createdByApp": "Ecolyo", + "createdByAppVersion": "1.0.4", + "metadataVersion": 1, + "updatedAt": "2021-03-08T09:52:41.029Z", + "updatedByApps": [ + { + "date": "2021-03-08T09:52:41.029Z", + "slug": "Ecolyo", + "version": "1.0.4" + } + ] + }, + "difficulty": 1, + "efficiency": 2.5, + "equipment": false, + "equipmentInstallation": true, + "equipmentType": [], + "fluidTypes": [ + 1 + ], + "id": "ECOGESTURE0004", + "impactLevel": 5, + "investment": null, + "longDescription": "Si vous n’êtes pas frileux, coupez l'eau pendant que vous vous savonnez : l'économie en eau peut aller jusqu'à 50% !", + "longName": "Je coupe l'eau de la douche pendant que je me savonne.", + "room": [ + 1 + ], + "season": "Sans saison", + "shortName": "Déesse des eaux", + "usage": 3 + }, + "startDate": "2021-03-09T17:57:44.600Z", + "state": 1 + }, "startDate": "2021-01-04T00:00:00.000Z", "state": 3, "success": 0, @@ -440,7 +531,8 @@ This doctype is used to store all quiz. "type": 0, "timeStep": 20, "interval": 30, - "period": {} + "period": {}, + "singleFluid": true } } ``` diff --git a/docs/ecolyo/project_architecture/environments.md b/docs/ecolyo/project_architecture/environments.md index 2f4f692dba5c6228a0130fccce621b4c7e2d7452..d59d44fef479a3f6d4435d0929c1ad1b5146f300 100644 --- a/docs/ecolyo/project_architecture/environments.md +++ b/docs/ecolyo/project_architecture/environments.md @@ -1,2 +1,74 @@ -!!! info "" - :construction: Section under Construction :construction: \ No newline at end of file +# Environments + +We have 2 environments available for this project: +- One environment of dev hosted on scaleway and manage by the dev team +- One environment of production hosted on Cozy and manage by Cozy + +## Dev environment aka alpha + +The dev environnment has been mounted on a dedicated instance on scaleway. + +### Cozy stack + +It is based on the easy-cozy project available on GitLab: https://forge.grandlyon.com/pocs/cozy/easy-cozy + +On the server, the .env file has been initialize with the good secrets (see the .env.template) and also initialize to create instance with Ecolyo and the 3 needed konnectors by default. + +This projet will build and run 3 images: +- the cozy stack +- the couch db +- keycloack + +To run the project please refer to the documentation on the GitLab project. + +Once the project is up and running, we are able to create, update and delete instance. +Let's see more details in the [dedicated section](../../easycozy/scripts.md). + +### Proxy + +Konnector for Ecolyo need proxy for the OAuth dance. The proxy is also mount on the same instance as the Cozy stack and based on the project available on GitLab: https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy + +The proxy is written in Go language. The "main.go" file containt all the source code and also the default variables. +Default variables are the one used for the dev environment but we will be overwrite for the production. + +To Launch the proxy, just pull the project and use the docker-compose file with following commands: +``` +git pull https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy +cd cozy-oauth-proxy +docker-compose up -d +``` + +### Ecolyo and konnectors + +By default the version present on the "build-dev" branch is used to install Ecolyo app and konnectors on a new instance. + +Some scripts has been created in order to install, update, downgrade, remove app and konnectors. Please refer to the [dedicated section](../../easycozy/scripts.md) for more information. + +## Prod environment + +This environment is fully managed by Cozy team. + +### Cozy stack + +Fully managed by Cozy team. + +### Proxy + +A dedicated proxy is deployed on Cozy side to allow konnector to make the OAuth dance. +The proxy deployed is based on the project available on the GitLab but variables are overwrite using flags by the Cozy team in order to fit to the environment. + +For each modification in production, it needs: +- to be done on the gitLab project +- to be testeded in dev environnment +After that we should ask Cozy to pull the modification from the GitLab in order to have them in production. + +### Ecolyo and konnectors + +The production environment is based on the build branch which should reflect the build of sources present on master branch. + +Each deployment is done manually for each app/konnector by: +- building the application (yarn build) +- deploy the build on the build branch (yarn deploy) +- publishing content of build branch into Cozy repo (yarn cozyPublish) + +Once it is published, Cozy team should validate it before deploying the new app version into all Cozy Grand Lyon instances. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 3cba0b683f7d775e1bf19a3e68677e7b4f10bc08..cf02ac924d31310ee3491e4ed057362faad9c735 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,6 +24,9 @@ extra_css: nav: - Home: index.md + - Easy Cozy: + - Scripts: easycozy/scripts.md + - Commands: easycozy/commands.md - Pilote: - Pilote - TS - Back: - Index: pilote/Pilote - TS - Back/index.md