forked from Yara724/api
50 lines
978 B
TypeScript
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); |