payservedb 2.3.3 → 2.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
@@ -1,7 +1,6 @@
1
1
  const mongoose = require('mongoose');
2
2
  require('dotenv').config()
3
- const SMSAfricastalking = require('./src/models/sms_africastalking');
4
- const WaterConcentrator = require('./src/models/waterConcentrator');
3
+
5
4
 
6
5
  // Maintain a record of open connections for each database
7
6
  const connections = {};
@@ -11,8 +10,7 @@ const source = '?authSource=admin'
11
10
  // Utility function to connect to MongoDB
12
11
  async function connectToMongoDB(dbName) {
13
12
  try {
14
- //reV_Server:Inc0rr3ct12@
15
- // const authorization = "Ps:Letmein987@"
13
+
16
14
  const connectionString = `mongodb://Ps:Letmein987@127.0.0.1:27017/${dbName}${source}`;
17
15
  await mongoose.connect(connectionString, {
18
16
  useNewUrlParser: true,
@@ -83,6 +81,7 @@ const models = {
83
81
  Penalty: require('./src/models/penalty'),
84
82
  Reminder: require('./src/models/reminder'),
85
83
  BankDetails: require('./src/models/bankdetails'),
84
+ John:require('./src/models/john')
86
85
  };
87
86
 
88
87
  // 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": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,9 @@
1
+ const mongoose = require('mongoose');
2
+ const johnSchema = mongoose.Schema({
3
+ fullName:{
4
+ type:String,
5
+ required:true
6
+ }
7
+ })
8
+ const John = mongoose.model('John',johnSchema);
9
+ module.exports = John
@@ -17,7 +17,6 @@ const visitLogSchema = new mongoose.Schema({
17
17
  },
18
18
  residentId: {
19
19
  type: mongoose.Schema.Types.ObjectId,
20
- ref: 'Customer',
21
20
  },
22
21
  qrCode:{
23
22
  type:Boolean,
@@ -33,7 +33,8 @@ const waitListSchema = new mongoose.Schema({
33
33
  type: mongoose.Schema.Types.ObjectId,
34
34
  ref: 'Facility',
35
35
  required: true // Ensures a facilityId is always provided
36
- }
36
+ },
37
+
37
38
  }, {
38
39
  timestamps: true // Automatically add createdAt and updatedAt fields
39
40
  });