payservedb 5.3.4 → 5.3.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.
package/index.js CHANGED
@@ -156,6 +156,7 @@ const models = {
156
156
  GLAccount: require('./src/models/gl_accounts'),
157
157
  GLEntry: require('./src/models/gl_entries'),
158
158
  GLAccountDoubleEntries: require('./src/models/gl_account_double_entries'),
159
+ PendingCredential: require('./src/models/pendingCredentials')
159
160
  };
160
161
 
161
162
  // 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.3.4",
3
+ "version": "5.3.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,29 @@
1
+ const pendingCredentialSchema = new mongoose.Schema({
2
+ userId: {
3
+ type: mongoose.Schema.Types.ObjectId,
4
+ ref: 'User',
5
+ required: true
6
+ },
7
+ email: String,
8
+ phoneNumber: String,
9
+ fullName: String,
10
+ userType: String,
11
+ password: String, // Temporary storage of plain password for sending
12
+ facilityId: mongoose.Schema.Types.ObjectId,
13
+ status: {
14
+ type: String,
15
+ enum: ['pending', 'sent', 'failed'],
16
+ default: 'pending'
17
+ },
18
+ retryCount: {
19
+ type: Number,
20
+ default: 0
21
+ },
22
+ createdAt: {
23
+ type: Date,
24
+ default: Date.now,
25
+ expires: '7d' // Auto-delete after 7 days
26
+ }
27
+ });
28
+
29
+ module.exports = mongoose.model('PendingCredential', pendingCredentialSchema);