{"size": 888, "ext": "js", "max_stars_repo_path": "models/task.js", "max_stars_repo_name": "Scc33/CS498RK-MP3", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/task.js", "max_issues_repo_name": "Scc33/CS498RK-MP3", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/task.js", "max_forks_repo_name": "Scc33/CS498RK-MP3", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.7142857143, "max_line_length": 104, "alphanum_fraction": 0.7015765766}
// Load required packages
var mongoose = require('mongoose');

/*
Here is the Task Schema:

"name" - String
"description" - String
"deadline" - Date
"completed" - Boolean
"assignedUser" - String - The _id field of the user this task is assigned to - default ""
"assignedUserName" - String - The name field of the user this task is assigned to - default "unassigned"
"dateCreated" - Date - should be set automatically by server to present date*/

// Define our user schema
var TaskSchema = new mongoose.Schema({
    name: String,
    description: {type: String, default : ""},
    deadline: Date,
    completed: {type: Boolean, default: false},
    assignedUser: {type: String, default: ""},
    assignedUserName: {type: String, default: "unassigned"},
    dateCreated: {type: Date, default: Date.now}
});

// Export the Mongoose model
module.exports = mongoose.model('Task', TaskSchema);
