...
Validate $.status is one of the following (
inactive
|entered_in_error
)in case of error - return 422 ("value is not allowed in enum")
If $.status =
inactive
check that equipment.availability_status one of the following (damaged
|destroyed
|lost
)in case of error - return 409 ("It is prohibited to change status for equipment with availability status = {equipment.availability_status}")
Error_reason
If equipment status changes to entered_in_error
attribute error_reason
is required
...