forked from Yara724/api
YARA-986
This commit is contained in:
30
src/super-admin/entities/schema/super-admin.schema.ts
Normal file
30
src/super-admin/entities/schema/super-admin.schema.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user