diff --git a/app/repositories/report.py b/app/repositories/report.py index 96bd598..dc83684 100644 --- a/app/repositories/report.py +++ b/app/repositories/report.py @@ -17,6 +17,16 @@ class ReportRepository(): match.update({'design.type_id': _inp.type_id}) if _inp.nature_id: match.update({'design.nature_id': _inp.nature_id}) + if type == 'design': + match.update({ + '$or': [ + {'has_monitor': False}, + { + 'monitor.has_design': True, + 'has_monitor': True + } + ] + }) if type == 'monitor' and _inp.monitor_type: match.update({'monitor.base_information.type': _inp.monitor_type}) report = await use_collection(TaskEnv.CLN_PROJECT).aggregate([