From cdf727b77b3262165af83e7df90c9489a1c6e02d Mon Sep 17 00:00:00 2001 From: Bastien Dumont <bdumont@grandlyon.com> Date: Wed, 17 Apr 2024 11:41:39 +0200 Subject: [PATCH] feat(ecogestures): update outdated information and add score calculation --- docs/ecolyo/Functionalities/ecogesture.md | 114 ++++++++++++---------- docs/ecolyo/Technical/doctypes.md | 4 +- 2 files changed, 62 insertions(+), 56 deletions(-) diff --git a/docs/ecolyo/Functionalities/ecogesture.md b/docs/ecolyo/Functionalities/ecogesture.md index afda91c..3f0e196 100644 --- a/docs/ecolyo/Functionalities/ecogesture.md +++ b/docs/ecolyo/Functionalities/ecogesture.md @@ -8,88 +8,94 @@ It includes different information such as icon, name, long and short description Also, an ecogesture can be used for an action challenge. -### Model - -```ts -Ecogesture { - id: string - shortName: string - longName: string - longDescription: string - usage: Usage - fluidTypes: FluidType[] - impactLevel: number - efficiency: number - difficulty: number - room: Room[] - season: Season - equipment: boolean - equipmentType: EquipmentType[] - equipmentInstallation: boolean - investment: string | null - action: boolean - actionName: string | null - actionDuration: number - objective: boolean - doing: boolean - viewedInSelection: boolean -} -``` +[Ecogesture model](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/blob/dev/src/models/ecogesture.model.ts#L3) + +## Order and filtering + +### Not applied + +The ecogestures are filtered depending on the user's equipments and usage. + +:::note example +If the user doesn't have a specific equipment, the ecogestures related to this equipment are not displayed. +::: + +### Score + +They also have a score depending on the current season. + +The score is calculated as follows: + +:::danger Score calculation +SCORE = EFFICIENCY * 2 - DIFFICULTY +::: + +:::tip Season adjustment + +The score is adjusted with the current season. If the current season is the opposite of the season of the ecogesture, the score is 0. Example: + +- During winter, ecogestures for air conditioning have a score of 0 and are displayed at the bottom of the list. +- During summer, ecogestures for heating have a score of 0 and are displayed at the top of the list. +- During spring and autumn, ecogestures no bonus or malus is applied. +- If the current season matches the season of the ecogesture, **a bonus of 1 is added** to the score. + +::: ## Ecogestures screen -This screen is divided in 3 tabs : +The former "ecogestures" has been renamed to "Astuces". It contains 3 tabs : + +- **OBJECTIVES**: display the list of objectives ecogestures. +- **DOING**: display the list of doing ecogestures. +- **ALL**: display the full list of ecogestures. -- *ALL*: display the full list of ecogestures. User can filter ecogesture by usage. -- *DOING*: display the list of doing ecogestures. User can filter ecogesture by usage. -- *OBJECTIVES*: display the list of objectives ecogestures. User can filter ecogesture by usage. +Each tab can be filtered by usage. -### RULES +### Navigation rules -- By default the *ALL* tab is selected. -- If user click on an ecogesture, he will see more information about it and will be able to choose manually if it is *doing* AND/OR *objective* +- By default the **OBJECTIVES** tab is selected. +- If user click on an ecogesture, he will see details about it and will be able to update its status. - The back arrow button on a single ecogesture returns to the tab he came through. ### Ecogesture Status -An ecogesture can have a status according the user's choice, it can be *doing* and/or *objective* which allows the user to consult them in the related tabs in the ecogesture page. On it is selected by the user in the tinder-like tunnel, the *viewedInSelection* key is set to true, so the user won't see it again in its selection. +An ecogesture can have a status according the user's choice, it can be **doing** OR **objective** which allows the user to consult them in the related tabs in the ecogesture page. ## Profile Ecogesture -The first time the user consults the ecogesture page, he will be prompted to start selecting his custom ecogestures. +The first time the user consults the ecogesture page, he will be prompted to add informations about his profile to get personalized ecogesture. -- If he refuses, I will still be able to access this functionality by clicking on the "Select" button on the tabs 'Doing' and 'Objectives' while they are still empty. -- If he starts select ecogestures on his own by the tab 'All' and fill both 'objective' and 'doing' sections, he won't be able to access the form and selection as described in the next parts. +- If he refuses by clicking on "Voir toutes les astuces", he will be redirected to the "All" tab. +- If he accepts by clicking on "Sélectionner", he will be redirect to the Ecogesture Form. -### Model - -```ts -ProfileEcogesture { - heating: IndividualOrCollective - warmingFluid: WarmingType | null - hotWater: IndividualOrCollective - equipments: EquipmentType[] -} -``` +[Profile Ecogesture Model](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/blob/dev/src/models/profileEcogesture.model.ts#L4) ### Ecogesture Form -The form is compose in 2 parts : +The form is composed in 4 steps : + +- heating, collective or individual +- heating fluid type, electricity, gas, fuel... +- hot water, collective or individual +- equipments -- The first is made of question concerning his heating fluid and type (individual or collective), and his hotWater type. -- The second part asks the user to pick the equipment he has. +:::important "Ecogesture Form vs Profile Form" -*If the user has completed his profileType, he won't see the first part as it is automatically completed with the information he filled in his profileType:* +If the user has completed his profileType, he won't see the Ecogesture Form as it is automatically completed with the information he filled in his profileType: - The first part filters his custom list by Usages ECS and HEATING - The second part filters his custom list by Equipments +::: + ## Ecogesture Selection -Once user has completed his profile ecogesture through the form, he has the possibility to enter the ecogesture selection (tinder-like) +Once the user has completed his profile ecogesture through the form, he will go to the ecogesture selection (/ecogesture-selection). - A list of custom ecogesture is made according to his profile -- User will cross this list 10 by 10, and has to choose if it is 'doing' 'objective' or 'not interested +- User will cross this list by sets of 10 ecogesture, and has to choose if it is "**doing**" "**objective**" or "**not interested**" + +When selecting a status, the field `viewedInSelection` is set to true, so the user won't see it again in its selection. ### Important Rules diff --git a/docs/ecolyo/Technical/doctypes.md b/docs/ecolyo/Technical/doctypes.md index 512f7a4..6399045 100644 --- a/docs/ecolyo/Technical/doctypes.md +++ b/docs/ecolyo/Technical/doctypes.md @@ -155,10 +155,10 @@ This doctype is used to store ecogestures. | 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* | +| room | Room | room affected by the ecogesture<br/><br/>*Room enum:*<br/>- *ALL*<br/>- *BATHROOM*<br/>- *KITCHEN*<br/>- *LAUNDRY*<br/>- *TOILET* | | season | Season | season suited to the ecogesture<br/><br/>*Season enum:*<br/>- *NONE = 'Sans saison'*<br/>- *WINTER = 'Hiver'*<br/>- *SUMMER = 'Été'* | | 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* | +| equipmentType | EquipmentType[] | equipment affected by the ecogesture<br/><br/>*EquipmentType enum:*<br/>- *AIR_CONDITIONING*<br/>- *COMPUTER*<br/>- *MICROWAVE*<br/>- *OVEN*<br/>- *WASHING_MACHINE*<br/>- *DISHWASHER*<br/>- *COOKING_PLATES*<br/>- *DRYER*<br/>- *REFREGIRATOR*<br/>- *GARDEN*<br/>- *WATER_HEATER*<br/>- *FAN*<br/>- *CURTAIN*<br/>- *INTERNET_BOX*<br/>- *VENTILATION*<br/>- *FREEZER*<br/>- *BOILER*<br/>- *HYDRAULIC_HEATING* | | 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 | -- GitLab