Repository navigation
Closed
Labels
Medium ComplexityStellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbugSomething isn't workingSomething isn't working
Description
Replace unchecked as-any casts in admin, backup, search, and transactions modules
Labels / Complexity: bug · Medium Complexity — Medium
Problem
Four modules carry the heaviest as any usage in the repo (verified by grep): src/admin/ (15), src/search/ (15), src/backup/ (12), and src/transactions/ (12). Each cast erases a type check at exactly the point where the code meets Prisma models, request payloads, or provider responses — the surfaces most likely to drift from their declared types. When the runtime shape changes, the cast compiles and the mismatch surfaces as a confusing runtime failure.
- The casts hide contract drift. A Prisma model field renamed or a provider response reshaped compiles fine through
as anyand breaks at runtime. - They defeat the strict config. The repo runs
tsconfig.jsonstrict; these casts are the deliberate holes in it, independent of the@ts-nocheckdirectives (Remove// @ts-nocheckfrom all source files and fix underlying type errors #890).
Why this is architecturally hard
- Each cast needs the real type. The fix is replacing
as anywith the actual Prisma/generated type or a locally defined shape; for provider responses that means declaring the external contract explicitly. - The four modules differ. Admin (service/controller types), search (query shapes), backup (status unions), and transactions (Prisma unions) each need their own type strategy; slicing per module keeps PRs reviewable.
- Some casts mask genuine union problems. Where the underlying types disagree, the fix is a type refactor, not a narrower cast — that is the design work of the issue.
Acceptance criteria
- All
as anycasts in the four named modules are replaced with real types or locally declared shapes. npx tsc --noEmitpasses withstrictunchanged;npm testpasses with no behavior change.- The PR description reports the repository-wide
as anycount before and after.
Out of scope
as any in other modules; the @ts-nocheck migrations (#890).
Getting started
grep -rn "as any" src/admin src/search src/backup src/transactions --include=*.ts— the sitessrc/types/prisma.types.ts— the Prisma-generated types to use
Commands: npx tsc --noEmit, npm test.
Good first files to read: src/backup/backup.service.ts (status unions), src/types/prisma.types.ts.
Metadata
Metadata
Assignees
Labels
Medium ComplexityStellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbugSomething isn't workingSomething isn't working
Activity
divysam commentedon Aug 26, 2026
@divysam has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @divysam to this issue.
shadrackmanfred commentedon Aug 26, 2026
@shadrackmanfred has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @shadrackmanfred to this issue.
drips-wave commentedon Aug 26, 2026
Congratulations, @shadrackmanfred! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @shadrackmanfred: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
shadrackmanfred commentedon Aug 28, 2026
Resolved on branch
fix/type-safety-and-admin-tests(commit 1f932bf): all 56as anycasts across src/admin, src/search, src/backup, src/transactions replaced with real Prisma/enum/DTO types (56 → 0). Verified: tsc --noEmit clean, 71 suites / 515 unit tests pass.shadrackmanfred commentedon Sep 1, 2026
Addressed by #1172.