Repository navigation
fix(applications): record when an application is submitted - #905
Conversation
381e179 to
fbb22f9
Compare
📊 Performance Benchmark Results |
|
This needs Scaffald/sdk#33 to be merged first so CI can succeed |
Scaffald/sdk#33 is merged. `Application` and `EmployerApplication` now carry `submitted_at`, which is what the four typecheck errors on this branch were waiting for. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Unblocked the typecheck. Scaffald/sdk#33 is merged (348bf1d) and I pushed the pointer bump as ae72c07 — that is what the four Verified locally after the bump: On the substance, the part I looked at hardest is the backfill, because it is the one irreversible decision here: UPDATE core.applications SET submitted_at = COALESCE(score_calculated_at, created_at)Treating every existing row as submitted is the right call, and the migration explains why in the file rather than only in the PR — good. The reasoning holds: the Submit bug means Two things I'd flag, neither blocking:
Merging once CI is green. |
📊 Performance Benchmark Results |
thinkclay
left a comment
There was a problem hiding this comment.
Green after the SDK pointer bump, including Run API Tests — which is the check that actually exercises the draft → auto-save → submit → repeat-submit path this PR is about.
Approving. The two notes in my earlier comment (no index on submitted_at; jobClosedReason skipped on re-submit) are follow-ups, not blockers.
Closes #881
A saved draft and a submitted application were the same row.
is_completeonly decided whether scoring ran; nothing stored it. So job detail said "You've applied" to anyone who had typed one answer, the worker's list showed abandoned forms as sent, and employers saw drafts on their board.Separately, the wizard's Submit button PATCHed the auto-saved draft without
is_complete, so most real submissions were never scored either.Changes
Database
359_application_submitted_at.sqladdscore.applications.submitted_at. NULL means draft.score_calculated_atwould pull real candidates off employer boards. Drafts abandoned before this change stay listed as applications; everything from now on is separated. The rule is written in the migration.API
POST/PATCH /v1/applicationssetsubmitted_atthe first time a request carriesis_complete: true. Auto-saves never set it, and a repeat submit keeps the original time. The tRPCsubmitsets it too.jobClosedReason).submitted_atis added to the Application response schema;/v1/jobs/:jobId/applications/mealready returns it.submitted_at.submitted_at.Client
is_complete: trueon the PATCH path and refreshes the cached application after submit.SDK (submodule, Scaffald/sdk#)
submitted_atadded toApplicationandEmployerApplication.Testing
jobClosedReasonandisDraft.applications.test.tscouldn't cover this: its test-user helper breaks before any request is sent.