payservedb 3.9.2 → 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 +1 -1
- package/src/models/handover.js +3 -2
package/package.json
CHANGED
package/src/models/handover.js
CHANGED
|
@@ -54,12 +54,12 @@ 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
61
|
required: true
|
|
61
62
|
},
|
|
62
|
-
// propertyManagerId removed as requested
|
|
63
63
|
|
|
64
64
|
// Handover details
|
|
65
65
|
handoverType: {
|
|
@@ -236,6 +236,7 @@ handoverSchema.methods.compareWithMoveIn = async function() {
|
|
|
236
236
|
return differences;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
+
// Create and export the model with the standard pattern
|
|
239
240
|
const Handover = mongoose.model('Handover', handoverSchema);
|
|
240
241
|
|
|
241
242
|
module.exports = Handover;
|