Adds tag label plugin.

This commit is contained in:
gaba
2017-02-09 09:17:56 -08:00
parent 85dabae355
commit f2341ca9d3
6 changed files with 80 additions and 24 deletions
+27 -5
View File
@@ -9,6 +9,11 @@ const STATUSES = [
null
];
const TAGS = [
'STAFF',
null
];
/**
* The Mongo schema for a Comment Status.
* @type {Schema}
@@ -30,6 +35,27 @@ const StatusSchema = new Schema({
_id: false
});
/**
* The Mongo schema for a Comment Tag.
* @type {Schema}
*/
const TagSchema = new Schema({
name: {
type: String,
enum: TAGS,
},
// The User ID of the user that assigned the status.
assigned_by: {
type: String,
default: null
},
created_at: Date
}, {
_id: false
});
/**
* The Mongo schema for a Comment.
* @type {Schema}
@@ -49,11 +75,7 @@ const CommentSchema = new Schema({
author_id: String,
status_history: [StatusSchema],
status: {type: String, default: null},
tags: [{
name: String,
assigned_by: String,
created_at: Date
}],
tags: [TagSchema],
parent_id: String
}, {
timestamps: {