This command will be used to upload a new profile picture for a User. It will need a data class (called Request) that has the following parameters:
The command should check that the user id refers to a valid user record. If this validation fails, we should respond with a HashMultimap<ErrorTag, String> as a failure data type
Otherwise, it should check to see if the user already has a profile picture uploaded, and if so, it should call a separate S3 service to delete this image. It should then call an S3 upload service to upload the new image. If the image is uploaded successfully, the ProfilePicture record associated with the User should be retrieved and updated. A boolean marked true should be returned as the success data type.
If the aforementioned image upload is not successful, we should respond with the errors the S3 upload service returned.
This command will be used to upload a new profile picture for a User. It will need a data class (called Request) that has the following parameters:
The command should check that the user id refers to a valid user record. If this validation fails, we should respond with a HashMultimap<ErrorTag, String> as a failure data type
Otherwise, it should check to see if the user already has a profile picture uploaded, and if so, it should call a separate S3 service to delete this image. It should then call an S3 upload service to upload the new image. If the image is uploaded successfully, the ProfilePicture record associated with the User should be retrieved and updated. A boolean marked true should be returned as the success data type.
If the aforementioned image upload is not successful, we should respond with the errors the S3 upload service returned.