Fix Application Change Stage Error Responses

  • application.changeStage now returns an actionable error, instead of an internal server error, when the stage change cannot be completed. The application's stage is not changed in any of these cases:
    • invalid_input when archiveEmail is provided for a candidate without a primary email address.
    • invalid_input when moving an application to a Hired stage would bypass a required offer approval.
    • invalid_input when moving an application to a Hired stage requires filling an opening.
    • opening_in_use when moving an application to a Hired stage would fill an opening that is already in use by another application.