payservedb 3.9.1 → 3.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -54,14 +54,10 @@ const handoverSchema = new mongoose.Schema({
54
54
  ref: 'Unit',
55
55
  required: true
56
56
  },
57
+ // IMPORTANT: For Customer, we don't specify 'ref' since it's in a different database
58
+ // This avoids the cross-database population errors
57
59
  customerId: {
58
60
  type: mongoose.Schema.Types.ObjectId,
59
- ref: 'Customer',
60
- required: true
61
- },
62
- propertyManagerId: {
63
- type: mongoose.Schema.Types.ObjectId,
64
- ref: 'User', // Reference to your User model
65
61
  required: true
66
62
  },
67
63
 
@@ -240,6 +236,7 @@ handoverSchema.methods.compareWithMoveIn = async function() {
240
236
  return differences;
241
237
  };
242
238
 
239
+ // Create and export the model with the standard pattern
243
240
  const Handover = mongoose.model('Handover', handoverSchema);
244
241
 
245
242
  module.exports = Handover;