Skip to content
Snippets Groups Projects
Commit f5fc2264 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Merge branch 'master' of...

parents 794683fd 3ff7da6b
No related branches found
No related tags found
No related merge requests found
Pipeline #21916 passed
# Introduction # Introduction
## Newsletter
The goal is to send newsletters following this design : The goal is to send newsletters following this design :
![Architecture principles](/img/ecolyo-agent/newsletter-template.png) ![Architecture principles](/img/ecolyo-agent/newsletter-template.png)
There are 3 different sections : There are 4 different sections :
- subject : manages the mail subject
- monthlyInfo : contains a image URL and some global information - monthlyInfo : contains a image URL and some global information
- monthlyNews : contains an editable title and some information about the novelties - monthlyNews : contains an editable title and some information about the novelties
- poll : contains a question and a link to answer a survey - poll : contains a question and a link to answer a survey
\ No newline at end of file
## Partners issues
This section allow the admin to activate alerts in the ecolyo app when a partners API is down.
Admin has to activate the modal switch AND at least one fluid switch to make it work. He also has to set the switches to off position manually when the concerned APIs are back to normal
## Prices
This section manages the prices for each fluid in the ecolyo application.
### Rules
- The next price to create is automatically pre-selected by default
- Only the 2 last prices plus the one to create are editable, the others are just consultable
- Each fluid has its own date frequency :
- Electricity : one new price every 6 month (February and August)
- Water : one new price every year
- Gas : one new price every month
- When user creates a new price, the previous price's endDate is set to the new startDate minus 1 minute, so every prices keeps following in time.
\ No newline at end of file
...@@ -80,3 +80,65 @@ You should obtain the following messages: ...@@ -80,3 +80,65 @@ You should obtain the following messages:
Once the application is started, you can access it here: https://localhost Once the application is started, you can access it here: https://localhost
## Test on alpha
In order to test the app on alpha you can do the following steps:
- Build locally your docker image for the client and/or the server
```
docker build . -t registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-<server/client>:your-tag
```
- Push the image
```
docker push registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-<server/client>:your-tag
```
- Connect to alpha in ssh, go to ecolyo-agent > docker-compose.yml and change the image tag for client and/or server
- Then launch the app, it will pull automatically the new images
```
docker-compose up -d
```
- If you have access denied issue, try to docker login
```
docker login registry.forge.grandlyon.com/web-et-numerique/llle_project/
```
- If you want to update alpha using the same image tag with edited image, just pull manually your new image and rebuild the concerned image
```
docker pull registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-<server/client>:your-tag
docker-compose up -d
```
If you need to work with prices on alpha, you will need to init the prices database.
- First get the mysql container id
```
docker ps
```
- Then get into the container
```
docker exec -it <container-id> bash
```
- Then execute the mysql script that imports all the prices in DB
```
mysql --local-infile=1 -uroot -p backoffice < /dbinit/dbinit.sql
```
You will be prompted for the admin password, use the db password set in the .env file.
Now you're ready to edit your prices on alpha !
...@@ -28,13 +28,12 @@ For Enedis, the interval is **3 days** ...@@ -28,13 +28,12 @@ For Enedis, the interval is **3 days**
For GRDF, the interval is **5 days** For GRDF, the interval is **5 days**
For EGL, the interval is **5 days** For EGL, the interval is **5 days**
## ConsumptionView ## ConsumptionView
### Description ### Description
This view is the main view of the application. It displays an agreggation view of all connected fluids. 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 - DateNavigator
- FluidButtons - FluidButtons
...@@ -44,17 +43,15 @@ It is the entrypoint to several children components that each handles a particul ...@@ -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. The submenu (FluidButtons), allows the user to switch between the different fluids and the multifluid view.
### Rules ### 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). 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 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) 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 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. 6. If user has selected day time step and change the fluid, the week time step will be selected by default.
## DateNavigator ## DateNavigator
### Description ### Description
...@@ -90,37 +87,113 @@ It is splitted in 3 distinct parts: ...@@ -90,37 +87,113 @@ It is splitted in 3 distinct parts:
- The FluidSlides - The FluidSlides
- The TimeStep Navigator - The TimeStep Navigator
### Rules ### 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 ## DataLoad Consumption Visualizer
### Description ### Description
This view displays the load of a specified fluid (electricity, water, gas) or the total consumption on the multifluid screen. 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. The display will be done in function of the data state.
### Rules ### Rules to define data state
1. The Load is displayed in the given fluid color and unit (kWh for electricity and gaz, l for water) The data state is define in the "ConsumptionFormatter" service following theses rules :
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 € #### For single fluid
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* | Condition | State |
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 | 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 ## 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 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 ## Konnector Viewer Card
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment