BBMRI-ERIC / negotiator

An Open-source access negotation system for Research Infrastructures
https://negotiator.bbmri-eric.eu
GNU Affero General Public License v3.0
4 stars 8 forks source link

Feat/add filtering in backend #208

Closed svituz closed 5 months ago

svituz commented 5 months ago

Negotiator pull request:

Description:

This PR implements filtering and sorting for negotiations in the backend. The implementation changes the way the queries for Negotiation are applied. Indeed, using the Repository method naming would have needed too many methods, one per combination of filter parameters. Specification have been used. This allows to define a Criteria for each parameter and concatenate the parameters. This change allowed removing lots of NegotiationRepository's methods, since they are replaced by findAll(Spec, Pageable). Moreover, some of the NegotiationService methods have been changed to use the new Specification.

Checklist:

Make sure you tick all the boxes below if they are true or do not apply:

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 89.01099% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 77.76%. Comparing base (c8e2901) to head (2fe76c4).

Files Patch % Lines
.../negotiator/mappers/NegotiationModelAssembler.java 87.67% 7 Missing and 2 partials :warning:
.../database/repository/NegotiationSpecification.java 89.36% 3 Missing and 2 partials :warning:
...iator/api/controller/v3/NegotiationController.java 93.75% 0 Missing and 2 partials :warning:
...negotiator/dto/negotiation/NegotiationFilters.java 75.00% 2 Missing :warning:
...ri_eric/negotiator/database/model/Negotiation.java 0.00% 1 Missing :warning:
...ric/negotiator/service/NegotiationServiceImpl.java 91.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #208 +/- ## ============================================ + Coverage 76.13% 77.76% +1.62% - Complexity 892 909 +17 ============================================ Files 120 122 +2 Lines 2669 2779 +110 Branches 155 165 +10 ============================================ + Hits 2032 2161 +129 + Misses 527 509 -18 + Partials 110 109 -1 ``` | [Flag](https://app.codecov.io/gh/BBMRI-ERIC/negotiator/pull/208/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/BBMRI-ERIC/negotiator/pull/208/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC) | `77.76% <89.01%> (+1.62%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.