Download server/models/Task.js from SyedFouzan/taskflow-titan-workflow-wizardry: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/SyedFouzan/taskflow-titan-workflow-wizardry/resolve/main/server/models/Task.js
- Command line
-
hf download hf://spaces/SyedFouzan/taskflow-titan-workflow-wizardry/server/models/Task.js
-
curl -L -o Task.js https://huggingface.co/spaces/SyedFouzan/taskflow-titan-workflow-wizardry/resolve/main/server/models/Task.js
1.46 kB
| const mongoose = require('mongoose'); | |
| const taskSchema = new mongoose.Schema({ | |
| title: { | |
| type: String, | |
| required: true, | |
| trim: true | |
| }, | |
| description: { | |
| type: String, | |
| trim: true | |
| }, | |
| assignee: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true | |
| }, | |
| creator: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true | |
| }, | |
| priority: { | |
| type: String, | |
| enum: ['low', 'medium', 'high'], | |
| default: 'medium' | |
| }, | |
| status: { | |
| type: String, | |
| enum: ['pending', 'in-progress', 'completed', 'cancelled'], | |
| default: 'pending' | |
| }, | |
| deadline: { | |
| type: Date, | |
| required: true | |
| }, | |
| tags: [{ | |
| type: String, | |
| trim: true | |
| }], | |
| attachments: [{ | |
| filename: String, | |
| url: String, | |
| uploadedAt: { | |
| type: Date, | |
| default: Date.now | |
| } | |
| }], | |
| comments: [{ | |
| user: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User' | |
| }, | |
| text: String, | |
| createdAt: { | |
| type: Date, | |
| default: Date.now | |
| } | |
| }], | |
| progress: { | |
| type: Number, | |
| min: 0, | |
| max: 100, | |
| default: 0 | |
| }, | |
| estimatedHours: { | |
| type: Number, | |
| default: 0 | |
| }, | |
| actualHours: { | |
| type: Number, | |
| default: 0 | |
| } | |
| }, { | |
| timestamps: true | |
| }); | |
| // Index for better query performance | |
| taskSchema.index({ assignee: 1, status: 1 }); | |
| taskSchema.index({ creator: 1 }); | |
| taskSchema.index({ deadline: 1 }); | |
| module.exports = mongoose.model('Task', taskSchema); |