1
0
forked from Yara724/api
Files
yara724-api/src/users/entities/schema/field-expert.schema.ts
SepehrYahyaee af875a4773 YARA-913
2026-05-24 10:10:17 +03:30

50 lines
978 B
TypeScript

import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { Types } from "mongoose";
import { RoleEnum } from "src/Types&Enums/role.enum";
@Schema({
collection: "field-expert",
versionKey: false,
timestamps: true,
})
export class FieldExpertModel {
_id?: Types.ObjectId;
@Prop({ required: true })
firstName: string;
@Prop({ required: true })
lastName: string;
@Prop({ type: "string", unique: true })
email: string;
@Prop({ type: "string" })
username: string;
@Prop({ required: true })
password: string;
@Prop({ required: true })
mobile: string;
@Prop({ required: false })
phone?: string;
@Prop({ default: RoleEnum.FIELD_EXPERT })
role: RoleEnum;
@Prop({ type: "string", default: "" })
otp: string;
@Prop({ default: null })
captcha?: string | null;
@Prop({ default: 0 })
captchaExpire?: number;
createdAt: Date;
}
export const FieldExpertDbSchema =
SchemaFactory.createForClass(FieldExpertModel);