configurations

Run Configuration Test

Changed on

Runs an inline test of a given configuration against an eICR/RR pair.

This endpoint orchestrates the validation and refinement process by:

  1. Handling file input, either from a user upload or a default sample file.
  2. Calling the inline_testing service, which validates that the specified configuration's condition is reportable in the provided file.
  3. Handling the service response:
    • If validation fails, raises a 400 Bad Request with a specific error.
    • If successful, proceeds with the returned refined document.
  4. Packaging the original eICR, RR, and the single refined eICR into a new in-memory zip archive.
  5. Uploading the archive to S3 and generating a pre-signed download URL.
  6. Returning a ConfigurationTestResponse with the download URL and details of the successful refinement.

Args: id: The ID of the configuration to test. uploaded_file: An optional user-provided zip file with an eICR and RR. create_output_zip: Dependency to create a zip archive in memory. upload_zip: Dependency to upload the archive to S3. user: The authenticated user making the request. db: The database connection. sample_zip_path: Path to the default sample zip file. logger: The application logger.

Returns: A response object containing the original eICR, a URL to download the zipped results, and details about the refined condition.

post/api/v1/configurations/test

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body multipart/form-data

BodyRunInlineConfigurationTest required
id, string uuid required
uploaded_file, string binary nullable

Response

Successful Response

ConfigurationTestResponse required

Model to represent the response provided to the client when in-line testing is run.

original_eicr, string required
refined_download_key, string required
condition, Condition required

Model for a Condition.

Changes