ADD: Events

ADD: Index One Belonging
ADD: Belonging Code
This commit is contained in:
2025-06-04 16:07:45 +03:30
parent 98044a18f2
commit de60d4f163
9 changed files with 142 additions and 7 deletions
+3 -2
View File
@@ -20,7 +20,6 @@ const belongingSchema = new mongoose.Schema(
},
unit: {
type: String,
required: true,
},
description: String,
relatedProjects: [String],
@@ -62,7 +61,7 @@ const belongingSchema = new mongoose.Schema(
}
)
// belongingSchema.plugin(AutoIncrement, { inc_field: 'belongingCode' })
belongingSchema.plugin(AutoIncrement, { inc_field: 'belongingCode' })
belongingSchema.methods.getDocumentsSignedUrls = function () {
return getMultipleSignedUrls(this.documentUrls, 'belonging-documents')
@@ -74,5 +73,7 @@ belongingSchema.methods.getMainImagedSignedUrl = function () {
belongingSchema.index({ location: '2dsphere' }) // Enable geospatial queries
// belongingSchema.plugin(AutoIncrement, { inc_field: 'numId' })
const Belonging = mongoose.model('Belonging', belongingSchema)
module.exports = Belonging