-
Couldn't load subscription status.
- Fork 3
Data Model: Chart
WarrenG8 edited this page Dec 11, 2018
·
7 revisions
The model for the chart data will be an object that looks like this:
{
"date": "YYYY-MM-DD",
"data": {
"Career": 6,
"Finance": 8,
"Personal Growth": 9,
"Health": 10,
"Family": 4,
"Relationships": 5,
"Social Life": 7,
"Attitude": 4
},
"id": "string",
"appUserId": "string"
}
This data model will have a relation to the user model. The relation will be created via loopback and it will be a hasMany relation. This means that each user model instance will "own" lots of chart model instances that look like the example above. I'm pretty sure that a get request for all instances of the model will return an array of them, which will be really nice for displaying in the view via ngFors and loops, etc.
So this is how the data is gonna flow through the app:
- User logs in and an HTTP Get request gathers the user's array of charts, like the example above, and it is copied locally in a chart provider file.
- User goes to the self assessment page to complete their current assessment. Upon hitting submit this assessment is submitted to the back end.
- User is then routed to the Resources page where the lowest score is provided with a chart of the most recent assessment.
- History of the user's assessments can be found in the History page.