@dhyasama/totem-models 5.8.1 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Deal.js CHANGED
@@ -41,7 +41,7 @@ module.exports = function(mongoose, config) {
41
41
 
42
42
  resources: [{
43
43
  title: { type: String, trim: true, required: true },
44
- link: { type: String, trim: true, required: true },
44
+ link: { type: String, trim: true, required: true }
45
45
  }],
46
46
 
47
47
  history: [{
@@ -49,6 +49,12 @@ module.exports = function(mongoose, config) {
49
49
  account: { type: Schema.ObjectId, ref: 'Account', required: true },
50
50
  stage: { type: String, required: true },
51
51
  description: { type: String, trim: true, required: true }
52
+ }],
53
+
54
+ votes: [{
55
+ timestamp: { type: Date, required: true, default: Date.now },
56
+ account: { type: Schema.ObjectId, ref: 'Account', required: true },
57
+ increment: { type: Number }
52
58
  }]
53
59
 
54
60
  });
@@ -59,6 +65,12 @@ module.exports = function(mongoose, config) {
59
65
  // VIRTUALS
60
66
  // Properties that are not persisted to the database
61
67
  ///////////////////////////////////////////////////////////////////////////////////////
68
+ Deal.virtual('deck').get(function () {
69
+
70
+ var self = this;
71
+ return _.find(self.documents, function(document) { return document.type == 'deck'; })
72
+
73
+ });
62
74
 
63
75
  Deal.virtual('added').get(function () {
64
76
 
@@ -208,7 +208,14 @@ module.exports = function(mongoose, config) {
208
208
  name: { type: String, trim: true },
209
209
  order: { type: Number },
210
210
  active: { type: Boolean, default: true }
211
- }]
211
+ }],
212
+ voting: {
213
+ active: { type: Boolean, default: true },
214
+ categories: [{
215
+ name: { String, trim: true },
216
+ increment: { type: Number }
217
+ }]
218
+ }
212
219
  }
213
220
 
214
221
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "5.8.1",
3
+ "version": "5.9.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
package/.npmignore DELETED
@@ -1,14 +0,0 @@
1
- lib-cov
2
- *.seed
3
- *.log
4
- *.csv
5
- *.dat
6
- *.out
7
- *.pid
8
- *.gz
9
-
10
- npm-debug.log
11
- node_modules
12
-
13
- .DS_Store
14
- .idea