getBody(), true) ?? []; try { v::key('product_id', v::intType()->positive()) ->key('company_id', v::intType()->positive()) ->key('description_text', v::stringType()->notEmpty()) ->assert($body); } catch (ValidationException $e) { return ResponseLib::sendFail("Validation failed: " . $e->getFullMessage(), [], "E_VALIDATE")->withStatus(401); } $productId = (int) $body['product_id']; $companyId = (int) $body['company_id']; $descriptionText = (string) $body['description_text']; $model = new DescriptionModel(); $success = $model->updateDescription($productId, $companyId, $descriptionText); return $success ? ResponseLib::sendOk(['updated' => true]) : ResponseLib::sendFail("Failed to Update Description", [], "E_DB")->withStatus(500); } }