payservedb 5.4.7 → 5.4.8

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
@@ -168,7 +168,8 @@ const models = {
168
168
  GLAccount: require('./src/models/gl_accounts'),
169
169
  GLEntry: require('./src/models/gl_entries'),
170
170
  GLAccountDoubleEntries: require('./src/models/gl_account_double_entries'),
171
- PendingCredential: require('./src/models/pendingCredentials')
171
+ PendingCredential: require('./src/models/pendingCredentials'),
172
+ UnitManagementTemplate: require('./src/models/unitManagementTemplate')
172
173
  };
173
174
 
174
175
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "5.4.7",
3
+ "version": "5.4.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,45 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const unitManagementTemplateSchema = new mongoose.Schema({
4
+ name: {
5
+ type: String,
6
+ required: true,
7
+ trim: true
8
+ },
9
+ description: {
10
+ type: String,
11
+ required: true,
12
+ trim: true
13
+ },
14
+ templateContent: {
15
+ type: String,
16
+ required: true
17
+ },
18
+ createdBy: {
19
+ type: mongoose.Schema.Types.ObjectId,
20
+ ref: 'User',
21
+ required: true
22
+ },
23
+ facilityId: {
24
+ type: mongoose.Schema.Types.ObjectId,
25
+ ref: 'Facility',
26
+ required: true
27
+ },
28
+ isDefault: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ createdAt: {
33
+ type: Date,
34
+ default: Date.now
35
+ },
36
+ updatedAt: {
37
+ type: Date,
38
+ default: Date.now
39
+ }
40
+ }, {
41
+ timestamps: true
42
+ });
43
+
44
+ // Add to payservedb
45
+ module.exports = mongoose.model('UnitManagementTemplate', unitManagementTemplateSchema);