Skip to content

External validation endpoint #109

@leoraba

Description

@leoraba

Summary of request

This feature introduces an endpoint designed to verify the existence of a record with a specified value. The endpoint will be capable of performing checks within a given category, organization, and entity to ensure the existence of a record.

This feature is essential for applications that require validation of records within specific contexts, enhancing data integrity and user experience by preventing duplicate entries or ensuring the presence of required records.

Functionality Details:

  • The endpoint is a GET method, it will receive query parameters that specify the studyId and value to be checked, as well as the categoryId and entityName in which the record should be searched. Example:
GET http://localhost:3030/validator/category/{categoryId}/entity/{entityName}/exists?organization={studyId}&value{value}

Where:
- {categoryId} is the ID of the category the record belongs. Number type.
- {entityName} is a string, also known as Analysis Type in Song
- {studyId} is a string, also known as Organization in Lyric
- {value} is a string, value to check

  • Search should performed exclusively within the submitted_data table.
  • If the record is found, the endpoint will respond with a 200 OK status with empty body, confirming the existence of the record.
  • If the record does not exist, the endpoint will return a 404 Not found status, indicating that the specified value was not found. E.g.
{
   "error": "Not found",
   "message": "The specified value was not found."
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions