Skip to content

Migrate interview metrics from dedicated entity to JobApplication field#45

Merged
vitorhugo-java merged 2 commits into
mainfrom
claude/gracious-heisenberg-mPVKN
Jun 5, 2026
Merged

Migrate interview metrics from dedicated entity to JobApplication field#45
vitorhugo-java merged 2 commits into
mainfrom
claude/gracious-heisenberg-mPVKN

Conversation

@vitorhugo-java
Copy link
Copy Markdown
Owner

Summary

This PR refactors the interview metrics tracking system by migrating from a dedicated UserInterviewMetrics entity to a denormalized interviewCount field on the JobApplication entity. This simplifies the data model and improves query efficiency.

Key Changes

  • Removed UserInterviewMetrics dependency: Eliminated the separate metrics entity and its repository, reducing data model complexity
  • Added interviewCount field to JobApplication: New integer column (default 0) to track interviews per application
  • Updated InterviewMetricsService:
    • Replaced UserInterviewMetricsRepository with ApplicationRepository
    • Simplified recordStatusTransition() to only create InterviewEvent records
    • Changed getInterviewCount() to use new sumInterviewCountByUserId() query
    • Removed findOrCreateMetrics() helper method
  • Extended API contracts:
    • Added interviewCount field to ApplicationRequest DTO with @Min(0) validation
    • Added interviewCount field to ApplicationResponse DTO
    • Updated ApplicationService.mapRequestToEntity() to handle the new field
  • Updated ApplicationMapper: Maps the new interviewCount field to response DTOs
  • Database migration: Added V25__add_interview_count_to_job_applications.sql to create the new column

Implementation Details

  • Interview count is now stored at the application level rather than aggregated at the user level
  • The sumInterviewCountByUserId() query uses COALESCE to safely handle null sums
  • Only non-archived applications are counted in metrics calculations
  • The field defaults to 0 and can be set via the API request

https://claude.ai/code/session_015kfgrc2oHA881RT3bEYHZ6

claude added 2 commits June 5, 2026 15:17
Adds PATCH /api/v1/dashboard/interview-count endpoint and
Update-Interview-Count MCP tool so users can correct the cumulative
interview counter when the automatic detection misses transitions.

https://claude.ai/code/session_015kfgrc2oHA881RT3bEYHZ6
Adds interview_count column to job_applications so each application
tracks its own count. Dashboard interviewCount now sums across all
applications. Removes the per-user UserInterviewMetrics path and the
manual update endpoint/MCP tool (editing is now done via the
application form).

https://claude.ai/code/session_015kfgrc2oHA881RT3bEYHZ6
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Qodana for JVM

2 new problems were found

Inspection name Severity Problems
Nullability and data flow problems 🔶 Warning 1
Mismatched query and update of 'StringBuilder' 🔶 Warning 1
View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vitorhugo-java vitorhugo-java merged commit cc400a3 into main Jun 5, 2026
5 of 6 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.

2 participants