tabletcommand-backend-models 5.17.1 → 5.17.5

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 (114) hide show
  1. package/build/models/agency.js +1 -0
  2. package/build/models/agency.js.map +1 -1
  3. package/build/models/arcgis-group.js +3 -0
  4. package/build/models/arcgis-group.js.map +1 -1
  5. package/build/models/cad-incident.js +5 -0
  6. package/build/models/cad-incident.js.map +1 -1
  7. package/build/models/cad-status-map.js +1 -0
  8. package/build/models/cad-status-map.js.map +1 -1
  9. package/build/models/cad-status.js +2 -0
  10. package/build/models/cad-status.js.map +1 -1
  11. package/build/models/cad-vehicle.js +1 -0
  12. package/build/models/cad-vehicle.js.map +1 -1
  13. package/build/models/chart-incident.js +1 -0
  14. package/build/models/chart-incident.js.map +1 -1
  15. package/build/models/chart-managed-incident.js +1 -0
  16. package/build/models/chart-managed-incident.js.map +1 -1
  17. package/build/models/csv-import.js +4 -0
  18. package/build/models/csv-import.js.map +1 -1
  19. package/build/models/department.js +3 -0
  20. package/build/models/department.js.map +1 -1
  21. package/build/models/esri.js +1 -0
  22. package/build/models/esri.js.map +1 -1
  23. package/build/models/incident-event.js +1 -0
  24. package/build/models/incident-event.js.map +1 -1
  25. package/build/models/incident-notified.js +1 -0
  26. package/build/models/incident-notified.js.map +1 -1
  27. package/build/models/managed-incident.js +178 -25
  28. package/build/models/managed-incident.js.map +1 -1
  29. package/build/models/message.js +1 -0
  30. package/build/models/message.js.map +1 -1
  31. package/build/models/remote-log.js +1 -0
  32. package/build/models/remote-log.js.map +1 -1
  33. package/build/models/schema/cad-status-option-selected.js +1 -0
  34. package/build/models/schema/cad-status-option-selected.js.map +1 -1
  35. package/build/models/schema/color.js +1 -0
  36. package/build/models/schema/color.js.map +1 -1
  37. package/build/models/schema/esri-auth.js +2 -0
  38. package/build/models/schema/esri-auth.js.map +1 -1
  39. package/build/models/schema/esri-error.js +1 -0
  40. package/build/models/schema/esri-error.js.map +1 -1
  41. package/build/models/schema/esri-map.js +4 -0
  42. package/build/models/schema/esri-map.js.map +1 -1
  43. package/build/models/schema/esri-token.js +1 -0
  44. package/build/models/schema/esri-token.js.map +1 -1
  45. package/build/models/schema/firemapper-auth.js +2 -0
  46. package/build/models/schema/firemapper-auth.js.map +1 -1
  47. package/build/models/schema/geojson-point.js +1 -0
  48. package/build/models/schema/geojson-point.js.map +1 -1
  49. package/build/models/template.js +2 -0
  50. package/build/models/template.js.map +1 -1
  51. package/build/models/user-device.js +5 -0
  52. package/build/models/user-device.js.map +1 -1
  53. package/build/models/user.js +1 -0
  54. package/build/models/user.js.map +1 -1
  55. package/definitions/models/agency.d.ts.map +1 -1
  56. package/definitions/models/arcgis-group.d.ts.map +1 -1
  57. package/definitions/models/cad-incident.d.ts.map +1 -1
  58. package/definitions/models/cad-status-map.d.ts.map +1 -1
  59. package/definitions/models/cad-status.d.ts.map +1 -1
  60. package/definitions/models/cad-vehicle.d.ts.map +1 -1
  61. package/definitions/models/chart-incident.d.ts.map +1 -1
  62. package/definitions/models/chart-managed-incident.d.ts.map +1 -1
  63. package/definitions/models/csv-import.d.ts +1 -0
  64. package/definitions/models/csv-import.d.ts.map +1 -1
  65. package/definitions/models/department.d.ts.map +1 -1
  66. package/definitions/models/esri.d.ts.map +1 -1
  67. package/definitions/models/incident-event.d.ts.map +1 -1
  68. package/definitions/models/incident-notified.d.ts.map +1 -1
  69. package/definitions/models/managed-incident.d.ts +249 -18
  70. package/definitions/models/managed-incident.d.ts.map +1 -1
  71. package/definitions/models/message.d.ts.map +1 -1
  72. package/definitions/models/remote-log.d.ts.map +1 -1
  73. package/definitions/models/schema/cad-status-option-selected.d.ts.map +1 -1
  74. package/definitions/models/schema/color.d.ts.map +1 -1
  75. package/definitions/models/schema/esri-auth.d.ts.map +1 -1
  76. package/definitions/models/schema/esri-error.d.ts.map +1 -1
  77. package/definitions/models/schema/esri-map.d.ts.map +1 -1
  78. package/definitions/models/schema/esri-token.d.ts.map +1 -1
  79. package/definitions/models/schema/firemapper-auth.d.ts.map +1 -1
  80. package/definitions/models/schema/geojson-point.d.ts.map +1 -1
  81. package/definitions/models/template.d.ts.map +1 -1
  82. package/definitions/models/user-device.d.ts.map +1 -1
  83. package/definitions/models/user.d.ts.map +1 -1
  84. package/package.json +4 -4
  85. package/src/models/agency.ts +1 -0
  86. package/src/models/arcgis-group.ts +3 -0
  87. package/src/models/cad-incident.ts +5 -0
  88. package/src/models/cad-status-map.ts +1 -0
  89. package/src/models/cad-status.ts +2 -0
  90. package/src/models/cad-vehicle.ts +1 -0
  91. package/src/models/chart-incident.ts +1 -0
  92. package/src/models/chart-managed-incident.ts +1 -0
  93. package/src/models/csv-import.ts +4 -0
  94. package/src/models/department.ts +3 -0
  95. package/src/models/esri.ts +1 -0
  96. package/src/models/incident-event.ts +1 -0
  97. package/src/models/incident-notified.ts +1 -0
  98. package/src/models/managed-incident.ts +181 -25
  99. package/src/models/message.ts +1 -0
  100. package/src/models/remote-log.ts +1 -0
  101. package/src/models/schema/cad-status-option-selected.ts +1 -0
  102. package/src/models/schema/color.ts +1 -0
  103. package/src/models/schema/esri-auth.ts +2 -0
  104. package/src/models/schema/esri-error.ts +1 -0
  105. package/src/models/schema/esri-map.ts +4 -0
  106. package/src/models/schema/esri-token.ts +1 -0
  107. package/src/models/schema/firemapper-auth.ts +2 -0
  108. package/src/models/schema/geojson-point.ts +1 -0
  109. package/src/models/template.ts +2 -0
  110. package/src/models/user-device.ts +5 -0
  111. package/src/models/user.ts +1 -0
  112. package/test/cad-incident.js +70 -62
  113. package/test/csv-import.js +1 -0
  114. package/test/mock.js +2 -1
