замечания 3
This commit is contained in:
46
server/routers/procurement/models/Experience.js
Normal file
46
server/routers/procurement/models/Experience.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const experienceSchema = new mongoose.Schema({
|
||||
companyId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Company',
|
||||
required: true,
|
||||
index: true
|
||||
},
|
||||
confirmed: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
customer: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
subject: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
volume: {
|
||||
type: String
|
||||
},
|
||||
contact: {
|
||||
type: String
|
||||
},
|
||||
comment: {
|
||||
type: String
|
||||
},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
index: true
|
||||
},
|
||||
updatedAt: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
});
|
||||
|
||||
// Индексы для оптимизации поиска
|
||||
experienceSchema.index({ companyId: 1, createdAt: -1 });
|
||||
|
||||
module.exports = mongoose.model('Experience', experienceSchema);
|
||||
|
||||
Reference in New Issue
Block a user