@dhyasama/totem-models 7.28.0 → 7.29.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.
Files changed (2) hide show
  1. package/lib/Sync.js +7 -14
  2. package/package.json +1 -1
package/lib/Sync.js CHANGED
@@ -10,30 +10,23 @@ module.exports = function(mongoose, config) {
10
10
 
11
11
  var Sync = new Schema({
12
12
  customer: { type: String, required: true },
13
- uuid: { type: String, required: true },
14
13
  syncedOn: { type: Date, required: true },
15
14
  syncedBy: { type: String, trim: true },
16
- errors: [{
15
+ issues: [{
17
16
  step: { type: String },
18
17
  message: { type: String }
19
18
  }]
20
19
  });
21
20
 
22
- Sync.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
-
21
+ Sync.statics.getById = function (id, customerId, cb) {
22
+ this.findOne({
23
+ '_id': id,
24
+ 'customer': customerId
25
+ }).exec(cb);
33
26
  };
34
27
 
35
28
  Sync.statics.upsert = function(sync, cb) {
36
- sync.createdOn = new Date();
29
+ sync.syncedOn = new Date();
37
30
  sync.save(cb);
38
31
  };
39
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.28.0",
3
+ "version": "7.29.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",