@@ -33,6 +33,149 @@ export async function ManagedIncidentModule(mongoose: MongooseModule) {
33
33
  },
34
34
  }, {
35
35
  _id: false,
36
+ id: false,
37
+ });
38
+
39
+ const AssignmentItem = createSchema(Schema, {
40
+ name: {
41
+ type: String,
42
+ default: "",
43
+ },
44
+ uuid: {
45
+ type: String,
46
+ default: uuid.v4,
47
+ },
48
+ }, {
49
+ _id: false,
50
+ id: false,
51
+ });
52
+
53
+ const IncidentUnit = createSchema(Schema, {
54
+ active: {
55
+ type: Number,
56
+ default: 0,
57
+ },
58
+ air_time: {
59
+ type: String,
60
+ default: "",
61
+ },
62
+ assignment: {
63
+ type: AssignmentItem,
64
+ },
65
+ AlarmAtDispatch: {
66
+ type: String,
67
+ default: "",
68
+ },
69
+ api_unit_dispatch_number: {
70
+ type: String,
71
+ default: "",
72
+ },
73
+ checked: {
74
+ type: Number,
75
+ default: 0,
76
+ },
77
+ column_position: {
78
+ type: Number,
79
+ default: 0,
80
+ },
81
+ group_position: {
82
+ type: Number,
83
+ default: 0,
84
+ },
85
+ incident_position: {
86
+ type: Number,
87
+ default: 0,
88
+ },
89
+ isSupervisor: {
90
+ type: Number,
91
+ default: 0,
92
+ },
93
+ is_part_of_group: {
94
+ type: Number,
95
+ default: 0,
96
+ },
97
+ location_on_map: {
98
+ type: String,
99
+ default: "",
100
+ },
101
+ modified_date: {
102
+ type: String,
103
+ default: "",
104
+ },
105
+ modified_unix_date: {
106
+ type: Number,
107
+ default: 0,
108
+ },
109
+ note: {
110
+ type: String,
111
+ default: "",
112
+ },
113
+ personnelOnScene: {
114
+ type: Number,
115
+ default: 0,
116
+ },
117
+ // Personnel?: Personnel[]
118
+ status: {
119
+ type: String,
120
+ default: "",
121
+ },
122
+ status_unix_date: {
123
+ type: Number,
124
+ default: 0,
125
+ },
126
+ time: {
127
+ type: String,
128
+ default: "",
129
+ },
130
+ UnitID: {
131
+ type: String,
132
+ default: "",
133
+ },
134
+ warning: {
135
+ type: Number,
136
+ default: 0,
137
+ },
138
+ }, {
139
+ _id: false,
140
+ id: false,
141
+ });
142
+
143
+ const IncidentGroup = createSchema(Schema, {
144
+ location_on_map: {
145
+ type: String,
146
+ default: "",
147
+ },
148
+ name: {
149
+ type: String,
150
+ default: "",
151
+ },
152
+ note: {
153
+ type: String,
154
+ default: "",
155
+ },
156
+ position: {
157
+ type: Number,
158
+ default: 0,
159
+ },
160
+ type: {
161
+ type: Number,
162
+ default: 0,
163
+ },
164
+ type_text: {
165
+ type: String,
166
+ default: "",
167
+ },
168
+ units: {
169
+ type: [IncidentUnit],
170
+ default: [],
171
+ },
172
+ uuid: {
173
+ type: String,
174
+ default: uuid.v4,
175
+ },
176
+ }, {
177
+ _id: false,
178
+ id: false,
36
179
  });
