silicon-slopes-engineer-workshop / coding_pairs

MIT License
0 stars 2 forks source link

Added models for task, taskPreferences, and events. Hooked up the eve… #28

Closed jamesschlader closed 5 years ago

jamesschlader commented 5 years ago

Added models for task, taskPreferences, and events. Hooked up the event and preferences to the user model. Added a seedTasks script to run which fills in the db with initial tasks. Included execution instructions for the seed into the ReadME.

NO CRUD operations have added to these data models as yet.

Each event has an array of ids called "participants" that can work with either the pairs model or else just the ids of each participant in the pair. The task id is also stored on the event.

Each task has a title, a description, an array of ideas, and an imageURL. The imageURL is currently blank; but when we get fancy, we can add an svg image icon to the code base which this field could reference as a src string to represent the task. The ideas array holds a few default ideas to which an administrator could add.

user has two new fields. events holds an array of all the events that the user has participated in. preferences holds the preferences list that the user generates when logging in for the event. Both are arrays of ObjectIds that reference events or taskPreferences objects.

taskPreferences are just a time stamped list of the preferences chosen by that user. Would be fun to track data on the preferences folks are choosing, I reckon, so we might as well record that info.

For the future, we may want to add a field on user for desiredTask, which a user could use to recommend a task or an idea for an established task.