add findByIdLean for workers

This commit is contained in:
Alex Holliday committed 2026-06-18 11:06:19 -07:00
1 parent f740eef0fa
commit 190a3b47da
2 files changed
+7

No files matched your search

@@ -38,6 +38,11 @@ class MongoMonitorsRepository implements IMonitorsRepository {
return this.toEntity(monitor);
};
findByIdLean = async (monitorId: string): Promise<Monitor | null> => {
const monitor = await MonitorModel.findOne({ _id: monitorId });
return monitor ? this.toEntity(monitor) : null;
};
findAll = async (): Promise<Monitor[]> => {
const monitors = await MonitorModel.find();
return this.mapDocuments(monitors);