11 lines
545 B
TypeScript
11 lines
545 B
TypeScript
/**
|
|
* auth.repository.ts
|
|
* AuthRepository (interfaz): define qué métodos debe tener el repositorio de auth.
|
|
* El use-case usa esta interfaz sin saber cómo se implementa.
|
|
*/
|
|
|
|
export interface AuthRepository {
|
|
findByEmail(email: string): Promise<{ id: number; email: string; password: string; name: string } | null>;
|
|
create(data: { name: string; email: string; password: string }): Promise<{ id: number; email: string; name: string }>;
|
|
findById(id: number): Promise<{ id: number; email: string; name: string; role: string } | null>;
|
|
} |