Summary
Improve type safety in profiles.ts by removing remaining usages of any and replacing them with proper Fastify, TypeScript, Prisma, and application-specific types.
Contexts
The profile routes currently contain several usages of any that bypass TypeScript's type checking and reduce maintainability.
Examples include:
const server = request.server as any;
(app as any).authenticate
Some of these usages are related to authentication, Fastify route handlers, Prisma errors, and shared request/user typings. Existing shared Fastify/JWT type definitions should be reused where available instead of introducing duplicate definitions.
Removing these usages will improve maintainability, reduce unsafe casts, and make future refactoring easier.
Tasks
Acceptance Criteria
Area
backend
Difficulty
Good First Issue
Summary
Improve type safety in
profiles.tsby removing remaining usages ofanyand replacing them with proper Fastify, TypeScript, Prisma, and application-specific types.Contexts
The profile routes currently contain several usages of
anythat bypass TypeScript's type checking and reduce maintainability.Examples include:
Some of these usages are related to authentication, Fastify route handlers, Prisma errors, and shared request/user typings. Existing shared Fastify/JWT type definitions should be reused where available instead of introducing duplicate definitions.
Removing these usages will improve maintainability, reduce unsafe casts, and make future refactoring easier.
Tasks
anyusages inprofiles.tsserver as anywith appropriate Fastify typesapp as anywith appropriate Fastify typesrequest.user as anywith properly typed user accesserr: anywith safer error handling patternsAcceptance Criteria
anyusages remain inprofiles.tsanyusageArea
backendDifficulty
Good First Issue