diff --git a/docs/ecolyo/functionalities/terms.md b/docs/ecolyo/functionalities/terms.md new file mode 100644 index 0000000000000000000000000000000000000000..ebc5bf930ac3140817fda5c877a7e8edeb8f94d2 --- /dev/null +++ b/docs/ecolyo/functionalities/terms.md @@ -0,0 +1,24 @@ +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. diff --git a/docs/ecolyo/project_architecture/doctypes.md b/docs/ecolyo/project_architecture/doctypes.md index 7a1df27bcb1aa6b314bf0a31aaf8c4d64e4832d5..6facc0e5fd9e2d467950c6dbd043cbcd1aee4074 100644 --- a/docs/ecolyo/project_architecture/doctypes.md +++ b/docs/ecolyo/project_architecture/doctypes.md @@ -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 | diff --git a/mkdocs.yml b/mkdocs.yml index a9f1ce39cd8929ef2c0b68e697e94f35e0d2f354..91d8376492e89d1f6ef9e7e7ad54b0b9a6f374ca 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -66,6 +66,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