@Override @PlusTransactional public ResponseEvent<DpRequirementDetail> deleteRequirement(RequestEvent<Long> req) { try { AccessCtrlMgr.getInstance().ensureUserIsAdmin(); DpRequirement existing = getDprDao().getById(req.getPayload()); if (existing == null) { return ResponseEvent.userError(DpRequirementErrorCode.NOT_FOUND); } existing.delete(); getDprDao().saveOrUpdate(existing); return ResponseEvent.response(DpRequirementDetail.from(existing)); } catch (OpenSpecimenException ose) { return ResponseEvent.error(ose); } catch (Exception e) { return ResponseEvent.serverError(e); } }