import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { Types } from "mongoose"; import { Degrees } from "src/Types&Enums/degrees.enum"; import { RoleEnum } from "src/Types&Enums/role.enum"; import { UserType } from "src/Types&Enums/userType.enum"; @Schema({ collection: "expert", versionKey: false, timestamps: true }) export class ExpertModel { @Prop({}) firstName: string; @Prop({}) role: RoleEnum; @Prop({}) userType: UserType; @Prop({}) lastName: string; @Prop({ unique: true }) nationalCode: string; @Prop({ type: "string", unique: true }) email: string; @Prop({}) password: string; @Prop({}) sheba: string; @Prop({}) phone: string; @Prop({}) mobile: string; @Prop({}) city: string; @Prop({}) state: string; @Prop({}) address: string; @Prop({ type: String }) expDegree: Degrees; @Prop({}) insuActivityTime?: number; @Prop({}) insuActivityCo?: string; @Prop({}) policeActivityTime?: number; @Prop({}) policeActivityKind?: string; @Prop({}) policeServicePlace?: string; @Prop({}) clientKey?: string; @Prop({ type: Types.ObjectId, index: true }) branchId?: Types.ObjectId; @Prop({ type: "string" }) otp: string; createdAt: Date; } export const ExpertDbSchema = SchemaFactory.createForClass(ExpertModel);