feat(status): migrate application status from enum to DB-backed table#54
Merged
Conversation
… registration Adds two columns to the users table (Flyway V28): privacy_policy_accepted and privacy_policy_accepted_at. RegisterRequest now validates that the client sends acceptedPrivacyPolicy=true (400 otherwise). AuthService sets the flag and timestamp at registration time. UserResponse exposes the field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l test constructors
…ivacyPolicy in E2E tests ToolExecutionMetric was using Lombok annotations (@Getter, @Setter, @builder) which fail annotation processing under GraalVM/Java 25. Replaced with manual getters, setters, and a static inner Builder following the existing codebase style. E2E register payloads were missing the acceptedPrivacyPolicy field introduced in a recent migration, causing all registration calls to return 400. Added acceptedPrivacyPolicy: true to all affected test payloads in ApplicationE2ETest and AuthE2ETest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the hardcoded ApplicationStatus Java enum with a database-backed `application_statuses` table, enabling dynamic status management without code deployments. Key changes: - Flyway V29: creates application_statuses table seeded with 9 English values (RH, Pending HR Response, Pending Hiring Manager Response, Technical Test, Pending Technical Test Response, Offer Negotiation, Ghosting, Rejected, Approved) and adds `to_send_later` boolean column - ApplicationStatusEntity + ApplicationStatusRepository for JPA access - JobApplication/InterviewEvent: status fields changed from enum to String - ApplicationResponse: new `toSendLater` field - ApplicationService: added listStatuses(), validateStatus() with 400 on unknown values; buildRequest() enforces applicationDate required when status is provided - GET /api/v1/applications/statuses endpoint returns ordered status list - MCP: new List-Statuses tool; updated Create-Application and Update-Application-Status descriptions to always call it first - GamificationService, InterviewMetricsService, DashboardService, StaleApplicationsScheduler: migrated from enum comparisons to String checks, retaining backward-compat with old PT-BR constant names - Tests: updated all integration/e2e/unit tests to use new English status values; added data.sql seed + defer-datasource-initialization for H2 All 212 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Qodana for JVM3 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.3.2
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
application_statusestable seeded with 9 English values and adds ato_send_laterboolean column tojob_applicationsApplicationService.validateStatus()checks submitted status values against the table and returns HTTP 400 with a helpful message (including the URL toGET /api/v1/applications/statuses) if the value is unknownGET /api/v1/applications/statusesreturns the ordered list of valid status strings; protected byhasRole('USER') or hasAuthority('SCOPE_read:applications')List-Statusestool;Create-ApplicationandUpdate-Application-Statusdescriptions updated to always call it before setting a status valueJobApplication,InterviewEvent, repositories,GamificationService,InterviewMetricsService,DashboardService,StaleApplicationsSchedulerall migrated fromApplicationStatusenum to plainString; old PT-BR constant names are preserved in set-based checks for backward compatibility with existing recordstoSendLaterfield: added tojob_applications(DB) and surfaced inApplicationResponse; existing rows withstatus IS NULLare backfilled astruedata.sqlwithdefer-datasource-initialization: trueWhat a reviewer should know
"Teste Técnico","GHOSTING") are not touched by the migration — only the new table is created and seeded. The service and gamification logic still recognise old constant names via||checks.TO_SEND_LATERpseudo-status sent by legacy frontend clients still works (checked inmapRequestToEntity()), but new frontend code should sendstatus: nullinstead.STATUS_OPTIONS/APPLICATION_STATUSESin the React frontend have been updated to the new English values in a companion commit on the React repo.Test plan
mvn test— 212 passed, 3 skipped (pre-existing), 0 failuresGET /api/v1/applications/statusesreturns ordered listPOST /api/v1/applicationswith unknown status returns 400 with guidance messagePOST /api/v1/applicationswithstatus: null/applicationDate: nullcreates a to-send-later draftList-Statusestool exists and is described correctly🤖 Generated with Claude Code