Overview
Every user need to Accept the terms and conditions in order to access the portal:
...
- Terms & Conditions will be stored as public html page on portal itself.
- Admin has to update the system settings table, whenever the TnC page and version is modified.
After successful login - portal will call read user api.
- This api response will contain - a flag - based on which portal can redirect the user to Accept Term & Conditions page.
- The above flag will be calculated based on following two conditions
- if tncversion is null in user table, for the logged in user, showTnC flag will be marked to true
- if tncversion is not null and does not match with version stored in System Settings table, flag will be marked true
- API will also contain tncaccpteddate & tncversion - for information purpose only - it might get used in future, if we want to show it to the user.
- Each time user accepts a new version of TnC - > Telemetry Audit event will be generated.
DB changes
Changes to user table
Column | Changes |
---|---|
tncaccepteddatetncacceptedon | Added - will store latest tnc accepted date |
tncversion | added - will store latest tnc accepted version |
...
Admin has to update the system settings table for applicable channel , for new tncVersion to be impacted.
[tncConfig{
{latestVersion=v2,
"channelName":"NameOfChannel 1",v2{
"tncVersion": "v2.0"url=htmllink
},
v1{
"channelName":"NameOfChannel 2", url=htmllink
"tncVersion" : "v1.0"
}
]}
}
Changes
...
to
...
existing
...
API
GET /user/v1/read/:uid
→ Will add following keys to the response:
showTnC: true or false
tncAcceptedDate: tncAcceptedOn: informational purpose
tncAcceptedVersion: informational purpose→ showTnC
tncLatestVersion: Latest version to be accepted by user.
tncLatestVersionUrl: link to HTML page.
promptTnC: true or false
→ promptTnC is true → user will not be prompted for terms & conditions acceptance page.
→ showTnc → promptTnC is false → user will not be propmted for terms & conditions acceptance page
...
- Accept TnC
POST /user/v1/tnc/accept{ "request": {
"version" : "v2" } }
Note: Version will be identified from System settings. system settings will have identifier as "tncConfiguration" that will hold terms and condition version and other details. User Id will be taken from "x-authenticated-user-token".
Response
200 OK - Terms & conditions accepted successfully
...