eclipse / kapua

Eclipse Public License 2.0
227 stars 160 forks source link

✨ [REST-API] Add support to query operations by `status` in `GET /{scopeId}/devices/{deviceId}/operations` #4121

Closed MDeLuise closed 1 month ago

MDeLuise commented 1 month ago

Description

This PR implements the capability to search operations by their status using the GET /{scopeId}/devices/{deviceId}/operations endpoint.

Changes Made

The current query method was refactored because it was enforcing a "filter by device ID" constraint on all queries, regardless of any other predicates provided. This limitation prevented any other filtering criteria (e.g., status) from being applied, so the method has been updated to allow flexible filtering based on multiple criteria.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 16.80%. Comparing base (d5e338d) to head (a94041c). Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...urces/v1/resources/DeviceManagementOperations.java 0.00% 9 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4121/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/4121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4121 +/- ## ============================================= - Coverage 16.80% 16.80% -0.01% Complexity 22 22 ============================================= Files 2021 2021 Lines 52463 52468 +5 Branches 4424 4425 +1 ============================================= Hits 8815 8815 - Misses 43250 43255 +5 Partials 398 398 ``` | [Files with missing lines](https://app.codecov.io/gh/eclipse/kapua/pull/4121?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...urces/v1/resources/DeviceManagementOperations.java](https://app.codecov.io/gh/eclipse/kapua/pull/4121?src=pr&el=tree&filepath=rest-api%2Fresources%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fapp%2Fapi%2Fresources%2Fv1%2Fresources%2FDeviceManagementOperations.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-cmVzdC1hcGkvcmVzb3VyY2VzL3NyYy9tYWluL2phdmEvb3JnL2VjbGlwc2Uva2FwdWEvYXBwL2FwaS9yZXNvdXJjZXMvdjEvcmVzb3VyY2VzL0RldmljZU1hbmFnZW1lbnRPcGVyYXRpb25zLmphdmE=) | `0.00% <0.00%> (ø)` | |