This commit is contained in:
PLBXNebulia-Formation 2025-11-21 09:23:11 +01:00
commit d1c8cae2c1
1417 changed files with 326736 additions and 0 deletions

32
models/Sessions.js Normal file
View file

@ -0,0 +1,32 @@
const {Schema, model} = require('mongoose')
const MaterialsSchema = new Schema({
name: {
type: String,
required: true,
trim: true
},
os: {
type: String,
trim: true
}
});
const SessionsSchema = new Schema({
user:{
type: Schema.Types.ObjectId,
ref: 'User',
required : true
},
logDate: {
type: Date,
required: true
},
material: MaterialsSchema
},{
timestamps: true
})
SessionsSchema.index({user:1})
module.exports = model('Session', SessionsSchema)