Skip to content

refactor(types): type talent features and shared components against prisma - #1539

Open
Code-Parth wants to merge 7 commits into
SuperteamDAO:mainfrom
Code-Parth:split/client-types-talent-shared
Open

Code-Parth wants to merge 7 commits into
SuperteamDAO:mainfrom
Code-Parth:split/client-types-talent-shared

Conversation

@Code-Parth

Copy link
Copy Markdown
Contributor

What does this PR do?

Replaces the remaining explicit any in grants, auth, feed, credits, the shared UI components, the inline svg components and the client interfaces (59 files).

  • Nullable columns are | null on the interfaces that reach the client.
  • Grant.requirements, which the API never returns, is removed.
  • The inline svg components type their props instead of any.

After this, src has no explicit any outside four commented exceptions at library boundaries.

Where should the reviewer start?

  • src/features/grants/types/index.ts
  • src/features/auth/utils/
  • src/components/ui/

How should this be manually tested?

  • Apply to a grant, and request a tranche on an approved one.
  • Sign in, sign out, and open a talent profile and the feed.
  • Open the credits drawer.
  • Check that the hackathon logos render on their pages.
  • pnpm check-types passes and pnpm lint reports 0 errors.

Any background context you want to provide?

Removes the last 112 explicit any.

What are the relevant issues?

None.

Screenshots (if appropriate)

None; no visual change.

🤖 Generated with Claude Code

Code-Parth and others added 7 commits November 20, 2026 17:02
Adds getErrorMessage, jsonResponse, parseQuestionAnswers,
parseQuestionConfigs, getPaymentAmount and the skills and linkedTwitter
parsers, and types the shared server utils against the Prisma models
instead of any. No call sites in API routes change here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catch clauses are unknown and narrowed, request bodies and JSON columns
are parsed instead of cast. The OG image routes fall back to "?" when the
name param is missing, and scout generation keeps existing scouts and
returns early when the bounty has no matchable skills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers every route under src/pages/api except the sponsor dashboard.
catch clauses are unknown and narrowed, and request bodies, sessions and
JSON columns use the Prisma models and route selects instead of casts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catch clauses are unknown and narrowed, and listing rewards, payment
details and export rows use typed shapes instead of any. Payment history
stored in an unexpected shape is now refused with an error instead of
being treated as empty and overwritten on the next payment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Approving several applications at once could store one application's
amount on another. Updates were pushed after awaiting token prices, so
array order did not match the applications, and amounts were read from
the request by index even though findMany with `in` does not return rows
in request order. Updates are now returned from Promise.all and amounts
are matched by application id.

applicationStatus is validated against the Prisma enum, so an invalid
status returns 400 instead of failing inside the transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces explicit any in the sponsor dashboard, listing builder and
listing pages with the Prisma models, enums and route selects. Nullable
columns are `| null` on the user, listing and hackathon types these
screens read, and the components and hooks that receive them accept
null. Fields the API never returns are removed from User (talent,
sponsor, subSkills).

Legacy listings that stored rewards as an array are numbered from 1 when
loaded into the builder, so they pass validation on edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…risma

Replaces the remaining explicit any in grants, auth, feed, credits, the
shared UI components, the inline svg components and the client
interfaces. Nullable columns are `| null` on the interfaces that reach
the client, and Grant.requirements, which the API never returns, is
removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@Code-Parth is attempting to deploy a commit to the Superteam Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 316 files, which is 216 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.

Check out review usage here.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 70d61fb7-9768-4ec0-835f-dbe526e06402
Commits

Reviewing files that changed from the base of the PR and between 7faae49 and 6881b8e.