37
180
 
38
181
  const modelSchema = createSchema(Schema, {
@@ -64,6 +207,15 @@ export async function ManagedIncidentModule(mongoose: MongooseModule) {
64
207
  par_unix_time: Number,
65
208
  watch_unix_start_time: Number,
66
209
  watch_unix_pause_time: Number,
210
+ start_time: {
211
+ type: String,
212
+ },
213
+ end_time: {
214
+ type: String,
215
+ },
216
+ modified_date: {
217
+ type: String,
218
+ },
67
219
 
68
220
  modified_unix_date: {
69
221
  type: Number,
@@ -83,35 +235,48 @@ export async function ManagedIncidentModule(mongoose: MongooseModule) {
83
235
  default: "",
84
236
  },
85
237
 
86
- location: String,
87
- last_view: String,
88
- preference_location: String,
238
+ active: Boolean,
89
239
  address: String,
90
- name: String,
91
- cross_streets: String,
92
240
  api_incident_number: String,
93
- CommonPlaceName: String,
94
- TacticalChannel: String,
95
- TacticalAltChannel: String,
96
- active: Boolean,
97
- slave_map_changed: Boolean,
98
- managed: Boolean,
99
- is_closed: Boolean,
100
- source: String,
101
241
  CallerNumber: String,
102
242
  CommandChannel: String,
243
+ CommonPlaceName: String,
244
+ cross_streets: String,
103
245
  extended: {
104
246
  type: Boolean,
105
247
  default: false
106
248
  },
249
+ is_closed: Boolean,
250
+ last_view: String,
251
+ location: String,
252
+ managed: {
253
+ type: Boolean,
254
+ default: true,
255
+ },
256
+ name: String,
257
+ preference_location: String,
258
+ slave_map_changed: Boolean,
259
+ source: String,
260
+ TacticalAltChannel: String,
261
+ TacticalChannel: String,
107
262
 
108
- // Incident Notes
109
- notes: {
110
- type: [HistoryItem],
263
+ groups: {
264
+ type: [IncidentGroup],
265
+ default: [],
111
266
  },
112
267
  // Incident History
113
268
  history: {
114
269
  type: [HistoryItem],
270
+ default: [],
271
+ },
272
+ // Incident Notes
273
+ notes: {
274
+ type: [HistoryItem],
275
+ default: [],
276
+ },
277
+ units: {
278
+ type: [IncidentUnit],
279
+ default: [],
115
280
  },
116
281
 
117
282
  // Training
@@ -123,15 +288,6 @@ export async function ManagedIncidentModule(mongoose: MongooseModule) {
123
288
  type: Boolean,
124
289
  default: true,
125
290
  },
126
- start_time: {
127
- type: String,
128
- },
129
- end_time: {
130
- type: String,
131
- },
132
- modified_date: {
133
- type: String,
134
- },
135
291
  }, {
136
292
  collection: "massive_incident_managed",
137
293
  });
@@ -25,6 +25,7 @@ export async function MessageModule(mongoose: MongooseModule) {
25
25
  },
26
26
  }, {
27
27
  _id: false,
28
+ id: false,
28
29
  });
29
30
 
30
31
  const modelSchema = createSchema(Schema, {
@@ -43,6 +43,7 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
43
43
  },
44
44
  }, {
45
45
  _id: false,
46
+ id: false,
46
47
  });
