From 05c095bb3809ed15e3874a7b1208cdb67dfbf103 Mon Sep 17 00:00:00 2001 From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com> Date: Fri, 25 Feb 2022 17:39:01 +0100 Subject: [PATCH] feat: review consumption rules --- docs/ecolyo/functionalities/consumption.md | 121 +++++++++++++++++---- 1 file changed, 97 insertions(+), 24 deletions(-) diff --git a/docs/ecolyo/functionalities/consumption.md b/docs/ecolyo/functionalities/consumption.md index 0cf120a..527b78d 100644 --- a/docs/ecolyo/functionalities/consumption.md +++ b/docs/ecolyo/functionalities/consumption.md @@ -28,13 +28,12 @@ For Enedis, the interval is **3 days** For GRDF, the interval is **5 days** For EGL, the interval is **5 days** - ## ConsumptionView ### Description This view is the main view of the application. It displays an agreggation view of all connected fluids. -It is the entrypoint to several children components that each handles a particular feature : +It is the entrypoint to several children components that each handles a particular feature : - DateNavigator - FluidButtons @@ -44,17 +43,15 @@ It is the entrypoint to several children components that each handles a particul The submenu (FluidButtons), allows the user to switch between the different fluids and the multifluid view. - ### Rules -1. If no fluids are connected, this view will display the multifluid view with the *KonnectorViewerList* component which shows buttons that allow user to connect its first fluids. These buttons redirects to the chosen fluid section with the connection form. +1. If no fluids are connected, this view will display the multifluid view with the _KonnectorViewerList_ component which shows buttons that allow user to connect its first fluids. These buttons redirects to the chosen fluid section with the connection form. 2. If at least one fluid is connected, the multi fluid view and the connected fluids views are shown (electricity, water, gas). 3. For the multifluid view, Fluids are displayed in multi fluid color and in euro 4. Fluid is displayed in the given fluid color and unit (kWh for electricity and gaz, l for water) 5. TimeStep available are the folowing: week, month, year, 5 years and day for electricity fluid 6. If user has selected day time step and change the fluid, the week time step will be selected by default. - ## DateNavigator ### Description @@ -90,37 +87,113 @@ It is splitted in 3 distinct parts: - The FluidSlides - The TimeStep Navigator - ### Rules -| Component | Rules | -| ----------- | ------------------------------ | -| ConsumptionVisualizer | <ul><li>Calls the *DataloadConsumptionVisualizer* component that shows the dataload of the selected timeStep and fluid</li><li>For multifluid, we show the total consumption of all connected fluid, and the consumption fluid by fluid, all in €</li><li>We display a message according to the data state as explained in the [DataLoad Consumption Visualizer](./#dataload-consumption-visualizer)</li></ul>| -|FluidSlides | This component calls the fluidSwipe component which is handled by the library *react-swipeable-views*, and allows the user to swipe accross the selected timestep. This library loads the slides before and after the current slide, so we reduce the loading time between slides.| -|TimeStepSelector| This component allows the user to change the current Timestep, or to return to today's date with a button| +| Component | Rules | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ConsumptionVisualizer | <ul><li>Calls the _DataloadConsumptionVisualizer_ component that shows the dataload of the selected timeStep and fluid</li><li>For multifluid, we show the total consumption of all connected fluid, and the consumption fluid by fluid, all in €</li><li>We display a message according to the data state as explained in the [DataLoad Consumption Visualizer](./#dataload-consumption-visualizer)</li></ul> | +| FluidSlides | This component calls the fluidSwipe component which is handled by the library _react-swipeable-views_, and allows the user to swipe accross the selected timestep. This library loads the slides before and after the current slide, so we reduce the loading time between slides. | +| TimeStepSelector | This component allows the user to change the current Timestep, or to return to today's date with a button | ## DataLoad Consumption Visualizer ### Description This view displays the load of a specified fluid (electricity, water, gas) or the total consumption on the multifluid screen. -It also allows to navigate between the singlefluid views. - -### Rules - -1. The Load is displayed in the given fluid color and unit (kWh for electricity and gaz, l for water) -2. For the dataloads > 1000, it will display a mega unit (MWh for electricity and gaz, m3 for water) -3. If it's multifluid view, we show the total consumption in € -4. While the last data date is between today's date and the interval mentionned above : we consider the data as *upcoming* -5. If the last data date is before the interval (eg: lastDataDate = 8 days) : we consider the data as *outdated* -6. If the a data is missing but there is other data after: we consider the data as *missing*, which means it is probably the supplier's fault or the customer's device -7. If a user visualizes a consumption after the last data date, we show a link to the last data date - +The display will be done in function of the data state. + +### Rules to define data state + +The data state is define in the "ConsumptionFormatter" service following theses rules : + +#### For single fluid + +| Condition | State | +| -------------------------------------------------------------------------------- | -------- | +| Before the first data available | EMPTY | +| Between the first and last data available & value of load is not empty | VALID | +| Between the first and last data available & value of load is empty | HOLE | +| After the last data available & Before today & in the dataDelayOffset period | UPCOMING | +| After the last data available & Before today & not in the dataDelayOffset period | MISSING | +| After today | COMING | + +#### For multifluid + +| Condition | State | +| ------------------------------------------------------------------------------------------------- | ------------------------------- | +| All fluids have empty data | AGGREGATED_EMPTY | +| At least one fluid have a data and another fluids with empty data | AGGREGATED_WITH_EMPTY | +| All fluids have valid data | AGGREGATED_VALID | +| All fluid have a hole or missing data | AGGREGATED_HOLE_OR_MISSING | +| At least one fluid have a data and another fluids with a missing or hole data | AGGREGATED_WITH_HOLE_OR_MISSING | +| At least one fluid have upcoming or coming data and other fluid doesn’t have missing or hole data | AGGREGATED_WITH_COMING | +| All fluid have coming data | AGGREGATED_COMING | + +### Display of the specific cases (component: DataloadNoValue) + +This display appear instead of the traditionnal one (described below). It is used to display a general message which override the value. Here are the rules : +| Condition | Displayed label | Comments | +| --- | --- | --- | +| Single fluid && dataload state = EMPTY | Pas de données | | +| Single fluid && dataload state = VALID | - | | +| Single fluid && dataload state = HOLE | Pas de données | | +| Single fluid && dataload state = MISSING | Données manquantes | Displayed in red and clickable (scroll to the konnector card) | +| Single fluid && dataload state = UPCOMING | À venir | | +| Single fluid && dataload state = COMING | À venir | | +| Multi fluid && dataload state = AGGREGATED_EMPTY | Pas de données | | +| Multi fluid && dataload state = AGGREGATED_WITH_EMPTY | - | | +| Multi fluid && dataload state = AGGREGATED_VALID | - | | +| Multi fluid && dataload state = AGGREGATED_WITH_COMING | - | | +| Multi fluid && dataload state = AGGREGATED_HOLE_OR_MISSING | Données manquantes | | +| Multi fluid && dataload state = AGGREGATED_WITH_HOLE_OR_MISSING | - | | +| Multi fluid && dataload state = AGGREGATED_COMING | À venir | | + +### Display of the load values + +In function of the fluid type (single or multi) and of the data state, the display will be adapted. + +#### Display of the main value (component: DataloadSectionValue) + +Used to display the load or price in function of following rules : + +| Condition | Displayed information | +| -------------------------------------- | ---------------------------------------------------------------------------------------- | +| Single fluid && dataload value < 1000 | Display the load | +| Single fluid && dataload value >= 1000 | Display the load in Mega unit | +| Multifluid without comparison | Display the load converted in euro and a link to display the Estimated Modal information | +| Multifluid with comparison | Display the load converted in euro | + +#### Display of the detail value (component: DataloadSectionDetail) + +Used to display the detail just below the main value. The information displayed are : +| Condition | Displayed information | +| -------------------------------------- | ---------------------------------------------------------------------------------------- | +| Single fluid | Display the load converted in euro | +| Multifluid without comparison | Display the load converted in euro for each available fluid | +| Multifluid with comparison | Display nothing | + +### Information (component: InfoDataConsumptionVisualizer) + +In addition of the value / load / message displayed, we can displayed an additionnal information. +| Condition | Displayed label | Comments | +| --- | --- | --- | +| Single fluid && dataload state = EMPTY | Pourquoi n’ai-je pas de données ? | | +| Single fluid && dataload state = VALID | - | | +| Single fluid && dataload state = HOLE | Pourquoi n’ai-je pas de données ? | | +| Single fluid && dataload state = MISSING | Dernières données disponibles : XX/XX/XX | | +| Single fluid && dataload state = UPCOMING | Dernières données disponibles : XX/XX/XX | | +| Single fluid && dataload state = COMING | Dernières données disponibles : XX/XX/XX | | +| Multi fluid && dataload state = AGGREGATED_EMPTY | Pourquoi n’ai-je pas de données ? | | +| Multi fluid && dataload state = AGGREGATED_VALID | - | | +| Multi fluid && dataload state = AGGREGATED_WITH_COMING | - | | +| Multi fluid && dataload state = AGGREGATED_HOLE_OR_MISSING | Dernières données complètes : XX/XX/XX | | +| Multi fluid && dataload state = AGGREGATED_WITH_HOLE_OR_MISSING | Dernières données complètes : XX/XX/XX | | +| Multi fluid && dataload state = AGGREGATED_COMING | Dernières données complètes : XX/XX/XX | | ## Comparison The user can compare its data with a previous period using a switch which will display the previous period on the same chart. -The chart scale will adapt to the max load displayed between the *actualData* and the *comparisonData* +The chart scale will adapt to the max load displayed between the _actualData_ and the _comparisonData_ ## Konnector Viewer Card -- GitLab