Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Check transition according to [NEW] Equipment status model

  • Get equipment by id

  • Check equipment status

    • If new status is inactive then current status must be active

    • If new status is entered_in_error then current status must be active or inactive

      • in case of error - return 409 ('Invalid transition. Equipment is in final status')

...

  1. Validate $.status is one of the following (inactive | entered_in_error)

    1. in case of error - return 422 ("value is not allowed in enum")

  2. If $.status = inactive check that device.availability_status one of the following (damaged | destroyed | lost)

    1. 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

...