909-Save-PDFs #1084

Merged
c24danli merged 5 commits from 909-Save-PDFs into team_2_week_7 2026-05-22 08:35:23 +00:00
Collaborator

What has been done

Added support for .pdf and .gif files.

  • DockerCompose/stacks/file/init_sql/04-files.sql
    • Added db init file (it was missing)
  • service/fileService/fileService/Services/FileService.cs
    • Moved file validation methods and fields to its own class (Util/FileValidator.cs)
  • service/fileService/fileService/Util/FileValidator.cs
    • Added file extensions, file signature, and http content-type for .pdf and .gif.
  • service/fileService/fileService/README.md
    • Added info to reflect changes
    • Added instructions to add other filetypes
  • Others
    • Removed unnecessary using statements

Gifs are added since they're fun
Relevant issue: #909

## What has been done Added support for .pdf and .gif files. - `DockerCompose/stacks/file/init_sql/04-files.sql` - Added db init file (it was missing) - `service/fileService/fileService/Services/FileService.cs` - Moved file validation methods and fields to its own class (`Util/FileValidator.cs`) - `service/fileService/fileService/Util/FileValidator.cs` - Added file extensions, file signature, and http content-type for .pdf and .gif. - `service/fileService/fileService/README.md` - Added info to reflect changes - Added instructions to add other filetypes - Others - Removed unnecessary using statements Gifs are added since they're fun Relevant issue: #909
Collaborator

Review on #909

Whats done

  • Uploaded and viewed .pdf and .gif file
  • Reviewed code

Tested on Windows 11 using Chrome (not Bruno)

  • Everything started
    • Was able to upload .gif file
      image
      image
    • Was able to view uploaded .gif file
      image
    • Was able to upload .pdf file
      image
      image
    • Was able to view uploaded .pdf file
      image
    • Both files can be found in volume
      image

Inspected following files

  • DockerCompose/stacks/file/init_sql/04-files.sql
    • Indentation/code styling
      • Follow SQL standards
    • Naming convention
      • Yes, but I have removed the 03-init sql file, this should therefore be renamed 03-files.sql
    • Comments
      • Yes!
    • General code quality
      • Good!
  • service/fileService/fileService/DatabaseLogic/DatabaseQueries.cs
    • Looks good!
  • service/fileService/fileService/Endpoints/FileEndpoints.cs
    • Cleanup, good!
  • service/fileService/fileService/Models/FileResponse.cs
    • Cleanup, good!
  • service/fileService/fileService/README.md
    • Everything important is included
  • service/fileService/fileService/Services/FileService.cs
    • File validation logic has been moved to its own file, good decision!
    • New calls work!
  • service/fileService/fileService/Util/FileValidator.cs
    • Since these methods now exist in their own file, summaries should probably include som information about parameters and returns
    • Otherwise good!

What needs to be done

  • service/fileService/fileService/README.md
    • Could do with a clean up/rewrite, but not at all important
  • service/fileService/fileService/Util/FileValidator.cs
    • Method summaries could use information about parameters/return value

Conclusion

  • Everything works well and tests return expected values
  • Well done!
# Review on #909 ## Whats done + Uploaded and viewed .pdf and .gif file + Reviewed code ### Tested on Windows 11 using Chrome (not Bruno) + Everything started + Was able to upload .gif file ![image](/attachments/fcbd61f5-36a5-4693-a7e9-6a10500ae451) ![image](/attachments/5c0aad59-9df7-4b87-86eb-8ab51722acf4) + Was able to view uploaded .gif file ![image](/attachments/36e4f965-281f-4edf-82a3-070d363be8de) + Was able to upload .pdf file ![image](/attachments/c17a52d3-1424-485c-a8f8-8d1a8e2035b8) ![image](/attachments/8993f9e4-019e-4028-bddc-f182943c985f) + Was able to view uploaded .pdf file ![image](/attachments/02c3bf95-3149-43b4-afeb-40c71579319a) + Both files can be found in volume ![image](/attachments/e8d18625-de02-4850-8306-bc1b36bcdc07) ### Inspected following files + DockerCompose/stacks/file/init_sql/04-files.sql + Indentation/code styling + Follow SQL standards + Naming convention + Yes, but I have removed the 03-init sql file, this should therefore be renamed 03-files.sql + Comments + Yes! + General code quality + Good! + service/fileService/fileService/DatabaseLogic/DatabaseQueries.cs + Looks good! + service/fileService/fileService/Endpoints/FileEndpoints.cs + Cleanup, good! + service/fileService/fileService/Models/FileResponse.cs + Cleanup, good! + service/fileService/fileService/README.md + Everything important is included + service/fileService/fileService/Services/FileService.cs + File validation logic has been moved to its own file, good decision! + New calls work! + service/fileService/fileService/Util/FileValidator.cs + Since these methods now exist in their own file, summaries should probably include som information about parameters and returns + Otherwise good! ## What needs to be done + service/fileService/fileService/README.md + Could do with a clean up/rewrite, but not at all important + service/fileService/fileService/Util/FileValidator.cs + Method summaries could use information about parameters/return value ## Conclusion + Everything works well and tests return expected values + Well done!
a24vinla requested changes 2026-05-21 14:05:18 +00:00
Dismissed
a24vinla left a comment
Collaborator

Add some more info to method summaries!

Add some more info to method summaries!
a24vinla approved these changes 2026-05-22 06:58:32 +00:00
Collaborator

Ready to be merged!

Ready to be merged!
c24danli merged commit 3c03c0b5b7 into team_2_week_7 2026-05-22 08:35:23 +00:00
c24danli deleted branch 909-Save-PDFs 2026-05-22 12:37:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!1084
No description provided.