import { AuthRepository } from "../../repositories/auth.repository.js"; import { CustomError } from "../../errors/custom.error.js"; export interface GetMeResponse { id: number; email: string; name: string; role: string; } export class GetMeUseCase { constructor(private repository: AuthRepository) {} async execute(userId: number): Promise { const user = await this.repository.findById(userId); if (!user) { throw CustomError.notFound("User not found"); } return user as GetMeResponse; } }