const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const FolderSchema = new Schema({
    name: { type: String, required: true },
    campaign: {
        type: Schema.Types.ObjectId,
        ref: 'Campaign',
        required: true
    },
    parentFolder: {
        type: Schema.Types.ObjectId,
        ref: 'Folder'
    },
    date: { type: Date, default: Date.now }
});

module.exports = mongoose.model('Folder', FolderSchema);
