Skip to content

refactor(types): type sponsor dashboard and listings against prisma - #1538

Open
Code-Parth wants to merge 6 commits into
SuperteamDAO:mainfrom
Code-Parth:split/client-types-sponsor-listings
Open

Code-Parth wants to merge 6 commits into
SuperteamDAO:mainfrom
Code-Parth:split/client-types-sponsor-listings

Conversation

@Code-Parth

Copy link
Copy Markdown
Contributor

What does this PR do?

Replaces explicit any in the sponsor dashboard, listing builder and listing pages with the Prisma models, enums and route selects (100 files).

  • Nullable columns are | null on the user, listing and hackathon types these screens read, matching what the API sends. The components and hooks that receive them accept null.
  • Fields the API never returns are removed from User: talent, sponsor and subSkills.
  • Legacy listings that stored rewards as an array are numbered from 1 when loaded into the builder, so they pass validation on edit.

These areas share the user, listing and hackathon types. Making those nullable reaches into every screen that reads them, so they are changed together.

Where should the reviewer start?

  • src/features/listings/types/index.ts, src/features/listing-builder/types/index.ts and src/interface/user.ts, the shared types.
  • src/features/listing-builder/utils/form.ts, where legacy array rewards are handled.
  • src/features/sponsor-dashboard/queries/, the typed query results.

How should this be manually tested?

  • Create, edit, duplicate and publish a bounty and a hackathon listing. The hackathon list and deadline still show.
  • Edit an old listing whose rewards were stored as an array. It loads and saves.
  • In the sponsor dashboard, review submissions and grant applications, pay a winner, and export a sheet.
  • pnpm check-types passes and pnpm lint reports 0 errors.

Any background context you want to provide?

Removes 107 explicit any. Two any stay in VerifyPayment.tsx, each with a reason on the line: react-hook-form's .root error paths are not in its types.

What are the relevant issues?

None.

Screenshots (if appropriate)

None; no visual change.

🤖 Generated with Claude Code

Code-Parth and others added 6 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>
@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 257 files, which is 157 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: 7c6dca4e-321c-45ea-9554-87a7a0793d9c
Commits

Reviewing files that changed from the base of the PR and between 7faae49 and 9127e7f.

Files selected for processing: 257

  • 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/ui/form-field-wrapper.tsx
  • src/components/ui/token-input.tsx
  • src/features/comments/components/Comment.tsx
  • src/features/feed/components/FeedCardContainer.tsx
  • src/features/feed/components/FeedCardHeader.tsx
  • src/features/feed/constants/homeFeed.ts
  • src/features/feed/types/index.ts
  • src/features/grants/utils/grantApplicationSchema.ts
  • src/features/hackathon/utils/getVisibleHackathons.ts
  • src/features/home/components/RecentEarners.tsx
  • src/features/home/components/SideBar.tsx
  • src/features/leaderboard/components/RanksTable.tsx
  • 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/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/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/interface/next-auth.d.ts
  • src/interface/skills.ts
  • src/interface/user.ts
  • 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/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/new/sponsor.tsx
  • src/pages/earn/t/[slug]/index.tsx
  • src/prisma.ts
  • 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: 6 of 8. Please merge after #1537; until then this diff also shows the earlier PRs' files. Next is #1539.

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