[Search.Phase 1] Implement search of Sample Analysis WPC(s) by its measurements
Note: This issue covers only the scope of the first implementation stage. Any additional considerations and improvements will be listed separately.
Business goal
To implement a simplified way of searching and retrieving Sample Analysis WPC by entering one or several search criteria from its bulk data in one request.
User Story
As the DDMS user, I need a REST API endpoint to search
WPC for a particular analysis type. This endpoint must provide filter capabilities and support content schema preferences.
Implementation details
- Add the
/api/rafs-ddms/v2/samplesanalysis/{analysistype}/search
end-point. - Implement the following functionality
- build a list of WPC IDs for the specified type of analysis
- Apply the
rows_filter
on each dataset or merge them and apply (will depend on the performance) - Respond with a list of WPC IDs whose data regarding the filters was found
Schema version
Currently, the RAFS DDMS does not support dynamic (in runtime) schema conversion, i.e., enforcement of the data to the particular (newer) schema. On the search request, the system should use ONLY datasets that are written with the same content schema version as supplied with the Accept header for the search.
Filtration
In a search query, a user should be able to specify the following:
- attribute by which the search should be performed (mandatory)
- operator (mandatory)
- value (mandatory)
The functionality has to repeat the /data
endpoints filtering functionality.
Users should be able to combine multiple search criteria.
Response
Only data that the user has permission to view or edit should be displayed (the user is included in corresponding SampleAnalysis WPC "owners" or "viewers" ACL groups).
Response Format
The response should be formed as a list of Sample Analysis WPC IDs that satisfy the queried condition.
Codes:
200 - query was successfully executed, and 0+ results were returned
400 - bad request
422 - validation error
Validation Errors
The validation error behavior must be the same as for the /data
endpoints.
Acceptance Criteria
The user can perform a Sample Analysis WPC IDs search using the RAFS DDMS endpoint, providing related sample analysis content schema properties.
A query returns a list of Sample Analysis WPC IDs based on the parameters and conditions provided. Users can combine different search requests using AND / OR operators to get narrowed or broader search results.
Validation error should be displayed with an informative message in case a search request is entered not according to the specified format.