47
48
 
48
49
  const modelSchema = createSchema(Schema, {
@@ -25,6 +25,7 @@ export default function CADStatusOptionSelectedSchema(mongoose: MongooseModule)
25
25
  },
26
26
  }, {
27
27
  _id: false,
28
+ id: false,
28
29
  });
29
30
 
30
31
  return Item;
@@ -17,6 +17,7 @@ export default function ColorSchema(mongoose: MongooseModule) {
17
17
  },
18
18
  }, {
19
19
  _id: false,
20
+ id: false,
20
21
  });
21
22
 
22
23
  return Color;
@@ -17,6 +17,7 @@ export default function EsriAuthSchema(mongoose: MongooseModule) {
17
17
  },
18
18
  }, {
19
19
  _id: false,
20
+ id: false,
20
21
  });
21
22
 
22
23
  const EsriAuth = createSchema(Schema, {
@@ -30,6 +31,7 @@ export default function EsriAuthSchema(mongoose: MongooseModule) {
30
31
  },
31
32
  }, {
32
33
  _id: false,
34
+ id: false,
33
35
  });
34
36
 
35
37
  return EsriAuth;
@@ -25,6 +25,7 @@ export default function EsriErrorSchema(mongoose: MongooseModule) {
25
25
  },
26
26
  }, {
27
27
  _id: false,
28
+ id: false,
28
29
  });
29
30
 
30
31
  return EsriError;
@@ -45,6 +45,7 @@ export default function EsriMapSchema(mongoose: MongooseModule) {
45
45
  },
46
46
  }, {
47
47
  _id: false,
48
+ id: false,
48
49
  });
49
50
 
50
51
  const BaseMap = createSchema(Schema, {
@@ -58,6 +59,7 @@ export default function EsriMapSchema(mongoose: MongooseModule) {
58
59
  },
59
60
  }, {
60
61
  _id: false,
62
+ id: false,
61
63
  });
62
64
 
63
65
  // Use a simpler set for Offline Maps
@@ -103,6 +105,7 @@ export default function EsriMapSchema(mongoose: MongooseModule) {
103
105
  },
104
106
  }, {
105
107
  _id: false,
108
+ id: false,
106
109
  });
107
110
 
108
111
  const Map = createSchema(Schema, {
@@ -132,6 +135,7 @@ export default function EsriMapSchema(mongoose: MongooseModule) {
132
135
  },
133
136
  }, {
134
137
  _id: false,
138
+ id: false,
135
139
  });
136
140
 
137
141
  return Map;
@@ -29,6 +29,7 @@ export default function EsriTokenSchema(mongoose: MongooseModule) {
29
29
  },
30
30
  }, {
31
31
  _id: false,
32
+ id: false,
32
33
  });
33
34
 
34
35
  return EsriToken;
@@ -17,6 +17,7 @@ export default function FireMapperAuthSchema(mongoose: MongooseModule) {
17
17
  },
18
18
  }, {
19
19
  _id: false,
20
+ id: false,
20
21
  });
21
22
 
22
23
  const FireMapperAuth = createSchema(Schema, {
@@ -34,6 +35,7 @@ export default function FireMapperAuthSchema(mongoose: MongooseModule) {
34
35
  },
35
36
  }, {
36
37
  _id: false,
38
+ id: false,
37
39
  });
38
40
 
39
41
  return FireMapperAuth;
@@ -20,6 +20,7 @@ export default function GeoJSONPointSchema(mongoose: MongooseModule) {
20
20
  },
21
21
  }, {
22
22
  _id: false,
23
+ id: false,
23
24
  });
24
25
 
25
26
  return GeoJSONPoint;
@@ -32,6 +32,7 @@ export async function TemplateModule(mongoose: MongooseModule) {
32
32
  },
33
33
  }, {
34
34
  _id: false,
35
+ id: false,
35
36
  });
36
37
 
37
38
  const GroupOption = createSchema(Schema, {
@@ -45,6 +46,7 @@ export async function TemplateModule(mongoose: MongooseModule) {
45
46
  },
46
47
  }, {
47
48
  _id: false,
49
+ id: false,
48
50
  });
49
51
 
50
52
  const modelSchema = createSchema(Schema, {
@@ -27,6 +27,7 @@ export async function UserDeviceModule(mongoose: MongooseModule) {
27
27
  },
28
28
  }, {
29
29
  _id: false,
30
+ id: false,
30
31
  });
31
32
 
32
33
  const IncidentSetting = createSchema(Schema, {
@@ -44,6 +45,7 @@ export async function UserDeviceModule(mongoose: MongooseModule) {
44
45
  },
45
46
  }, {
46
47
  _id: false,
48
+ id: false,
47
49
  });
48
50
 
49
51
  const deviceSchema = createSchema(Schema, {
@@ -103,6 +105,7 @@ export async function UserDeviceModule(mongoose: MongooseModule) {
103
105
  },
104
106
  }, {
105
107
  _id: false,
108
+ id: false,
106
109
  });
107
110
 
108
111
  const soundSchemaItem = createSchema(Schema, {
@@ -118,6 +121,7 @@ export async function UserDeviceModule(mongoose: MongooseModule) {
118
121
  },
119
122
  }, {
120
123
  _id: false,
124
+ id: false,
121
125
  });
122
126
 
123
127
  const soundSchema = createSchema(Schema, {
@@ -129,6 +133,7 @@ export async function UserDeviceModule(mongoose: MongooseModule) {
129
133
  },
130
134
  }, {
131
135
  _id: false,
136
+ id: false,
132
137
  });
133
138
 
134
139
  const modelSchema = createSchema(Schema, {
@@ -30,6 +30,7 @@ export async function UserModule(mongoose: MongooseModule) {
30
30
  },
31
31
  }, {
32
32
  _id: false,
33
+ id: false,
33
34
  });
34
35
  const modelSchema = createSchema(Schema, {
35
36
  nick: {
@@ -22,74 +22,82 @@ describe("CADIncident", function() {
22
22
  mongoose.disconnect();
23
23
  });
24
24
 
25
- it("is saved", function(done) {
26
- var item = new models.CADIncident(testItem);
27
- item.save(function(err, sut) {
28
- assert.isNull(err, "Should not err");
25
+ it("is saved", async function() {
26
+ const item = new models.CADIncident(testItem);
27
+ const sut = await item.save();
29
28
 
30
- assert.isNotNull(testItem._id);
31
- assert.equal(sut.uuid, testItem.uuid);
32
- assert.equal(sut.departmentId, testItem.departmentId);
33
- assert.equal(sut.AgencyID, testItem.AgencyID);
34
- assert.equal(sut.IncidentNumber, testItem.IncidentNumber);
35
- assert.equal(sut.TransactionID, testItem.TransactionID);
36
- assert.equal(sut.AgencyIncidentCallTypeDescription, testItem.AgencyIncidentCallTypeDescription);
37
- assert.equal(sut.StreetName, testItem.StreetName);
38
- assert.equal(sut.StreetSuffix, testItem.StreetSuffix);
39
- assert.equal(sut.Predirectional, testItem.Predirectional);
40
- assert.equal(sut.Postdirectional, testItem.Postdirectional);
41
- assert.equal(sut.CityOrLocality, testItem.CityOrLocality);
42
- assert.equal(sut.Floor, testItem.Floor);
43
- assert.equal(sut.Suite, testItem.Suite);
44
- assert.equal(sut.City, testItem.City);
45
- assert.equal(sut.Building, testItem.Building);
46
- assert.equal(sut.StateOrProvince, testItem.StateOrProvince);
47
- assert.equal(sut.CommonPlaceName, testItem.CommonPlaceName);
48
- assert.equal(sut.LocationComment, testItem.LocationComment);
49
- assert.equal(sut.CrossStreet1, testItem.CrossStreet1);
50
- assert.equal(sut.CrossStreet2, testItem.CrossStreet2);
51
- assert.equal(sut.cross_streets, testItem.cross_streets);
52
- assert.equal(sut.PostalCode, testItem.PostalCode);
53
- assert.equal(sut.CallerNumber, testItem.CallerNumber);
54
- assert.equal(sut.Latitude, testItem.Latitude);
55
- assert.equal(sut.Longitude, testItem.Longitude);
56
- assert.equal(sut.preference_location, testItem.preference_location);
57
- assert.equal(sut.EntryDateTime, testItem.EntryDateTime);
58
- assert.equal(sut.ClosedDateTime, testItem.ClosedDateTime);
59
- assert.equal(sut.closed_unix_date, testItem.closed_unix_date);
60
- assert.equal(sut.start_unix_date, testItem.start_unix_date);
61
- assert.equal(sut.modified_unix_date, testItem.modified_unix_date);
29
+ assert.isNotNull(testItem._id);
30
+ assert.equal(sut.uuid, testItem.uuid);
31
+ assert.equal(sut.departmentId, testItem.departmentId);
32
+ assert.equal(sut.AgencyID, testItem.AgencyID);
33
+ assert.equal(sut.IncidentNumber, testItem.IncidentNumber);
34
+ assert.equal(sut.TransactionID, testItem.TransactionID);
35
+ assert.equal(sut.AgencyIncidentCallTypeDescription, testItem.AgencyIncidentCallTypeDescription);
36
+ assert.equal(sut.StreetName, testItem.StreetName);
37
+ assert.equal(sut.StreetSuffix, testItem.StreetSuffix);
38
+ assert.equal(sut.Predirectional, testItem.Predirectional);
39
+ assert.equal(sut.Postdirectional, testItem.Postdirectional);
40
+ assert.equal(sut.CityOrLocality, testItem.CityOrLocality);
41
+ assert.equal(sut.Floor, testItem.Floor);
42
+ assert.equal(sut.Suite, testItem.Suite);
43
+ assert.equal(sut.City, testItem.City);
44
+ assert.equal(sut.Building, testItem.Building);
45
+ assert.equal(sut.StateOrProvince, testItem.StateOrProvince);
46
+ assert.equal(sut.CommonPlaceName, testItem.CommonPlaceName);
47
+ assert.equal(sut.LocationComment, testItem.LocationComment);
48
+ assert.equal(sut.CrossStreet1, testItem.CrossStreet1);
49
+ assert.equal(sut.CrossStreet2, testItem.CrossStreet2);
50
+ assert.equal(sut.cross_streets, testItem.cross_streets);
51
+ assert.equal(sut.PostalCode, testItem.PostalCode);
52
+ assert.equal(sut.CallerNumber, testItem.CallerNumber);
53
+ assert.equal(sut.Latitude, testItem.Latitude);
54
+ assert.equal(sut.Longitude, testItem.Longitude);
55
+ assert.equal(sut.preference_location, testItem.preference_location);
56
+ assert.equal(sut.EntryDateTime, testItem.EntryDateTime);
57
+ assert.equal(sut.ClosedDateTime, testItem.ClosedDateTime);
58
+ assert.equal(sut.closed_unix_date, testItem.closed_unix_date);
59
+ assert.equal(sut.start_unix_date, testItem.start_unix_date);
60
+ assert.equal(sut.modified_unix_date, testItem.modified_unix_date);
62
61
 
63
- assert.isTrue(sut.PriorIncidentChanged);
64
- assert.equal(sut.PriorIncidentChanged, testItem.PriorIncidentChanged);
65
- assert.equal(sut.PriorIncident.length, 1);
66
- if (sut.PriorIncident.length === 1) {
67
- var pi = sut.PriorIncident[0];
68
- var pid = testItem.PriorIncident[0];
69
- assert.equal(pi.IncidentNumber, pid.IncidentNumber);
70
- assert.equal(pi.IncidentDateTime, pid.IncidentDateTime);
71
- assert.equal(pi.Problem, pid.Problem);
72
- assert.equal(pi.Address, pid.Address);
73
- assert.equal(pi.Suite, pid.Suite);
74
- assert.equal(pi.Jurisdiction, pid.Jurisdiction);
75
- assert.equal(pi.Comment[0].Comment, pid.Comment[0].Comment);
76
- assert.equal(pi.Comment[0].CommentSource, pid.Comment[0].CommentSource);
77
- assert.equal(pi.Comment[0].CommentDateTime, pid.Comment[0].CommentDateTime);
78
- }
62
+ assert.isTrue(sut.PriorIncidentChanged);
63
+ assert.equal(sut.PriorIncidentChanged, testItem.PriorIncidentChanged);
64
+ assert.equal(sut.PriorIncident.length, 1);
65
+ if (sut.PriorIncident.length === 1) {
66
+ var pi = sut.PriorIncident[0];
67
+ var pid = testItem.PriorIncident[0];
68
+ assert.equal(pi.IncidentNumber, pid.IncidentNumber);
69
+ assert.equal(pi.IncidentDateTime, pid.IncidentDateTime);
70
+ assert.equal(pi.Problem, pid.Problem);
71
+ assert.equal(pi.Address, pid.Address);
72
+ assert.equal(pi.Suite, pid.Suite);
73
+ assert.equal(pi.Jurisdiction, pid.Jurisdiction);
74
+ assert.equal(pi.Comment[0].Comment, pid.Comment[0].Comment);
75
+ assert.equal(pi.Comment[0].CommentSource, pid.Comment[0].CommentSource);
76
+ assert.equal(pi.Comment[0].CommentDateTime, pid.Comment[0].CommentDateTime);
77
+ }
79
78
 
80
- assert.equal(sut.units.length, 1);
81
- assert.equal(sut.units[0].UnitDispatchNumber, testItem.units[0].UnitDispatchNumber);
82
- assert.equal(sut.units[0].UnitID, testItem.units[0].UnitID);
83
- assert.equal(sut.units[0].TimeDispatched, testItem.units[0].TimeDispatched);
79
+ assert.equal(sut.units.length, 1);
80
+ assert.equal(sut.units[0].UnitDispatchNumber, testItem.units[0].UnitDispatchNumber);
81
+ assert.equal(sut.units[0].UnitID, testItem.units[0].UnitID);
82
+ assert.equal(sut.units[0].TimeDispatched, testItem.units[0].TimeDispatched);
84
83
 
85
- assert.equal(sut.Comment.length, 1);
86
- assert.equal(sut.Comment[0].Comment, testItem.Comment[0].Comment);
87
- assert.equal(sut.Comment[0].CommentSource, testItem.Comment[0].CommentSource);
88
- assert.equal(sut.Comment[0].CommentDateTime, testItem.Comment[0].CommentDateTime);
84
+ assert.equal(sut.Comment.length, 1);
85
+ assert.equal(sut.Comment[0].Comment, testItem.Comment[0].Comment);
86
+ assert.equal(sut.Comment[0].CommentSource, testItem.Comment[0].CommentSource);
87
+ assert.equal(sut.Comment[0].CommentDateTime, testItem.Comment[0].CommentDateTime);
88
+ });
89
89
 
90
- // assert.equal(sut.incidentTypes[0].name, testItem.incidentTypes[0].name);
90
+ it("no virtuals id if _id not present", async function() {
91
+ const item = new models.CADIncident(testItem);
92
+ await item.save();
91
93
 
92
- return done();
94
+ const sut = await models.CADIncident.findOne({ _id: item._id }).lean({
95
+ virtuals: true
93
96
  });
97
+ assert.equal(sut.units.length, 1);
98
+ assert.isUndefined(sut.units[0].id);
99
+
100
+ assert.equal(sut.Comment.length, 1);
101
+ assert.isUndefined(sut.Comment[0].id);
94
102
  });
95
103
  });
@@ -39,6 +39,7 @@ describe("CSVImport", function() {
39
39
  // assert.equal(testItem.fileLastModified, sut.fileLastModified);
40
40
  assert.equal(testItem.records.length, 0);
41
41
  assert.equal(testItem.userId, sut.userId);
42
+ assert.equal(testItem.sendNotification, sut.sendNotification);
42
43
  });
43
44
  });
44
45
 
package/test/mock.js CHANGED
@@ -855,7 +855,8 @@ module.exports = function(dependencies) {
855
855
  fileSize: 800,
856
856
  records: [],
857
857
  userId: "4321",
858
- status: "success"
858
+ status: "success",
859
+ sendNotification: false
859
860
  };
860
861
 
861
862
  async function cleanup() {