read the expert Ids from the db not hardcoded from every flow

This commit is contained in:
2026-11-09 16:31:25 +03:30
parent 6cc59b1777
commit 6775635a81
10 changed files with 604 additions and 163 deletions
@@ -20,6 +20,12 @@ export class ExpertDbService {
return await this.expertModel.findOne(user).lean();
}
async findById(userId: string): Promise<ExpertModel | null> {
return await this.expertModel
.findOne({ _id: new Types.ObjectId(userId) })
.lean();
}
async findOneAndUpdate(
user: FilterQuery<ExpertModel>,
update: FilterQuery<ExpertModel>,