Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External validation endpoint #109

Open
leoraba opened this issue Nov 15, 2024 · 0 comments
Open

External validation endpoint #109

leoraba opened this issue Nov 15, 2024 · 0 comments
Assignees

Comments

@leoraba
Copy link
Contributor

leoraba commented Nov 15, 2024

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/{categoryId}/{entityName}?studyId={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 400 Bad Request status, indicating that the specified value was not found. E.g.
{
   "error": "INVALID_VALUE",
   "message": "Any string message describing why the value is invalid"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants