@dhyasama/totem-models 7.25.0 → 7.27.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/index.js CHANGED
@@ -63,6 +63,7 @@ var bootstrap = function(mongoose, config) {
63
63
  require('./lib/List.js')(mongoose, config);
64
64
  require('./lib/Message.js')(mongoose, config);
65
65
  require('./lib/News.js')(mongoose, config);
66
+ require('./lib/SheetSync.js')(mongoose, config);
66
67
  require('./lib/Snapshot.js')(mongoose, config);
67
68
  require('./lib/Webhook.js')(mongoose, config);
68
69
 
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ module.exports = function(mongoose, config) {
4
+
5
+ var
6
+
7
+ Schema = mongoose.Schema,
8
+ env = process.env.NODE_ENV || 'development',
9
+ _ = require('underscore');
10
+
11
+ var SheetSync = new Schema({
12
+ customer: { type: String, required: true },
13
+ uuid: { type: String, required: true },
14
+ syncedOn: { type: Date, required: true },
15
+ syncedBy: { type: String, trim: true },
16
+ errors: [{
17
+ step: { type: String },
18
+ message: { type: String }
19
+ }]
20
+ });
21
+
22
+ SheetSync.statics.getByUUID = function getByUUID(customerId, uuid, cb) {
23
+
24
+ var self = this;
25
+
26
+ var query = self.findOne({
27
+ 'customer': customerId,
28
+ 'uuid': uuid
29
+ });
30
+
31
+ query.exec(cb);
32
+
33
+ };
34
+
35
+ SheetSync.statics.upsert = function(sheetsync, cb) {
36
+ sheetsync.createdOn = new Date();
37
+ sheetsync.save(cb);
38
+ };
39
+
40
+ SheetSync.set('autoIndex', false);
41
+
42
+ mongoose.model('SheetSync', SheetSync);
43
+
44
+ };
package/lib/Webhook.js CHANGED
@@ -25,6 +25,6 @@ module.exports = function(mongoose, config) {
25
25
 
26
26
  Webhook.set('autoIndex', false);
27
27
 
28
- mongoose.model('Webhook', Webhook);
28
+ mongoose.model('Webhook', Webhook, '_Webhooks');
29
29
 
30
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.25.0",
3
+ "version": "7.27.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