forked from Yara724/api
31 lines
713 B
TypeScript
31 lines
713 B
TypeScript
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
|
|
import { HydratedDocument } from "mongoose";
|
|
import { RoleEnum } from "src/Types&Enums/role.enum";
|
|
|
|
@Schema({
|
|
collection: "super-admins",
|
|
versionKey: false,
|
|
timestamps: true,
|
|
})
|
|
export class SuperAdminModel {
|
|
@Prop({ required: true, unique: true, index: true })
|
|
email: string;
|
|
|
|
@Prop({ required: true })
|
|
password: string;
|
|
|
|
@Prop({ required: true, default: RoleEnum.SUPER_ADMIN })
|
|
role: RoleEnum;
|
|
|
|
@Prop()
|
|
firstName?: string;
|
|
|
|
@Prop()
|
|
lastName?: string;
|
|
|
|
createdAt: Date;
|
|
}
|
|
|
|
export type SuperAdminDocument = HydratedDocument<SuperAdminModel>;
|
|
export const SuperAdminSchema = SchemaFactory.createForClass(SuperAdminModel);
|