Repository navigation
refactor(ats): extract ATSApplication from the mock-data file - #570
Merged
Merged
Conversation
Closes #536. `MockApplication` was the production domain type for fourteen components, exported from a file whose own header says it exists so the UI can be built "WITHOUT needing a backend". The type is now `ATSApplication` in features/office/applications/types.ts. Reconciled against what the employer endpoint actually returns, rather than carried over. Three fields are gone because nothing could ever populate them: autoRejected there is no `auto_rejected` column anywhere. notes NotesTab fetches its own via TeamCommentThread. messages MessagesTab fetches its own via useApplicationMessages. `notes` and `messages` were not merely unused — they had three consumers, all reading `[]` forever. The detail tab read "Notes (0)" no matter how many notes existed; ActivityFeedTab looped over both and contributed nothing while making the feed look more complete than it was; the kanban card computed a `commentCount` that was passed down and never rendered. Those are removed rather than defaulted, because `?? 0` tells the same lie more quietly. Optional now, because the payload does not carry them: candidate email and phone (gated behind the success fee, fetched by useContactInfo), skills, certifications, experience, and the job's company name. CandidateProfileTab says "Not included in this view" instead of rendering an empty card that reads as "this candidate has no certifications" — absent is not none. ats-mock-data.ts is deleted rather than demoted to a fixture, which is what the issue proposed. Once every import was repointed, nothing referenced it at all: no fixture, no helper, no Storybook story. All twenty imports were type-only. It was 700 lines whose sole remaining role was housing the type. Also drops the vestigial core.application_status ENUM (migration 344). It reads draft/submitted/under_review/interviewing/offer_extended/…, while the real vocabulary is the CHECK on core.applications.status: new/screen/inquired/interview/offer/hired/rejected/withdrawn. Three labels overlap. An ENUM looks authoritative, so anyone reading the schema for the canonical status list found a vocabulary no code has ever written. Verified against the local database first: no column and no function uses the type. DROP without CASCADE on purpose — if something does depend on it, the migration should fail loudly. Office suite 71 passed / 0 failed. scf-core and app typechecks clean.
This was referenced Aug 11, 2026
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.
Closes #536. Net −471 lines.
MockApplicationwas the production domain type for fourteen components, exported from a file whose own header says it exists so the UI can be built "WITHOUT needing a backend". It is nowATSApplicationinfeatures/office/applications/types.ts.Reconciled, not copied
Three fields are gone, because nothing could ever populate them:
autoRejectedauto_rejectedcolumn anywherenotesNotesTabfetches its own viaTeamCommentThreadmessagesMessagesTabfetches its own viauseApplicationMessagesnotesandmessageswere not merely unused — they had three consumers, all reading[]forever:ActivityFeedTablooped over both, contributing nothing while making the feed look more complete than it was;commentCountthat was passed down and never rendered.Removed rather than defaulted —
?? 0tells the same lie more quietly.Optional now, because the employer payload does not carry them: candidate
email/phone(gated behind the success fee, fetched byuseContactInfo),skills,certifications,experience, and the job'scompany.CandidateProfileTabnow says "Not included in this view" rather than rendering an empty card that reads as "this candidate has no certifications". Absent is not none.The mock file is deleted, not demoted
The issue's step 3 was to demote
ats-mock-data.tsto a fixture importing the domain type. Once every import was repointed, nothing referenced it at all — no fixture, no helper, no Storybook story; all twenty imports were type-only. It was 700 lines whose sole remaining role was housing the type, so I deleted it. Flagging the deviation because it differs from what the issue asked for.Migration 344 — the vestigial ENUM
core.application_statusreadsdraft, submitted, under_review, interviewing, offer_extended, hired, rejected, withdrawn. The real vocabulary is the CHECK oncore.applications.status:new, screen, inquired, interview, offer, hired, rejected, withdrawn. Three labels overlap.An ENUM looks authoritative, so anyone reading the schema for the canonical status list found a vocabulary no code has ever written or read. Verified against the local database before writing the migration: no column and no function uses the type.
DROP TYPEwithoutCASCADEon purpose — if something does depend on it, this should fail loudly rather than quietly removing that object too.Applied and verified locally: type gone, 27 applications intact, all 4 CHECK constraints intact, status values unchanged.
Verification
biome lintclean.mock-datapath. The only remaining mention ofMockApplicationanywhere is the sentence intypes.tsexplaining the rename.core.application_statusno longer exists.Note for review
My first pass ran
biome check --write, which reformatted files I had not otherwise touched —ProjectHiringScreen.tsxpicked up 203 insertions with no type change in it. I reverted everything and redid the rename without the formatter, so the diff is a 1:1 rename plus the specific consumer fixes. The repo's own pre-commit hook then formatted the staged files, which is the established convention here.Not applied yet
Migration 344 is applied locally only. Per #559, a merged migration has no mechanism that applies it — say the word and I'll run it through dev → preview → prod with the same verification I used for 343.