You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split from #440. The reported symptom is "Unable to load inquiry" on /jobs/applications/:id/inquiry; the cause is that the tRPC→SDK migration for inquiries was never finished.
Cause
getByApplication does not exist on the SDK. packages/scf-core/utils/inquiries-sdk-hooks.ts:190 does:
The as unknown as cast suppresses the type error, so it fails at runtime and the route's error || !data branch renders the red message. The type file admits it: "tRPC migration - methods may not exist on SDK yet". Only the legacy tRPC router has a real implementation.
Scope
Of the 19 methods on InquiryCapabilityClient, the SDK implements 3. 16 are missing, all reached through the same unsafe cast (16 occurrences in inquiries-sdk-hooks.ts): createTemplate, updateTemplate, deleteTemplate, applyTemplate, getSmartDefaults, createBulk, getByApplication, getMultiple, send, addComment, markCommentRead, acceptSection, submitCapabilityResponse, update, changeStatus.
packages/supabase/functions/api/routes/inquiries.ts exposes only GET /v1/inquiries and POST /v1/inquiries. 7 of the SDK's own 9 paths 404: getById, respond, templates, bulk/mark-read, bulk/archive, getTemplates, getHistory.
The route conflates three states into one red error: fetch failure, no inquiry exists, and nonexistent application. core.application_inquiries is empty locally, so every application shows the error even once the method exists.
Suggested sequencing
getByApplication end-to-end (API route + SDK method + hook, cast removed) plus a real empty state on the route — unblocks the reported bug.
Port the remaining 15 methods and their endpoints.
Drop InquiryCapabilityClient and the casts once the SDK surface is complete.
Lint rule banning as unknown as on SDK clients — that cast is what let this ship silently.
Step 1 is done; the sequencing in the description needs revising
getByApplication shipped end-to-end in #475 + Scaffald/sdk#11: the endpoint, the SDK method, the cast removed at that one call site, and the empty state split out of the error branch on both inquiry routes. The reported page loads.
15 methods still missing, all still reached through as unknown as InquiryCapabilityClient in inquiries-sdk-hooks.ts: createTemplate, updateTemplate, deleteTemplate, applyTemplate, getSmartDefaults, createBulk, getMultiple, send, addComment, markCommentRead, acceptSection, submitCapabilityResponse, update, changeStatus.
The description's step 2 said "port the remaining 15 methods." That is now blocked on a naming decision, because core.inquiries does not exist in the database (#476). Two unrelated concepts share the name inquiries:
never created — list/create/respond/templates/bulk* all 500
ATS capability inquiry
core.application_inquiries (+ 6 related tables)
exists; this is what the app's inquiry pages need
Whether the remaining 15 belong on client.inquiries or on a new client.applicationInquiries depends on which concept survives. Porting them under the current name would cement the conflation.
Two things to expect when you do port them
Don't trust the tRPC source as a schema reference. Its getByApplication selects applied_at and application_score; neither column exists on core.applications, so that query 400s. Real columns are created_at and score_total. Validate every select against a live DB — that is how this surfaced.
Removing a cast is where the real bugs appear. The single cast removed in fix(inquiries): make the application inquiry page actually load #475 immediately exposed two wrong types that had been invisible: InquiryComment was missing three NOT NULL fields, and capabilityResponses denied null on two nullable columns. Expect similar per method, and treat that as the point of the exercise rather than an obstacle.
Also still open from the description: the lint rule banning as unknown as on SDK clients. Worth doing last, once the surface is complete, so it does not just block work in progress.
Activity
feat(inquiries): add getByApplication (#11)
fix(inquiries): make the application inquiry page actually load (#475)
thinkclay commentedon Jul 30, 2026
Step 1 is done; the sequencing in the description needs revising
getByApplicationshipped end-to-end in #475 + Scaffald/sdk#11: the endpoint, the SDK method, the cast removed at that one call site, and the empty state split out of the error branch on both inquiry routes. The reported page loads.15 methods still missing, all still reached through
as unknown as InquiryCapabilityClientin inquiries-sdk-hooks.ts:createTemplate,updateTemplate,deleteTemplate,applyTemplate,getSmartDefaults,createBulk,getMultiple,send,addComment,markCommentRead,acceptSection,submitCapabilityResponse,update,changeStatus.Resolve #476 before porting the rest
The description's step 2 said "port the remaining 15 methods." That is now blocked on a naming decision, because
core.inquiriesdoes not exist in the database (#476). Two unrelated concepts share the nameinquiries:sender_id,subject,message)core.inquirieslist/create/respond/templates/bulk*all 500core.application_inquiries(+ 6 related tables)Whether the remaining 15 belong on
client.inquiriesor on a newclient.applicationInquiriesdepends on which concept survives. Porting them under the current name would cement the conflation.Two things to expect when you do port them
getByApplicationselectsapplied_atandapplication_score; neither column exists oncore.applications, so that query 400s. Real columns arecreated_atandscore_total. Validate every select against a live DB — that is how this surfaced.InquiryCommentwas missing threeNOT NULLfields, andcapabilityResponsesdeniednullon two nullable columns. Expect similar per method, and treat that as the point of the exercise rather than an obstacle.Also still open from the description: the lint rule banning
as unknown ason SDK clients. Worth doing last, once the surface is complete, so it does not just block work in progress.