Newer
Older
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

Hugo SUBTIL
committed
import { UserRole } from './enum/user-role.enum';
export type UserDocument = User & Document;
@Schema()
export class User {

Hugo SUBTIL
committed
@Prop({ required: true })

Hugo SUBTIL
committed
@Prop({ required: true })
password: string;
@Prop({ default: false })
emailVerified: boolean;

Hugo SUBTIL
committed
@Prop({ enum: [UserRole.admin, UserRole.user], default: UserRole.user })
role: number;
}
export const UserSchema = SchemaFactory.createForClass(User);