payservedb 8.2.5 → 8.2.7

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
@@ -232,7 +232,8 @@ const models = {
232
232
  InspectionCategory: require("./src/models/inspection_category"),
233
233
  AgentRole: require("./src/models/agent_roles"),
234
234
  CustomerSatisfactionSurvey: require("./src/models/customer_satisfaction_survey"),
235
- AgentDepartment: require("./src/models/agent_departments")
235
+ AgentDepartment: require("./src/models/agent_departments"),
236
+ DocumentType: require("./src/models/document_type")
236
237
  };
237
238
 
238
239
  // 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": "8.2.5",
3
+ "version": "8.2.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -192,8 +192,9 @@ const CustomerSchema = new mongoose.Schema({
192
192
  required: true
193
193
  },
194
194
  documentType: {
195
- type: String,
196
- required: true
195
+ type: mongoose.Schema.Types.ObjectId,
196
+ ref: "DocumentType",
197
+ required: true,
197
198
  },
198
199
  document: {
199
200
  type: String,
@@ -201,6 +202,7 @@ const CustomerSchema = new mongoose.Schema({
201
202
  }
202
203
  }
203
204
  ]
205
+
204
206
  });
205
207
 
206
208
  const Customer = mongoose.model('Customer', CustomerSchema);
@@ -0,0 +1,20 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const documentTypeSchema = new mongoose.Schema({
4
+ facilityId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Facility',
7
+ },
8
+ name: {
9
+ type: String,
10
+ required: true,
11
+ unique: true,
12
+ trim: true,
13
+ },
14
+ }, {
15
+ timestamps: true,
16
+ });
17
+
18
+ const DocumentType = mongoose.model('DocumentType', documentTypeSchema);
19
+
20
+ module.exports = DocumentType;
@@ -77,8 +77,9 @@ const unitSchema = new mongoose.Schema({
77
77
  required: true
78
78
  },
79
79
  documentType: {
80
- type: String,
81
- required: true
80
+ type: mongoose.Schema.Types.ObjectId,
81
+ ref: "DocumentType",
82
+ required: true,
82
83
  },
83
84
  document: {
84
85
  type: String,