EBISPOT/gwas-curation-service

Attach Literature to Publication - API endpoint to upload MultipartFiles for a given publication:

Closed this issue · 0 comments

Description:
As developer
I want an api endpoint
So that when I send a post request with a list of publication IDs as payload new publications are created in the database

Management Rules:
Rule 1: Endpoint - /api/v1/publications/{publicationId}/files
Rule 2: HTTP Request Method - POST
Rule 3: Proper Assemblers, disassemblers and DTO with validation rules
Rule 4: The Endpoint should accept validated FileDTO Object
Rule 5: Standard custom exception be thrown if operation fails
Rule 6: valid file types are pdf, xlsx or docx
Rule 7: Multiple files can belong to one publication
Rule 8: The uploaded binary file should be saved in Mongodb gridfs
Rule 9: Payload containing attributes of uploaded file (fileId, fileName, ... should be returned)

Acceptance Tests:
Given one or more binary file e.g pdf, xlsx or docx
When the front end sends a post request with the file to the endpoint

If no validation error occurs, the file should be saved, payload with fileId, fileName, ... should be returned