Update the API link-record endpoint to only accept one argument for specifying the algorithm, and create a new endpoint to list the available algorithms.
Acceptance Criteria
[ ] create a new endpoint, algorithms that will list the available algorithms based on the database configuration
[ ] update the link-record endpoint to accept just 1 parameter for the algorithm to use
[ ] test cases for the changes above
[ ] update OpenAPI docs for the endpoint changes
Details / Tasks
Remove the use_enhanced and algo_config parameters on the link-record endpoint and replace that with a new parameter, algorithm. The value should be a string, that maps to the unique label stored in the Algorithm table (ie DIBBS_BASIC or DIBBS_ENHANCED).
When the link-record receives a request with no algorithm specified, the default should be used.
When an invalid algorithm is specified (meaning no matching label in the DB), a 422 should be return with an explanation
For valid requests, the Algorithm should be sourced from the algorithms.py file. This is a short-term change, as we need to update the code in link.py and mpi.py for parsing Algorithm data before we can pass through an instance of the Algorithm model
Dependencies
13 we'll need to be able to query the new Algorithm database table first.
Testing Considerations
Consider using the built-in FastAPI test client for stubbing out new test cases for the API changes. Don't worry about integration tests at this time, unit tests are the priority. We can mock out any calls to the link_record_against_mpi and add_person_resource functions.
Summary
Update the API link-record endpoint to only accept one argument for specifying the algorithm, and create a new endpoint to list the available algorithms.
Acceptance Criteria
algorithms
that will list the available algorithms based on the database configurationlink-record
endpoint to accept just 1 parameter for the algorithm to useDetails / Tasks
link-record
endpoint and replace that with a new parameter,algorithm
. The value should be a string, that maps to the unique label stored in the Algorithm table (ie DIBBS_BASIC or DIBBS_ENHANCED).link-record
receives a request with no algorithm specified, the default should be used.Dependencies
13 we'll need to be able to query the new Algorithm database table first.
Testing Considerations
Consider using the built-in FastAPI test client for stubbing out new test cases for the API changes. Don't worry about integration tests at this time, unit tests are the priority. We can mock out any calls to the
link_record_against_mpi
andadd_person_resource
functions.