Duplicate records in Entity repositories
Filtering by user assigned to transect requires join with cross reference table user_transect
. Then, user condition is added in where condition. However, when there is no user filtering (admin user), it results in duplicate rows, due to join with many-to-many cross reference user_transect
table - with all combinations with all assigned users. This makes a problem in aggregate queries for diagrams and widgets, where the values need to be counted only once.
AC
-
There are no duplicated records in joins, or other solution is implemented to avoid double counting in aggregate functions in dashboard and widget queries. -
Solution applies to Transect, Inspection, Observation, QSObservation, Section and SectionEvent -
Tests
Edited by Michael Voigt