Files selected for processing: 316

  • src/app/api/dynamic-og/category/route.tsx
  • src/app/api/dynamic-og/grant/route.tsx
  • src/app/api/dynamic-og/listing/route.tsx
  • src/app/api/dynamic-og/pro-talent/route.tsx
  • src/app/api/dynamic-og/pro-x/route.tsx
  • src/app/api/dynamic-og/region/route.tsx
  • src/app/api/dynamic-og/skill/route.tsx
  • src/app/api/dynamic-og/sponsor/route.tsx
  • src/app/api/dynamic-og/talent/route.tsx
  • src/app/api/dynamic-og/winners/route.tsx
  • src/app/api/grant-application/create/route.ts
  • src/app/api/grant-application/request-tranche/route.ts
  • src/app/api/grant-application/update/route.ts
  • src/app/api/homepage/feed/route.ts
  • src/app/api/homepage/recent-earners/route.ts
  • src/app/api/homepage/sponsor-count/route.ts
  • src/app/api/homepage/stats/route.ts
  • src/app/api/homepage/user-count/route.ts
  • src/app/api/sponsor-dashboard/ai-generate/questions/route.ts
  • src/app/api/sponsor-dashboard/ai-generate/rewards/route.ts
  • src/app/api/sponsor-dashboard/ai-generate/skills/route.ts
  • src/app/api/sponsor-dashboard/ai-generate/title/route.ts
  • src/app/api/sponsor-dashboard/ai-generate/token/route.ts
  • src/app/api/sponsor-dashboard/grant-application/ai/commit-reviewed/route.ts
  • src/app/api/sponsor-dashboard/grant-application/ai/unreviewed/route.ts
  • src/app/api/sponsor-dashboard/grants/update-tranche-status/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/announce/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/delete/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/publish/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/scout/invite/[userId]/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/scout/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/unpublish/route.ts
  • src/app/api/sponsor-dashboard/listing/[id]/update/route.ts
  • src/app/api/sponsor-dashboard/listing/check-slug/route.ts
  • src/app/api/sponsor-dashboard/submissions/ai/commit-reviewed/route.ts
  • src/app/api/sponsor-dashboard/submissions/ai/unreviewed/route.ts
  • src/app/api/sponsor-dashboard/templates/[slug]/route.ts
  • src/app/api/sponsor-dashboard/templates/route.ts
  • src/app/api/user/complete-profile/route.ts
  • src/app/api/user/credit/balance/route.ts
  • src/app/api/user/credit/history/route.ts
  • src/components/providers.tsx
  • src/components/shared/JsonLd.tsx
  • src/components/shared/MarkdownRenderer.tsx
  • src/components/tiptap/extensions/image/components/image-cleanup.tsx
  • src/components/tiptap/hooks/use-throttle.ts
  • src/components/ui/datetime-picker.tsx
  • src/components/ui/form-field-wrapper.tsx
  • src/components/ui/token-icon.tsx
  • src/components/ui/token-input.tsx
  • src/features/agents/utils/queueAgent.ts
  • src/features/auth/utils/getPrivyToken.ts
  • src/features/auth/utils/getSponsorSession.ts
  • src/features/auth/utils/getUserSession.ts
  • src/features/auth/utils/handleUserCreation.ts
  • src/features/auth/utils/popup-signin.ts
  • src/features/comments/components/Comment.tsx
  • src/features/comments/components/CommentParser.tsx
  • src/features/comments/utils/fetchComments.ts
  • src/features/conversion-popups/components/ListingPop.tsx
  • src/features/credits/components/CreditDrawer.tsx
  • src/features/credits/components/DisputeModal.tsx
  • src/features/emails/utils/queueEmail.ts
  • src/features/feed/components/FeedCardContainer.tsx
  • src/features/feed/components/FeedCardHeader.tsx
  • src/features/feed/components/FeedLoop.tsx
  • src/features/feed/components/FeedPost.tsx
  • src/features/feed/components/powCard.tsx
  • src/features/feed/constants/homeFeed.ts
  • src/features/feed/queries/home-feed.ts
  • src/features/feed/types/index.ts
  • src/features/grants/components/GrantEntry.tsx
  • src/features/grants/components/GrantsHeader.tsx
  • src/features/grants/components/InfoWrapper.tsx
  • src/features/grants/components/Modals/ApplicationModal.tsx
  • src/features/grants/components/Modals/KYCModal.tsx
  • src/features/grants/components/Modals/TrancheFormModal.tsx
  • src/features/grants/constants/userApplication.ts
  • src/features/grants/types/index.ts
  • src/features/grants/utils/addOnboardingInfoToAirtable.ts
  • src/features/grants/utils/addPaymentInfoToAirtable.ts
  • src/features/grants/utils/createTranche.ts
  • src/features/grants/utils/grantApplicationSchema.ts
  • src/features/grants/utils/syncGrantApplicationWithAirtable.ts
  • src/features/hackathon/utils/getVisibleHackathons.ts
  • src/features/home/components/RecentActivity.tsx
  • src/features/home/components/RecentEarners.tsx
  • src/features/home/components/SideBar.tsx
  • src/features/kyc/utils/getApplicantData.ts
  • src/features/leaderboard/components/RanksTable.tsx
  • src/features/leaderboard/types.ts
  • src/features/listing-builder/atoms/index.ts
  • src/features/listing-builder/components/AutoGenerate/Dialog.tsx
  • src/features/listing-builder/components/AutoGenerate/Form.tsx
  • src/features/listing-builder/components/AutoGenerate/Templates.tsx
  • src/features/listing-builder/components/AutoGenerate/Type.tsx
  • src/features/listing-builder/components/Form/Boost/BoostButton.tsx
  • src/features/listing-builder/components/Form/DescriptionAndTemplate/Templates.tsx
  • src/features/listing-builder/components/Form/Rewards/BoostContent.tsx
  • src/features/listing-builder/components/Form/Rewards/Footer.tsx
  • src/features/listing-builder/components/Form/Rewards/Sheet.tsx
  • src/features/listing-builder/components/Form/SponsorVerificationForm.tsx
  • src/features/listing-builder/components/Form/TitleAndType.tsx
  • src/features/listing-builder/components/ListingBuilder.tsx
  • src/features/listing-builder/components/ListingBuilderProvider.tsx
  • src/features/listing-builder/hooks/index.ts
  • src/features/listing-builder/types/index.ts
  • src/features/listing-builder/types/schema.ts
  • src/features/listing-builder/utils/form.ts
  • src/features/listing-builder/utils/isListingEditable.ts
  • src/features/listing-builder/utils/listingValidator.ts
  • src/features/listing-builder/utils/suggestions.ts
  • src/features/listings/components/ListingPage/CompensationAmount.tsx
  • src/features/listings/components/ListingPage/DescriptionUI.tsx
  • src/features/listings/components/ListingPage/ExtraInfoSection.tsx
  • src/features/listings/components/ListingPage/ReportListing.tsx
  • src/features/listings/components/Submission/KYCModal.tsx
  • src/features/listings/components/Submission/SubmissionDrawer.tsx
  • src/features/listings/components/Submission/SubmissionTerms.tsx
  • src/features/listings/queries/live-listings.ts
  • src/features/listings/queries/recent-earners.ts
  • src/features/listings/types/index.ts
  • src/features/listings/utils/addPaymentInfoToAirtable.ts
  • src/features/listings/utils/createPayment.ts
  • src/features/listings/utils/description-html.ts
  • src/features/listings/utils/paymentDetails.ts
  • src/features/listings/utils/region.ts
  • src/features/listings/utils/status.ts
  • src/features/listings/utils/submissionFormSchema.ts
  • src/features/social/components/SocialInput.tsx
  • src/features/social/utils/linkedTwitter.ts
  • src/features/sponsor-dashboard/components/CreateListingModal.tsx
  • src/features/sponsor-dashboard/components/GrantApplications/ApplicationDetails.tsx
  • src/features/sponsor-dashboard/components/GrantApplications/Modals/AiReview.tsx
  • src/features/sponsor-dashboard/components/GrantApplications/Modals/ApproveModal.tsx
  • src/features/sponsor-dashboard/components/GrantApplications/Modals/MultiActionModal.tsx
  • src/features/sponsor-dashboard/components/InfoBox.tsx
  • src/features/sponsor-dashboard/components/LocalProfiles/UserDrawer.tsx
  • src/features/sponsor-dashboard/components/LocalProfiles/UserTable.tsx
  • src/features/sponsor-dashboard/components/Modals/ExportSheetsModal.tsx
  • src/features/sponsor-dashboard/components/Modals/UnpublishModal.tsx
  • src/features/sponsor-dashboard/components/Modals/VerifyPayment.tsx
  • src/features/sponsor-dashboard/components/PublishResults.tsx
  • src/features/sponsor-dashboard/components/SelectHackathon.tsx
  • src/features/sponsor-dashboard/components/SelectSponsor.tsx
  • src/features/sponsor-dashboard/components/SponsorInfoModal.tsx
  • src/features/sponsor-dashboard/components/SponsorPrize.tsx
  • src/features/sponsor-dashboard/components/Submissions/Details.tsx
  • src/features/sponsor-dashboard/components/Submissions/Modals/AiReviewBounties.tsx
  • src/features/sponsor-dashboard/components/Submissions/Modals/AiReviewProjects.tsx
  • src/features/sponsor-dashboard/components/Submissions/Modals/MultiActionModal.tsx
  • src/features/sponsor-dashboard/components/Submissions/PayoutButton.tsx
  • src/features/sponsor-dashboard/components/Submissions/PayoutSection.tsx
  • src/features/sponsor-dashboard/components/Submissions/SpamButton.tsx
  • src/features/sponsor-dashboard/components/Submissions/SubmissionHeader.tsx
  • src/features/sponsor-dashboard/components/Submissions/SubmissionList.tsx
  • src/features/sponsor-dashboard/components/Submissions/SubmissionPanel.tsx
  • src/features/sponsor-dashboard/components/Traches/TrancheDetails.tsx
  • src/features/sponsor-dashboard/mutations/useToggleWinner.ts
  • src/features/sponsor-dashboard/queries/active-hackathons.ts
  • src/features/sponsor-dashboard/queries/approved-grantees.ts
  • src/features/sponsor-dashboard/queries/dashboard.ts
  • src/features/sponsor-dashboard/queries/grant.ts
  • src/features/sponsor-dashboard/queries/listing.ts
  • src/features/sponsor-dashboard/queries/local-profiles.ts
  • src/features/sponsor-dashboard/queries/members.ts
  • src/features/sponsor-dashboard/queries/scouts.ts
  • src/features/sponsor-dashboard/queries/sponsor-stats.ts
  • src/features/sponsor-dashboard/queries/sponsor.ts
  • src/features/sponsor-dashboard/utils/paymentRPCValidation.ts
  • src/features/sponsor/utils/sponsorFormSchema.ts
  • src/features/stfun/components/common/SuperteamMap.tsx
  • src/features/talent/components/EarnAvatar.tsx
  • src/features/talent/components/onboarding-form/Form.tsx
  • src/features/talent/queries/random-username.ts
  • src/features/talent/utils/useUsernameValidation.ts
  • src/features/wallet/utils/fetchWalletActivity.ts
  • src/interface/comments.ts
  • src/interface/next-auth.d.ts
  • src/interface/scouts.ts
  • src/interface/skills.ts
  • src/interface/sponsor.ts
  • src/interface/submission.ts
  • src/interface/user.ts
  • src/layouts/Feed.tsx
  • src/layouts/Grants.tsx
  • src/layouts/Listing.tsx
  • src/lib/api.ts
  • src/lib/image-upload/cloudinary-client.ts
  • src/lib/image-upload/errors.ts
  • src/lib/rateLimiterService.ts
  • src/pages/api/agents/claim.ts
  • src/pages/api/agents/comments/[id].ts
  • src/pages/api/agents/comments/create.ts
  • src/pages/api/agents/index.ts
  • src/pages/api/agents/submissions/create.ts
  • src/pages/api/agents/submissions/update.ts
  • src/pages/api/auth/[...nextauth].ts
  • src/pages/api/comment/[id]/delete.ts
  • src/pages/api/comment/[id]/index.ts
  • src/pages/api/comment/[id]/pin.ts
  • src/pages/api/comment/create.ts
  • src/pages/api/email/manual/welcome-sponsor.ts
  • src/pages/api/feed/[type]/[id]/get.ts
  • src/pages/api/feed/get.ts
  • src/pages/api/grant-application/get.ts
  • src/pages/api/grant-application/like.ts
  • src/pages/api/grants/[slug].ts
  • src/pages/api/grants/delete/[id].ts
  • src/pages/api/grants/live.ts
  • src/pages/api/grants/update/[id].ts
  • src/pages/api/hackathon/subscribe/get.ts
  • src/pages/api/hackathon/subscribe/toggle.ts
  • src/pages/api/listings/[listingId]/submission-count.ts
  • src/pages/api/listings/[listingId]/winners.ts
  • src/pages/api/listings/bookmarks.ts
  • src/pages/api/listings/details/[slug].ts
  • src/pages/api/listings/latest-active-slug.ts
  • src/pages/api/listings/submissions/[slug].ts
  • src/pages/api/member-invites/accept.ts
  • src/pages/api/member-invites/send.ts
  • src/pages/api/pow/create.ts
  • src/pages/api/pow/edit.ts
  • src/pages/api/pow/get.ts
  • src/pages/api/pow/like.ts
  • src/pages/api/search/[query].ts
  • src/pages/api/sponsor-dashboard/[slug]/listing.ts
  • src/pages/api/sponsor-dashboard/[slug]/submissions.ts
  • src/pages/api/sponsor-dashboard/active-hackathons.ts
  • src/pages/api/sponsor-dashboard/application/export-sheets.ts
  • src/pages/api/sponsor-dashboard/application/export.ts
  • src/pages/api/sponsor-dashboard/grants/[slug]/applications.ts
  • src/pages/api/sponsor-dashboard/grants/[slug]/index.ts
  • src/pages/api/sponsor-dashboard/grants/[slug]/tranches.ts
  • src/pages/api/sponsor-dashboard/grants/add-tranche.ts
  • src/pages/api/sponsor-dashboard/grants/approved-grantees.ts
  • src/pages/api/sponsor-dashboard/grants/update-application-status.ts
  • src/pages/api/sponsor-dashboard/grants/update-label.ts
  • src/pages/api/sponsor-dashboard/grants/update-notes.ts
  • src/pages/api/sponsor-dashboard/grants/update-ship-progress.ts
  • src/pages/api/sponsor-dashboard/listings/index.ts
  • src/pages/api/sponsor-dashboard/listings/is-create-allowed.ts
  • src/pages/api/sponsor-dashboard/listings/verify-external-payment.ts
  • src/pages/api/sponsor-dashboard/local-talent/export.ts
  • src/pages/api/sponsor-dashboard/local-talent/index.ts
  • src/pages/api/sponsor-dashboard/members/index.ts
  • src/pages/api/sponsor-dashboard/members/remove.ts
  • src/pages/api/sponsor-dashboard/members/update-role.ts
  • src/pages/api/sponsor-dashboard/submission/add-payment.ts
  • src/pages/api/sponsor-dashboard/submission/export-sheets.ts
  • src/pages/api/sponsor-dashboard/submission/export.ts
  • src/pages/api/sponsor-dashboard/submission/reject.ts
  • src/pages/api/sponsor-dashboard/submission/toggle-winner.ts
  • src/pages/api/sponsor-dashboard/submission/update-label.ts
  • src/pages/api/sponsor-dashboard/submission/update-notes.ts
  • src/pages/api/sponsor/verification.ts
  • src/pages/api/sponsors/check-name.ts
  • src/pages/api/sponsors/check-slug.ts
  • src/pages/api/sponsors/create.ts
  • src/pages/api/sponsors/edit.ts
  • src/pages/api/sponsors/index.ts
  • src/pages/api/sponsors/list.ts
  • src/pages/api/sponsors/stats.ts
  • src/pages/api/sponsors/update-entity-name.ts
  • src/pages/api/sponsors/usersponsor-details.ts
  • src/pages/api/submission/check.ts
  • src/pages/api/submission/create.ts
  • src/pages/api/submission/get.ts
  • src/pages/api/submission/like.ts
  • src/pages/api/submission/update.ts
  • src/pages/api/twitter/tweet-stats.ts
  • src/pages/api/user/create.ts
  • src/pages/api/user/edit.ts
  • src/pages/api/user/pfps.ts
  • src/pages/api/user/random-username.ts
  • src/pages/api/user/referral/verify.ts
  • src/pages/api/user/resolve-privy-dids.ts
  • src/pages/api/user/search.ts
  • src/pages/api/user/update-email-settings.ts
  • src/pages/api/user/update-survey.ts
  • src/pages/api/user/update.ts
  • src/pages/api/user/username.ts
  • src/pages/earn/claim/[claimCode].tsx
  • src/pages/earn/dashboard/grants/[slug]/applications.tsx
  • src/pages/earn/dashboard/hackathon/[listing]/submissions.tsx
  • src/pages/earn/dashboard/hackathon/index.tsx
  • src/pages/earn/dashboard/listings/[slug]/submissions.tsx
  • src/pages/earn/dashboard/local-profiles/index.tsx
  • src/pages/earn/dashboard/sponsor/edit.tsx
  • src/pages/earn/leaderboard/index.tsx
  • src/pages/earn/new/sponsor.tsx
  • src/pages/earn/t/[slug]/edit.tsx
  • src/pages/earn/t/[slug]/index.tsx
  • src/pages/member-perks.tsx
  • src/prisma.ts
  • src/svg/WandAnimated/WandAnimated.tsx
  • src/svg/breakout-logo.tsx
  • src/svg/cypherpunk-logo.tsx
  • src/svg/radar-logo.tsx
  • src/svg/renaissance-logo.tsx
  • src/svg/scribes-logo.tsx
  • src/svg/talent-olympics-header.tsx
  • src/utils/airtable.ts
  • src/utils/atoms.ts
  • src/utils/cloudinary.ts
  • src/utils/filterAllowedFields.ts
  • src/utils/getErrorMessage.ts
  • src/utils/json-ld.ts
  • src/utils/jsonResponse.ts
  • src/utils/ogHelpers.ts
  • src/utils/parseQuestionAnswers.ts
  • src/utils/parseQuestionConfigs.ts
  • src/utils/safeStringify.ts
  • src/utils/solanaTransactionHelpers.ts
  • src/utils/truncatePublicKey.ts
  • src/utils/undefinedToNull.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Code-Parth

Copy link
Copy Markdown
Contributor Author

Merge order: 7 of 8. Please merge after #1538; until then this diff also shows the earlier PRs' files. Next is #1540.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant