Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • web-et-numerique/factory/llle_project/self-data-technical-doc
1 result
Select Git revision
Show changes
Commits on Source (3)
......@@ -34,6 +34,13 @@ $ yarn deploy-dev
$ yarn deploy
```
## Auto deploy for dev
In order to prevent manual action for deployment, a gitlab-runner has been configured to deploy every changes on the `dev` branch on our test [env](https://ecolyo.ecolyodemo.cozy.self-data.alpha.grandlyon.com/)
!!! info "cicd scripts"
You can find all scripts used in cicd jobs on the following [repo](https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo-infra-scripts)
## Deploy build-test branch to one Scaleway instance for testing
You can directly use the content of build-test branch to update one instance for test purpose.
......@@ -60,4 +67,3 @@ $ yarn cozy-app-publish --token $REGISTRY_TOKEN --build-url https://forge.grandl
```
More information at [cozy-app-publish/](https://docs.cozy.io/en/cozy-app-publish/)
This section explains the way we handle terms in the application.
## Description
The terms version is handled with the _io.cozy.terms_ doctype. It is incremented each time we edit the CGU, the data consent validation or the legal notices. Once we increment the terms version, the user will be prompted to accept these terms, otherwise we won't be able to access the app.
### Private Routes
All routes are private, and are accessible only if the user has accepted the last version of the terms.
The only public routes are :
- _/terms_ : shows the terms validation page, and is the main page the user is redirected to if his consent is outdated
- _/cgu_ : shows the CGU public page, accessible by the terms page
- _/legal_ : shows the Legal Notice public page, accessible by the terms page
### Terms managment
We check the terms acceptation in the **SplashScreen** while the application is initializing, if there is no consent (first connexion), or the consent is outdated (update of terms), the user will be redirected to the terms acceptation page.
User has to check the two checboxes (one for Data share consent, and one for CGU and Legal Notice) to unlock the terms acceptation button. Once he has accepted it, a new term doctype is created with the value _accepted_ to true. So he can access now the entire application.
We store in user's profile a boolean _showConsentModal_ that allows the app to know about the consent status.
### Version number
The version number of the last terms is stored in the **config.json** file. If this version number doesn't correspond with the last term accepted, the user won't be able to access the app and wil be prompted to accept new terms.
......@@ -56,22 +56,23 @@ 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 |
| 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 |
| 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 |
| showConsentModal | boolean | Boolean used to show the terms acceptation page, and to protect the app private routes if last terms are not accepted or outdated |
### Example
......@@ -109,7 +110,8 @@ This doctype is used to store all information about the user.
"outsideFacingWalls": "2",
"warmingFluid": 0
},
"isProfileTypeCompleted": true
"isProfileTypeCompleted": true,
"showConsentModal": true
}
```
......@@ -619,10 +621,29 @@ This doctype is used to store all usage events.
### Structure
| Field | Type | Description |
| ----------- | ---------------- | -------------------------------------- |
| date | DateTime | Date of the event |
| type | UsageEventType | Type of the event |
| target | string | Targeted konnector, page, challenge, quiz, exploration, action or timeStep |
| result | string | Result for KonnectorConnectEvent or KonnectorRefreshEvent.<br>Values: "success" or "error" |
| context | string | Luxon Duration of the duel |
\ No newline at end of file
| Field | Type | Description |
| ------- | -------------- | ------------------------------------------------------------------------------------------ |
| date | DateTime | Date of the event |
| type | UsageEventType | Type of the event |
| target | string | Targeted konnector, page, challenge, quiz, exploration, action or timeStep |
| result | string | Result for KonnectorConnectEvent or KonnectorRefreshEvent.<br>Values: "success" or "error" |
| context | string | Luxon Duration of the duel |
## Terms
### Description
This doctype is used to store the different version of the terms of the application.
### Doctype
**`io.cozy.terms`**
### Structure
| Field | Type | Description |
| ---------- | -------- | ----------------------------------------------------------------- |
| accepted | boolean | The fact that the terms has been accepted by the Cozy user or not |
| acceptedAt | DateTime | The date when the Cozy user accepted these terms |
| termsId | string | The id of the terms |
| version | string | The version number |
......@@ -2,6 +2,7 @@
This konnector fetches consumptions measures from EGL API.
The EGL API allows us to get a user's consumption data gathered by it's connected water meter "Téléo".
You can clone the project [here](https://forge.grandlyon.com/web-et-numerique/llle_project/egl-konnector).
You should also check Cozy's official documentations for konnectors :
......@@ -40,7 +41,7 @@ Authentication Route : **/connect.asp**
}
```
Once you've sent this request the API should answer with a code 100 if everything is ok and provides you a valid **_token_** and **_num_abt_** that you will use later in order to get data.
Once you've sent this request the API should answer with a code 100 if everything is ok and provides you a valid **token** and **num_abt** that you will use later in order to get data.
```json
{
......@@ -59,18 +60,7 @@ In order to get data from the EGL API we have to request the following route :
Method : **POST**
Authentication Route : **/getAllAgregatsByAbonnement.aspx**
```json
"body":
{
"mode": "formdata"
{
"login": <your-login>,
"pass": <your-password>
}
}
```
Data Route : **/getAllAgregatsByAbonnement.aspx**
```json
......@@ -88,7 +78,7 @@ Authentication Route : **/getAllAgregatsByAbonnement.aspx**
The dates must be valid dates otherwise you'll get an error
There answer will provides you an array of data day by day with the value got by the water meter 'ValeurIndex' at this moment.
The answer will provide you an array of data day by day with the value got by the water meter 'ValeurIndex' at this moment.
```json
{
......@@ -109,16 +99,15 @@ There answer will provides you an array of data day by day with the value got by
}
```
You'll have to subtract a day value with the previous's to get a consumption for a given day.
Daily data is calculated by substracting current valeurIndex day with previous day.
### TypeAgregats
- "R", means the real value
- "A", means an anomaly
- "D", means a water meter changing
- "V"
- "X"
- "T", means pending data
- "R" means the real value
- "A" means an anomaly
- "D" means a water meter changing
- "V" means data has been estimated on a period
- "X" marks the start and end of "V" estimated data
- "T" means pending data
If you're looking for more information about the API, checkout the [complete API documentation](/documents/egl-api-doc.pdf)
......
......@@ -7,7 +7,7 @@ You should also check Cozy's official documentations for konnectors :
## Grdf Adict Konnector
The Oauth protocol does not take place in the konnector code, therefore it is also important to take a look at the [proxy](/proxy/description.md) to fully understand all the interactions that will be told below.
The Oauth protocol does not take place in the konnector code, therefore it is also important to take a look at the [proxy](/proxy/description.md) documentation to fully understand all the interactions that will be told below.
All the actions performed by the stack are targetted from pre-registered paramaters, here is the list of all parameters needed by the stack to perform the Oauth protocol and allow the konnector to fetch data.
......
......@@ -46,12 +46,10 @@ nav:
- Deploy: ecolyo/application/deploy.md
- Description: ecolyo/application/description.md
- Gitflow: ecolyo/application/gitflow.md
- Mail: ecolyo/application/mail.md
- Redux: ecolyo/application/redux.md
- Release: ecolyo/application/release.md
- Scaffolding: ecolyo/application/scaffolding.md
- Gitflow: ecolyo/application/gitflow.md
- Deploy: ecolyo/application/deploy.md
- Mail: ecolyo/application/mail.md
- Services:
- Description: ecolyo/services/index.md
- Monthly report notification: ecolyo/services/monthly_report_notification.md
......@@ -66,6 +64,7 @@ nav:
- Analysis: ecolyo/functionalities/analysis.md
- Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
- Feedback: ecolyo/functionalities/feedback.md
- Terms: ecolyo/functionalities/terms.md
- Pilote:
- Pilote - TS - Back:
- Index: pilote/Pilote - TS - Back/index.md
......