import"../utils/validation/validateUser.mjs";import{Schema as e}from"mongoose";import t from"validator";const n=new e({email:{type:String,required:!0,unique:!0,validate:[t.isEmail,`Please fill a valid email address`],lowercase:!0,trim:!0},name:{type:String,maxlength:100,minlength:4},phone:{type:String,maxlength:20},customerId:{type:String,required:!1},emailsList:{type:{newsLetter:{type:Boolean,default:!1}},required:!1},role:{type:String,enum:[`admin`,`user`],default:`user`,required:!1},lastLoginMethod:{type:String,enum:[`email`,`google`,`github`],required:!1},lang:{type:String,required:!1},dateOfBirth:{type:Date,required:!1}},{timestamps:!0,toJSON:{virtuals:!0,versionKey:!1,transform(e,t){let{_id:n,...r}=t;return{...r,id:n.toString()}}},toObject:{virtuals:!0,transform(e,t){let{_id:n,...r}=t;return{...r,id:n}}}});export{n as userSchema};
//# sourceMappingURL=user.schema.mjs.map