Download server/models/Document.js from SyedFouzan/taskflow-titan-workflow-wizardry: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/SyedFouzan/taskflow-titan-workflow-wizardry/resolve/main/server/models/Document.js
- Command line
-
hf download hf://spaces/SyedFouzan/taskflow-titan-workflow-wizardry/server/models/Document.js
-
curl -L -o Document.js https://huggingface.co/spaces/SyedFouzan/taskflow-titan-workflow-wizardry/resolve/main/server/models/Document.js
1.14 kB
| const mongoose = require('mongoose'); | |
| const documentSchema = new mongoose.Schema({ | |
| filename: { | |
| type: String, | |
| required: true | |
| }, | |
| originalName: { | |
| type: String, | |
| required: true | |
| }, | |
| mimeType: { | |
| type: String, | |
| required: true | |
| }, | |
| size: { | |
| type: Number, | |
| required: true | |
| }, | |
| url: { | |
| type: String, | |
| required: true | |
| }, | |
| uploadedBy: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true | |
| }, | |
| accessRoles: [{ | |
| type: String, | |
| enum: ['admin', 'manager', 'employee'] | |
| }], | |
| accessUsers: [{ | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User' | |
| }], | |
| category: { | |
| type: String, | |
| enum: ['contract', 'report', 'invoice', 'presentation', 'other'], | |
| default: 'other' | |
| }, | |
| version: { | |
| type: Number, | |
| default: 1 | |
| }, | |
| description: { | |
| type: String, | |
| trim: true | |
| }, | |
| tags: [{ | |
| type: String, | |
| trim: true | |
| }], | |
| isPublic: { | |
| type: Boolean, | |
| default: false | |
| } | |
| }, { | |
| timestamps: true | |
| }); | |
| documentSchema.index({ uploadedBy: 1 }); | |
| documentSchema.index({ category: 1 }); | |
| module.exports = mongoose.model('Document', documentSchema); |