Init commit

This commit is contained in:
2024-12-22 16:52:30 +03:30
parent 28ab698dfc
commit aeb38982ca
28 changed files with 1532 additions and 68 deletions
+30
View File
@@ -0,0 +1,30 @@
const mongoose = require('mongoose')
const ObjectID = mongoose.Schema.Types.ObjectId
const userSchema = new mongoose.Schema(
{
name: String,
password: {
type: String,
required: true,
trim: true,
},
isActive: {
type: Boolean,
default: true,
},
role: {
type: ObjectID,
ref: 'Role'
},
isAdmin: {
type: Boolean,
default: false,
},
},
{ toJSON: { virtuals: true }, toObject: { virtuals: true }, timestamps: true }
)
const User = mongoose.model('User', userSchema)
module.exports = User