Project

General

Profile

Actions

CompressPdf #484

open

Develop DELETE /v1/delete-records API

Added by Zahid Hassan over 1 year ago. Updated over 1 year ago.

Status:
Complete
Priority:
High
Assignee:
Category:
feature
Target version:
Start date:
10/16/2024
Due date:
10/16/2024 (about 18 months late)
% Done:

100%

Estimated time:
2:00 h

Description

Description:

The DELETE /v1/delete-records API is designed to automatically delete records from the database where the expiry time has been crossed. This issue highlights the necessary steps to ensure that the API follows standard RESTful conventions, proper response structures, and consistent handling of success and error cases.

Request Parameters:

No parameters are required for this API as it automatically deletes records where the expiry time is past.

Status Codes:

  • 200 OK: This should be returned when records have been successfully deleted from the database.

Example response:

{
  "detail": "deleted 25 records from database",
  "status": true
}
  • 404 Not Found: This should be returned when no records are found with expired time to delete.

Example response:

{
  "detail": "no record found to delete from database",
  "status": false
}

Response Structure:

  • The success response (200 OK) should indicate the number of records deleted from the database and a success status.
  • The error response (404 Not Found) should include a clear message indicating that no records were found for deletion, along with a failure status flag.

Error Handling:

  • Ensure that if the deletion process fails (no matching records), the API returns appropriate error messages with the 404 Not Found status.
  • If no records are found to delete, the API should not return 200 OK; instead, it should return 404 Not Found with the message that no records were found.
Actions #1

Updated by Redmine Admin over 1 year ago

  • Status changed from To Do to Complete
Actions

Also available in: Atom PDF