tabletcommand-backend-models 5.17.41 → 5.18.2

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 (36) hide show
  1. package/build/models/agency.js +9 -4
  2. package/build/models/agency.js.map +1 -1
  3. package/build/models/battalion.js +9 -4
  4. package/build/models/battalion.js.map +1 -1
  5. package/build/models/checklist.js +8 -3
  6. package/build/models/checklist.js.map +1 -1
  7. package/build/models/department.js +4 -0
  8. package/build/models/department.js.map +1 -1
  9. package/build/models/personnel-import.js +8 -3
  10. package/build/models/personnel-import.js.map +1 -1
  11. package/build/models/template.js +8 -3
  12. package/build/models/template.js.map +1 -1
  13. package/build/models/user.js +10 -5
  14. package/build/models/user.js.map +1 -1
  15. package/definitions/models/agency.d.ts +95 -6
  16. package/definitions/models/agency.d.ts.map +1 -1
  17. package/definitions/models/battalion.d.ts +121 -6
  18. package/definitions/models/battalion.d.ts.map +1 -1
  19. package/definitions/models/checklist.d.ts +116 -6
  20. package/definitions/models/checklist.d.ts.map +1 -1
  21. package/definitions/models/department.d.ts +1 -0
  22. package/definitions/models/department.d.ts.map +1 -1
  23. package/definitions/models/personnel-import.d.ts +83 -6
  24. package/definitions/models/personnel-import.d.ts.map +1 -1
  25. package/definitions/models/template.d.ts +90 -6
  26. package/definitions/models/template.d.ts.map +1 -1
  27. package/definitions/models/user.d.ts +282 -5
  28. package/definitions/models/user.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/models/agency.ts +8 -3
  31. package/src/models/battalion.ts +7 -3
  32. package/src/models/checklist.ts +7 -2
  33. package/src/models/department.ts +4 -0
  34. package/src/models/personnel-import.ts +7 -2
  35. package/src/models/template.ts +7 -2
  36. package/src/models/user.ts +9 -4
@@ -9,7 +9,7 @@ import {
9
9
  ReplaceModelReturnType,
10
10
  } from "../helpers";
11
11
 
