Sprint 2 | Admin | Book C.R.U.D | ZIP GIF Processing & Upload
To-Do:
-
Implement an endpoint to receive a zip file containing GIFs
-
Validate the zip file format upon upload
-
Receive from controller the books name and other relevant information
-
Check if the book related to the GIFs already exists in the database
-
If the book exists, update all gifs to the current list
-
Handle invalid or corrupted zip files
-
Return appropriate error messages for invalid uploads or books not found
The service receives a zip file containing GIFs related to a book, which are processed and stored in the database.
The system validates whether the book exists before adding or updating GIFs in bulk.
Given a valid zip file containing GIFs for an existing book is sent to the upload endpoint
When the zip file is uploaded to the service
Then the service should extract the metadata to identify the book
And check if the book exists in the database
And if the book exists, the service should send to the repository to update all gifs related to
Given a valid zip file containing GIFs for a new book is sent to the upload endpoint
When the zip file is uploaded to the service
Then the service should extract the metadata to identify the book
And if the book does not exist in the database, it should be added
And all associated GIFs are stored in the database for the new book
Given a zip file for a non-existent or invalid book is sent to the upload endpoint
When the zip file is uploaded to the service
Then the service should return an error response indicating the book was not found in the system
Given an invalid or corrupted zip file is sent to the upload endpoint
When the file is uploaded to the service
Then the service should return an error response indicating the zip file could not be processed