fix(MAJORLEA-001-2): 3 review findings across 2 files - #85
Conversation
| @@ -34,8 +33,7 @@ public class HiringService { | |||
| private static final String PROFILE_KEY = "manager_profile"; | |||
| private static final String JOBS_KEY = "job_openings"; | |||
There was a problem hiding this comment.
🦩 🔴 HiringService.getHiringManagerProfile returns a raw Map, not ApiResponse
Changed HiringService.getHiringManagerProfile's return type from Map<String, Object> to ApiResponse, removed the manual HashMap construction, and replaced it with a call to ApiResponse.success(profile, message). Also removed now-unused HashMap/Map imports and added an import for cx.flamingo.analysis.dto.ApiResponse (assumed package location based on project convention; if ApiResponse resides in a different package, this import path will need adjustment).
🤖 Prompt for AI agents
In backend/src/main/java/cx/flamingo/analysis/service/HiringService.java around line 35, review and complete this code-review fix: HiringService.getHiringManagerProfile returns a raw Map, not ApiResponse<T>.
What the draft fix changed: Changed HiringService.getHiringManagerProfile's return type from Map<String, Object> to ApiResponse<HiringManagerProfile>, removed the manual HashMap construction, and replaced it with a call to ApiResponse.success(profile, message). Also removed now-unused HashMap/Map imports and added an import for cx.flamingo.analysis.dto.ApiResponse (assumed package location based on project convention; if ApiResponse resides in a different package, this import path will need adjustment).
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer
| @@ -58,10 +56,7 @@ public Map<String, Object> getHiringManagerProfile() { | |||
| return newProfile; | |||
| }); | |||
|
|
|||
There was a problem hiding this comment.
🦩 🔴 HiringService.getHiringManagerProfile builds response envelope by hand instead of using ApiResponse factory methods
Removed the manual response.put("status", ...)/("message", ...)/("data", ...) block in getHiringManagerProfile and replaced it with the single ApiResponse.success(profile, "Hiring manager profile retrieved successfully") call, eliminating the hand-built envelope in favor of the shared factory method.
🤖 Prompt for AI agents
In backend/src/main/java/cx/flamingo/analysis/service/HiringService.java around line 60, review and complete this code-review fix: HiringService.getHiringManagerProfile builds response envelope by hand instead of using ApiResponse factory methods.
What the draft fix changed: Removed the manual response.put("status", ...)/("message", ...)/("data", ...) block in getHiringManagerProfile and replaced it with the single ApiResponse.success(profile, "Hiring manager profile retrieved successfully") call, eliminating the hand-built envelope in favor of the shared factory method.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer
| @@ -20,17 +20,13 @@ public class HiringController { | |||
| private final HiringService hiringService; | |||
|
|
|||
There was a problem hiding this comment.
🦩 🔴 HiringController endpoints bypass the ApiResponse envelope
In HiringController, changed getHiringManagerProfile() and getJobOpenings() to return ApiResponse instead of raw Map<String, Object>. Removed the manual HashMap envelope construction in getJobOpenings() in favor of ApiResponse.success(message, data), and wrapped hiringService.getHiringManagerProfile() (still typed as Map<String, Object> since its actual model type is not visible in this file) with ApiResponse.success(data). Removed now-unused HashMap import and added ApiResponse import. This assumes cx.flamingo.analysis.dto.ApiResponse exists with static success(T) and success(String, T) factory methods matching the pattern used elsewhere per the finding; if the actual signatures differ (e.g., success(message, data) argument order, or no single-arg success(T) overload), this will fail to compile — a complete fix would require verifying ApiResponse's exact API in this codebase. Also, getHiringManagerProfile()'s true return type (likely a HiringManagerProfile model per the suggested fix) is unknown from this file alone, so it is left as Map<String, Object> rather than switching to a more specific type to avoid guessing at an import that may not exist.
🤖 Prompt for AI agents
In backend/src/main/java/cx/flamingo/analysis/controller/HiringController.java around line 21, review and complete this code-review fix: HiringController endpoints bypass the ApiResponse<T> envelope.
What the draft fix changed: In HiringController, changed getHiringManagerProfile() and getJobOpenings() to return ApiResponse<T> instead of raw Map<String, Object>. Removed the manual HashMap envelope construction in getJobOpenings() in favor of ApiResponse.success(message, data), and wrapped hiringService.getHiringManagerProfile() (still typed as Map<String, Object> since its actual model type is not visible in this file) with ApiResponse.success(data). Removed now-unused HashMap import and added ApiResponse import. This assumes cx.flamingo.analysis.dto.ApiResponse exists with static success(T) and success(String, T) factory methods matching the pattern used elsewhere per the finding; if the actual signatures differ (e.g., success(message, data) argument order, or no single-arg success(T) overload), this will fail to compile — a complete fix would require verifying ApiResponse's exact API in this codebase. Also, getHiringManagerProfile()'s true return type (likely a HiringManagerProfile model per the suggested fix) is unknown from this file alone, so it is left as Map<String, Object> rather than switching to a more specific type to avoid guessing at an import that may not exist.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer
Closes 3 review findings across 2 files.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
backend/src/main/java/cx/flamingo/analysis/service/HiringService.java:35backend/src/main/java/cx/flamingo/analysis/service/HiringService.java:60backend/src/main/java/cx/flamingo/analysis/controller/HiringController.java:21What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
89424001-8db6-4ce6-8840-ab853de69d56Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.