Skip to content

Feat/#27 actual apply count#88

Merged
shinae1023 merged 3 commits into
mainfrom
feat/#27-actual-apply-count
May 27, 2026
Merged

Feat/#27 actual apply count#88
shinae1023 merged 3 commits into
mainfrom
feat/#27-actual-apply-count

Conversation

@shinae1023
Copy link
Copy Markdown
Member

@shinae1023 shinae1023 commented May 27, 2026

✨ 어떤 이유로 PR를 하셨나요?

  • feature 병합
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

📸 작업 화면 스크린샷

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 [#27]

Summary by CodeRabbit

Release Notes

  • New Features

    • The analysis endpoint now supports an optional sequence query parameter for retrieving analysis results.
  • Tests

    • Added test coverage for sequence-based analysis retrieval, including validation of correct sequence matching and error handling for missing sequences.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 46b2c075-f425-4a6c-9573-e9ab610e98bb

📥 Commits

Reviewing files that changed from the base of the PR and between 0e7d927 and b2ee995.

📒 Files selected for processing (2)
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java
  • src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java

📝 Walkthrough

Walkthrough

This PR adds optional sequence-based lookup to the analysis results endpoint. The controller now accepts an optional sequence query parameter and forwards it to the service. The service adds a new overload that resolves the target MockApply by its sequence number using a new repository query method, then fetches and returns the corresponding analysis with related entities. Three test cases verify correct retrieval by sequence and proper error handling.

Changes

Sequence-based analysis retrieval

Layer / File(s) Summary
HTTP endpoint sequence parameter
src/main/java/com/jobdri/jobdri_api/domain/analysis/controller/AnalysisController.java
Controller endpoint accepts optional sequence query parameter via @RequestParam and passes it to analysisService.getAnalysis(...).
Repository query for MockApply sequence lookup
src/main/java/com/jobdri/jobdri_api/domain/mockapply/repository/MockApplyRepository.java
Spring Data JPA derived query method findAllByUserIdAndJobPostingIdOrderByIdAsc retrieves MockApply records ordered by id ascending for sequence resolution.
Service sequence resolution and analysis loading
src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java
Existing getAnalysis(User, Long) delegates to new overload getAnalysis(User, Long, Integer) which validates sequence, resolves MockApply using resolveMockApplyBySequence helper, fetches Analysis and related entities, and throws appropriate errors when sequence or analysis is not found.
Test coverage for sequence-based retrieval
src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java
Three test cases verify retrieval by sequence across multiple MockApply instances, prioritization of stored sequence values, and proper exception handling when sequence does not exist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • JobDri-Developer/BackEnd#61: Both PRs modify the analysis result "getAnalysis" flow in AnalysisController/AnalysisService by adding sequence-based lookup and resolution logic.
  • JobDri-Developer/BackEnd#79: Both PRs implement sequence support for analysis, with this PR adding the query parameter and resolution logic while the other updates analysis/response DTOs and MockApply sequence handling.
  • JobDri-Developer/BackEnd#82: This PR's sequence resolution logic depends on the sequence persistence and handling changes introduced in that PR.

Suggested labels

✨ feat

Poem

🐰 A rabbit hops through sequences now,
Finding past analyses with proper vow,
Through ordered applies it does gleam,
Sequence-aware, fulfilling each dream!
thump thump

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description follows the template structure but critically lacks the 'detailed content' section explaining why the PR is needed and what work was done. While the author checked 'feature merge' and related issue #27, no substantive explanation of the implementation is provided. Add detailed explanation in the '📋 세부 내용' section describing the sequence parameter feature, how it resolves issue #27, and why this change improves the 'actual apply count' functionality.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feat/#27 actual apply count' is partially related to the changeset. It mentions a feature number (#27) but 'actual apply count' is vague and doesn't clearly describe the specific implementation of accepting an optional sequence parameter for analysis retrieval. Consider a more descriptive title like 'Add optional sequence parameter to analysis retrieval' that clearly conveys the main technical change being implemented.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#27-actual-apply-count

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java (1)

510-520: ⚡ Quick win

Add a test for non-positive sequence validation.

getAnalysis(user, mockApplyId, 0/-1) should assert GeneralErrorCode.INVALID_PARAMETER to lock the guard behavior and prevent regressions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java`
around lines 510 - 520, Add a test in AnalysisServiceTest that calls
analysisService.getAnalysis(user, mockApply.getId(), 0) and another for -1 (or a
parameterized case) and assert they throw GeneralException with code
GeneralErrorCode.INVALID_PARAMETER; locate the existing test for missing
sequence (getAnalysisThrowsWhenSequenceDoesNotExist) and add a new test method
(e.g., getAnalysisThrowsWhenSequenceIsNonPositive) that reuses
saveUser/saveMockApply and verifies the guard behavior of
AnalysisService.getAnalysis against non-positive sequence inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java`:
- Around line 121-128: The stream calls
mockApplyRepository.calculateSequence(mockApply) for each MockApply, causing N+1
queries; change to compute sequences in-memory or fetch all sequences in one
query. For example in AnalysisService replace the stream/filter that uses
calculateSequence(...) with a single pass over the List<MockApply> returned by
findAllByUserIdAndJobPostingIdOrderByIdAsc to assign incremental sequence
numbers (or call a new repository method like
calculateSequencesForUserAndJobPosting that returns sequences for all IDs in one
DB call) and then find the matching sequence, avoiding per-item
calculateSequence calls.

In `@src/main/resources/application.yaml`:
- Line 3: The default Spring profile is currently set to prod via the active
property using ${SPRING_PROFILES_ACTIVE:prod}; change the fallback default to a
safe development profile (e.g., dev or local) so that when
SPRING_PROFILES_ACTIVE is unset the application uses non-production settings;
update the active property in application.yaml to ${SPRING_PROFILES_ACTIVE:dev}
(or :local) and ensure any documentation or deployment manifests explicitly set
SPRING_PROFILES_ACTIVE=prod for production environments.

---

Nitpick comments:
In
`@src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java`:
- Around line 510-520: Add a test in AnalysisServiceTest that calls
analysisService.getAnalysis(user, mockApply.getId(), 0) and another for -1 (or a
parameterized case) and assert they throw GeneralException with code
GeneralErrorCode.INVALID_PARAMETER; locate the existing test for missing
sequence (getAnalysisThrowsWhenSequenceDoesNotExist) and add a new test method
(e.g., getAnalysisThrowsWhenSequenceIsNonPositive) that reuses
saveUser/saveMockApply and verifies the guard behavior of
AnalysisService.getAnalysis against non-positive sequence inputs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 456616c6-c69f-4c71-bebc-8608cd3b5051

📥 Commits

Reviewing files that changed from the base of the PR and between 462007c and 0e7d927.

📒 Files selected for processing (5)
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/controller/AnalysisController.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java
  • src/main/java/com/jobdri/jobdri_api/domain/mockapply/repository/MockApplyRepository.java
  • src/main/resources/application.yaml
  • src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java

Comment thread src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java Outdated
Comment thread src/main/resources/application.yaml Outdated
@shinae1023 shinae1023 merged commit c016a96 into main May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant