Skip to content

[Feat] 하나의 공고에 대한 모의지원 순번 api#67

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

[Feat] 하나의 공고에 대한 모의지원 순번 api#67
shinae1023 merged 3 commits into
mainfrom
feat/#27-actual-apply-count

Conversation

@shinae1023
Copy link
Copy Markdown
Member

@shinae1023 shinae1023 commented May 22, 2026

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

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

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

📸 작업 화면 스크린샷

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

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

🚨 관련 이슈 번호 [#27 ]

Summary by CodeRabbit

  • New Features
    • View your practice-application position and the total number of practice applications for a given job posting.
  • Tests
    • Added automated test validating sequence and total-count calculation for practice applications.

Review Change Stack

@shinae1023 shinae1023 self-assigned this May 22, 2026
@shinae1023 shinae1023 added the ✨ feat New feature or request label May 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds a GET endpoint /{mockApplyId}/sequence plus a response DTO, repository count queries, a service method that computes a 1-based sequence and total, and a unit test verifying the sequence computation.

Changes

Mock Apply Sequence Query

Layer / File(s) Summary
Response DTO contract
src/main/java/com/jobdri/jobdri_api/domain/mockapply/dto/response/MockApplySequenceResponse.java
New record MockApplySequenceResponse(Long jobPostingId, Long mockApplyId, int totalCount, int sequence) defining the response shape.
Repository count methods
src/main/java/com/jobdri/jobdri_api/domain/mockapply/repository/MockApplyRepository.java
Adds long countByUserIdAndJobPostingId(Long userId, Long jobPostingId) and long countSequenceByUserIdAndJobPostingId(Long userId, Long jobPostingId, LocalDateTime createdAt, Long mockApplyId) with a JPQL @Query for cursor-based counting.
Service sequence computation
src/main/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyService.java
New getMockApplySequence(User user, Long mockApplyId) validates ownership, loads the MockApply, computes totalCount and 1-based sequence via repository counts, throws MOCK_APPLY_NOT_FOUND when invalid, and returns MockApplySequenceResponse.
HTTP GET endpoint
src/main/java/com/jobdri/jobdri_api/domain/mockapply/controller/MockApplyController.java
New @GetMapping("/{mockApplyId}/sequence") endpoint delegates to mockApplyService.getMockApplySequence and returns ApiResponse<MockApplySequenceResponse>.
Test coverage
src/test/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyServiceTest.java
New test creates three MockApply entities, adjusts their createdAt timestamps, calls getMockApplySequence, and asserts jobPostingId, mockApplyId, totalCount, and computed sequence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through rows to find my place,
Counted timestamps, id, and gentle pace.
A DTO carried the sequence true,
Controller, service, repo—all in view.
hop hop — a rabbit's QA trace.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete; the critical '세부 내용' section explaining why the PR is needed and implementation details is entirely empty, providing no technical rationale or context beyond the issue number. Fill in the '세부 내용' section with a detailed explanation of the feature purpose, implementation approach, and any relevant technical considerations or design decisions.
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.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the feature being added: an API endpoint to retrieve the mock application sequence number for a single job posting.
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: 1

🤖 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/mockapply/service/MockApplyService.java`:
- Around line 97-109: The current code loads all MockApply rows via
mockApplyRepository.findAllByUserIdAndJobPostingIdOrderByCreatedAtAscIdAsc and
scans in memory to compute sequence; replace this with two COUNT queries: use
mockApplyRepository.countByUserIdAndJobPostingId(validatedUser.getId(),
mockApply.getJobPosting().getId()) for totalCount, and compute sequence by
counting how many rows for that user+jobPosting have createdAt before
mockApply.getCreatedAt() (and include ties using id <= mockApply.getId() for
deterministic ordering) via a new repository method (e.g.
countByUserIdAndJobPostingIdAndCreatedAtBeforeOrCreatedAtEqualsAndIdLessThanEqual)
so you avoid fetching full rows and remove the in-memory loop over mockApplies.
🪄 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: 16b38ede-4424-4de8-bfd3-a93bd4d1e1cd

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8ca27 and abdf591.

📒 Files selected for processing (5)
  • src/main/java/com/jobdri/jobdri_api/domain/mockapply/controller/MockApplyController.java
  • src/main/java/com/jobdri/jobdri_api/domain/mockapply/dto/response/MockApplySequenceResponse.java
  • src/main/java/com/jobdri/jobdri_api/domain/mockapply/repository/MockApplyRepository.java
  • src/main/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyService.java
  • src/test/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyServiceTest.java

@shinae1023 shinae1023 merged commit 4efd3b0 into main May 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant