[BE] Implement event and Discussion Count on Designs
This is a placeholder for backend related work for https://gitlab.com/gitlab-org/gitlab-ee/issues/12705
Expose notesCount on DesignType
Instead of the front-end fetching all annotations and counting them, we should provide a notesCount field on DesignType.
See BaseCountService for a possible implementation of counter caching (example: Project#open_merge_requests_count).
Notes
- The version selector would not affect this count (as
Notes are associated withDesigns, we're unaware of the version of the design they were added, but I think this is a feature). - After a new annotation was added to a design, the front-end would need to refresh its cached store for the design (it may well do this already).
Expose event on DesignType
This would take into account the current version atVersion argument if present, similar to the image field and present the event as a String.
Edited by Luke Duncalfe