"id missing"]); } $wohneinheit = new \ADBWohneinheit($id); if(!$wohneinheit->id) { return \mfResponse::NotFound(["message" => "Home not found"]); } $preorder = \PreorderModel::getFirstActive(["adb_wohneinheit_id" => $id]); if(!$preorder) { return \mfResponse::NotFound(["message" => "Home not found"]); } $new_status = \PreorderstatusModel::getFirst(["code" => 300]); if(!$new_status) { return \mfResponse::InternalServerError(); } if($preorder->status->code < $new_status->code) { $preorder->status_id = $new_status->id; $preorder->save(); } return \mfResponse::Ok(["message" => "OK"]); } }