12
- export async function AgencyModule(mongoose: MongooseModule) {
12
+ export function AgencySchema(mongoose: MongooseModule) {
13
13
  const { Schema, Types } = mongoose;
14
14
 
15
15
  const CrossStaffedUnit = createSchema(Schema, {
@@ -79,12 +79,12 @@ export async function AgencyModule(mongoose: MongooseModule) {
79
79
  default: false,
80
80
  },
81
81
  departmentId: {
82
- type: mongoose.Schema.Types.ObjectId,
82
+ type: Types.ObjectId,
83
83
  ref: "Department",
84
84
  required: true
85
85
  },
86
86
  administrators: {
87
- type: [mongoose.Schema.Types.ObjectId],
87
+ type: [Types.ObjectId],
88
88
  ref: "User",
89
89
  default: []
90
90
  },
@@ -109,6 +109,11 @@ export async function AgencyModule(mongoose: MongooseModule) {
109
109
  });
110
110
  modelSchema.set("autoIndex", false);
111
111
 
112
+ return modelSchema;
113
+ }
114
+
115
+ export async function AgencyModule(mongoose: MongooseModule) {
116
+ const modelSchema = AgencySchema(mongoose);
112
117
  return createModel(mongoose, "Agency", modelSchema);
113
118
  }
114
119
 
@@ -15,7 +15,7 @@ import {
15
15
  retrieveCurrentUnixTime
16
16
  } from "../helpers";
17
17
 
18
- export async function BattalionModule(mongoose: MongooseModule) {
18
+ export function BattalionSchema(mongoose: MongooseModule) {
19
19
  const { Schema, Types } = mongoose;
20
20
  const toJSONOpts = {
21
21
  virtuals: true,
@@ -81,7 +81,7 @@ export async function BattalionModule(mongoose: MongooseModule) {
81
81
  type: String,
82
82
  },
83
83
  agencyId: {
84
- type: mongoose.Schema.Types.ObjectId,
84
+ type: Types.ObjectId,
85
85
  ref: "Agency",
86
86
  default: null,
87
87
  },
@@ -131,7 +131,7 @@ export async function BattalionModule(mongoose: MongooseModule) {
131
131
  index: true,
132
132
  },
133
133
  agencyId: {
134
- type: mongoose.Schema.Types.ObjectId,
134
+ type: Types.ObjectId,
135
135
  ref: "Agency",
136
136
  default: null,
137
137
  },
@@ -175,7 +175,11 @@ export async function BattalionModule(mongoose: MongooseModule) {
175
175
  }
176
176
  });
177
177
  }
178
+ return modelSchema;
179
+ }
178
180
 
181
+ export async function BattalionModule(mongoose: MongooseModule) {
182
+ const modelSchema = BattalionSchema(mongoose);
179
183
  return createModel(mongoose, "Battalion", modelSchema);
180
184
  }
181
185
 
@@ -16,7 +16,7 @@ import {
16
16
 
17
17
  import { ChecklistItemSchema } from "./checklist-item";
18
18
 
19
- export async function ChecklistModule(mongoose: MongooseModule) {
19
+ export function ChecklistSchema(mongoose: MongooseModule) {
20
20
  const { Schema, Types } = mongoose;
21
21
 
22
22
  const ChecklistItem = ChecklistItemSchema(mongoose);
@@ -67,7 +67,7 @@ export async function ChecklistModule(mongoose: MongooseModule) {
67
67
  required: true
68
68
  },
69
69
  agencyId: {
70
- type: mongoose.Schema.Types.ObjectId,
70
+ type: Types.ObjectId,
71
71
  ref: "Agency",
72
72
  default: null,
73
73
  },
@@ -92,6 +92,11 @@ export async function ChecklistModule(mongoose: MongooseModule) {
92
92
  return this._id.toString();
93
93
  });
94
94
 
95
+ return modelSchema;
96
+ }
97
+
98
+ export async function ChecklistModule(mongoose: MongooseModule) {
99
+ const modelSchema = ChecklistSchema(mongoose);
95
100
  return createModel(mongoose, "Checklist", modelSchema);
96
101
  }
97
102
 
@@ -133,6 +133,10 @@ export async function DepartmentModule(mongoose: MongooseModule) {
133
133
  type: String,
134
134
  default: "",
135
135
  },
136
+ contact_department: {
137
+ type: String,
138
+ default: "",
139
+ },
136
140
  contact_name: {
137
141
  type: String,
138
142
  default: "",
@@ -9,7 +9,7 @@ import {
9
9
  ReplaceModelReturnType,
10
10
  } from "../helpers";
11
11
 
12
- export async function PersonnelImportModule(mongoose: MongooseModule) {
12
+ export function PersonnelImportSchema(mongoose: MongooseModule) {
13
13
  const { Schema, Types } = mongoose;
14
14
 
15
15
  const modelSchema = createSchema(Schema, {
@@ -84,7 +84,7 @@ export async function PersonnelImportModule(mongoose: MongooseModule) {
84
84
  default: ""
85
85
  },
86
86
  agencyId: {
87
- type: mongoose.Schema.Types.ObjectId,
87
+ type: Types.ObjectId,
88
88
  ref: "Agency",
89
89
  default: null,
90
90
  },
@@ -97,6 +97,11 @@ export async function PersonnelImportModule(mongoose: MongooseModule) {
97
97
  });
98
98
  modelSchema.set("autoIndex", false);
99
99
 
100
+ return modelSchema;
101
+ }
102
+
103
+ export async function PersonnelImportModule(mongoose: MongooseModule) {
104
+ const modelSchema = PersonnelImportSchema(mongoose);
100
105
  return createModel(mongoose, "PersonnelImport", modelSchema);
101
106
  }
102
107
 
@@ -14,7 +14,7 @@ import {
14
14
  retrieveCurrentUnixTime
15
15
  } from "../helpers";
16
16
 
17
- export async function TemplateModule(mongoose: MongooseModule) {
17
+ export function TemplateSchema(mongoose: MongooseModule) {
18
18
  const { Schema, Types } = mongoose;
19
19
 
20
20
  const ChecklistOption = createSchema(Schema, {
@@ -101,7 +101,7 @@ export async function TemplateModule(mongoose: MongooseModule) {
101
101
  default: []
102
102
  },
103
103
  agencyId: {
104
- type: mongoose.Schema.Types.ObjectId,
104
+ type: Types.ObjectId,
105
105
  ref: "Agency",
106
106
  default: null,
107
107
  },
@@ -136,6 +136,11 @@ export async function TemplateModule(mongoose: MongooseModule) {
136
136
  });
137
137
  }
138
138
  // modelSchema.plugin(mongooseLeanVirtuals);
139
+ return modelSchema;
140
+ }
141
+
142
+ export async function TemplateModule(mongoose: MongooseModule) {
143
+ const modelSchema = TemplateSchema(mongoose);
139
144
  return createModel(mongoose, "Template", modelSchema);
140
145
  }
141
146
 
@@ -15,8 +15,8 @@ import EsriAuthSchema from "./schema/esri-auth";
15
15
  import EsriErrorSchema from "./schema/esri-error";
16
16
  import PubNubTokenSchema from "./schema/pubnub-token";
17
17
 
18
- export async function UserModule(mongoose: MongooseModule) {
19
- const { Schema } = mongoose;
18
+ export function UserSchema(mongoose: MongooseModule) {
19
+ const { Schema, Types } = mongoose;
20
20
  const EsriAuth = EsriAuthSchema(mongoose);
21
21
  const EsriError = EsriErrorSchema(mongoose);
22
22
  const PubNubToken = PubNubTokenSchema(mongoose);
@@ -68,12 +68,12 @@ export async function UserModule(mongoose: MongooseModule) {
68
68
  type: Date,
69
69
  },
70
70
  agencyId: {
71
- type: mongoose.Schema.Types.ObjectId,
71
+ type: Types.ObjectId,
72
72
  ref: "Agency",
73
73
  default: null,
74
74
  },
75
75
  managedAgencies: {
76
- type: [mongoose.Schema.Types.ObjectId],
76
+ type: [Types.ObjectId],
77
77
  ref: "Agency",
78
78
  default: []
79
79
  },
@@ -255,6 +255,11 @@ export async function UserModule(mongoose: MongooseModule) {
255
255
  return this._id.toHexString();
256
256
  });
257
257
 
258
+ return modelSchema;
259
+ }
260
+
261
+ export async function UserModule(mongoose: MongooseModule) {
262
+ const modelSchema = UserSchema(mongoose);
258
263
  return createModel(mongoose, "User", modelSchema);
259
264
  }
260
265