@dhyasama/totem-models 11.99.0 → 11.101.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/Meeting.js +9 -17
  2. package/package.json +1 -1
package/lib/Meeting.js CHANGED
@@ -7,6 +7,8 @@ module.exports = function(mongoose, config) {
7
7
  Schema = mongoose.Schema;
8
8
 
9
9
  var Meeting = new Schema({
10
+
11
+ customer: { type: Schema.ObjectId, ref: 'Organization', index: true, required: true },
10
12
 
11
13
  provider: { type: String, index: false, required: true },
12
14
 
@@ -16,24 +18,18 @@ module.exports = function(mongoose, config) {
16
18
 
17
19
  summary: { type: String, index: false, required: true },
18
20
 
19
- start: { type: Date, index: false, required: true },
21
+ startOn: { type: Date, index: false, required: true },
20
22
 
21
- end: { type: Date, index: false, required: true },
23
+ endOn: { type: Date, index: false, required: true },
22
24
 
23
25
  recurring: { type: Boolean, default: false },
24
26
 
25
- attendees: [{
26
-
27
- email: { type: String, index: true, required: true },
28
-
29
- name: { type: String, index: true, required: true }
30
-
31
- }],
32
-
33
27
  createdOn: { type: Date, index: false, required: true },
34
28
 
35
29
  updatedOn: { type: Date, index: false, required: true },
36
30
 
31
+ people: [{ type: Schema.ObjectId, ref: 'Person', index: true }],
32
+
37
33
  raw: { type: String, index: false, required: true },
38
34
 
39
35
  notes: { type: String, trim: true },
@@ -88,20 +84,16 @@ module.exports = function(mongoose, config) {
88
84
  .exec(cb);
89
85
  };
90
86
 
91
- Meeting.statics.findByEmail = function (email, cb) {
87
+ Meeting.statics.findByPerson = function (person, cb) {
92
88
  this
93
- .find({ 'attendees.email': email })
89
+ .find({ 'people': person })
94
90
  .exec(cb);
95
91
  };
96
92
 
97
93
  Meeting.statics.delete = function(meetingId, cb) {
98
-
99
- var self = this;
100
-
101
- self
94
+ this
102
95
  .findByIdAndRemove(meetingId)
103
96
  .exec(cb);
104
-
105
97
  };
106
98
 
107
99
  Meeting.statics.upsert = function(meeting, cb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.99.0",
3
+ "version": "11.101.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",