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

Add terms consent doc

parent 5ef84aec
No related branches found
No related tags found
No related merge requests found
Pipeline #15789 passed
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. ...@@ -56,22 +56,23 @@ This doctype is used to store all information about the user.
### Structure ### Structure
| Field | Type | Description | | Field | Type | Description |
| ------------------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | ------------------------ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| id | string | Profile id | | id | string | Profile id |
| ecogestureHash | string | Hash used to verify the content of ecogestures | | ecogestureHash | string | Hash used to verify the content of ecogestures |
| challengeHash | string | Hash used to verify the content of challenges | | challengeHash | string | Hash used to verify the content of challenges |
| duelHash | string | Hash used to verify the content of duels | | duelHash | string | Hash used to verify the content of duels |
| quizHash | string | Hash used to verify the content of quiz | | quizHash | string | Hash used to verify the content of quiz |
| explorationHash | string | Hash used to verify the content of exploration | | explorationHash | string | Hash used to verify the content of exploration |
| isFirstConnection | boolean | Boolean used to inform if the user connects for the first time | | isFirstConnection | boolean | Boolean used to inform if the user connects for the first time |
| lastConnectionDate | DateTime | Date of the last user connection | | lastConnectionDate | DateTime | Date of the last user connection |
| haveSeenLastAnalysis | boolean | Boolean used to inform if user has seen the last analysis | | 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 | | 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 | | sendAnalysisNotification | boolean | Boolean used to inform if user has seen the analysis notification |
| monthlyAnalysisDate | DateTime | Date of the last monthly analysis | | monthlyAnalysisDate | DateTime | Date of the last monthly analysis |
| profileType | ProfileType | User consumption profile | | profileType | ProfileType | User consumption profile |
| isProfileTypeCompleted | boolean | Check if a user has completed his 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 ### Example
...@@ -109,7 +110,8 @@ This doctype is used to store all information about the user. ...@@ -109,7 +110,8 @@ This doctype is used to store all information about the user.
"outsideFacingWalls": "2", "outsideFacingWalls": "2",
"warmingFluid": 0 "warmingFluid": 0
}, },
"isProfileTypeCompleted": true "isProfileTypeCompleted": true,
"showConsentModal": true
} }
``` ```
...@@ -619,10 +621,29 @@ This doctype is used to store all usage events. ...@@ -619,10 +621,29 @@ This doctype is used to store all usage events.
### Structure ### Structure
| Field | Type | Description | | Field | Type | Description |
| ----------- | ---------------- | -------------------------------------- | | ------- | -------------- | ------------------------------------------------------------------------------------------ |
| date | DateTime | Date of the event | | date | DateTime | Date of the event |
| type | UsageEventType | Type of the event | | type | UsageEventType | Type of the event |
| target | string | Targeted konnector, page, challenge, quiz, exploration, action or timeStep | | target | string | Targeted konnector, page, challenge, quiz, exploration, action or timeStep |
| result | string | Result for KonnectorConnectEvent or KonnectorRefreshEvent.<br>Values: "success" or "error" | | result | string | Result for KonnectorConnectEvent or KonnectorRefreshEvent.<br>Values: "success" or "error" |
| context | string | Luxon Duration of the duel | | context | string | Luxon Duration of the duel |
\ No newline at end of file
## 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 |
...@@ -66,6 +66,7 @@ nav: ...@@ -66,6 +66,7 @@ nav:
- Analysis: ecolyo/functionalities/analysis.md - Analysis: ecolyo/functionalities/analysis.md
- Usage events tracking: ecolyo/functionalities/usage_events_tracking.md - Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
- Feedback: ecolyo/functionalities/feedback.md - Feedback: ecolyo/functionalities/feedback.md
- Terms: ecolyo/functionalities/terms.md
- Pilote: - Pilote:
- Pilote - TS - Back: - Pilote - TS - Back:
- Index: pilote/Pilote - TS - Back/index.md - Index: pilote/Pilote - TS - Back/index.md
......
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