Skip to content

fix(MAJORLEA-001-2): 3 review findings across 2 files - #85

Draft
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/majorlea-001-2-1fe846d1-89424001
Draft

fix(MAJORLEA-001-2): 3 review findings across 2 files#85
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/majorlea-001-2-1fe846d1-89424001

Conversation

@flamingo

@flamingo flamingo Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.

# Fix confidence Finding Location
1 🟡 70 medium HiringService.getHiringManagerProfile returns a raw Map, not ApiResponse backend/src/main/java/cx/flamingo/analysis/service/HiringService.java:35
2 🟡 70 medium HiringService.getHiringManagerProfile builds response envelope by hand instead of using ApiResponse factory methods backend/src/main/java/cx/flamingo/analysis/service/HiringService.java:60
3 🟡 70 medium HiringController endpoints bypass the ApiResponse envelope backend/src/main/java/cx/flamingo/analysis/controller/HiringController.java:21

What 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-ab853de69d56

Merging 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.

@flamingo flamingo Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 What this fix changed, finding by finding

3 finding(s) fixed in this draft — 3 explained inline on the diff.

@@ -34,8 +33,7 @@ public class HiringService {
private static final String PROFILE_KEY = "manager_profile";
private static final String JOBS_KEY = "job_openings";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🔴 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;
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🔴 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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🔴 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants