dynamic locations

This commit is contained in:
2026-11-11 14:10:01 +03:30
parent 5e3bd02243
commit 658a8a74cc
18 changed files with 454 additions and 111 deletions
@@ -2,6 +2,19 @@ import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { Types } from "mongoose";
import { RoleEnum } from "src/Types&Enums/role.enum";
@Schema({ _id: false, versionKey: false })
export class FieldExpertLocationModel {
@Prop({ type: String, required: true })
id: string;
@Prop({ type: String, required: true })
name: string;
}
export const FieldExpertLocationDbSchema = SchemaFactory.createForClass(
FieldExpertLocationModel,
);
@Schema({
collection: "field-expert",
versionKey: false,
@@ -31,6 +44,9 @@ export class FieldExpertModel {
@Prop({ type: Types.ObjectId, index: true })
branchId?: Types.ObjectId;
@Prop({ type: [FieldExpertLocationDbSchema], default: [] })
locations?: FieldExpertLocationModel[];
@Prop({ required: true })
password: string;