rescued-animals-platform/adoption-service

An administrator can update an animal primary picture

emmeblm opened this issue · 0 comments

As an administrator
I want to update an animal's primary picture
So that I can change the picture after I've created it

Acceptance criteria

Given an animal with a primary picture
When an administrator updates the primary picture (Http method PUT)
Then a 200 ok response is returned with the updated primary picture
And the old picture is removed from the repository

Given an animal with a primary picture
When an administrator updates the primary picture (Http method PUT)
And an error occurs while saving the new primary picture
Then a 503 service unavailable response is returned

Given an animal with a primary picture
When an administrator updates the primary picture (Http method PUT)
And the new picture was successfully saved in the repository
And an error occurs while deleting the old picture from the repository
Then a message is logged with the public ids of the resources that couldn't be deleted
And a 200 ok response is returned with the updated primary picture

Given an animal with a primary picture
When an administrator updates the primary picture (Http method PUT)
And the new primary picture is invalid
Then a 400 bad request response is returned with details of the invalid fields