wip
This commit is contained in:
50
packages/identity/domain/repositories/IUserRepository.ts
Normal file
50
packages/identity/domain/repositories/IUserRepository.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Domain Repository: IUserRepository
|
||||
*
|
||||
* Repository interface for User entity operations.
|
||||
*/
|
||||
|
||||
import type { AuthenticatedUserDTO } from '../../application/dto/AuthenticatedUserDTO';
|
||||
|
||||
export interface UserCredentials {
|
||||
email: string;
|
||||
passwordHash: string;
|
||||
salt: string;
|
||||
}
|
||||
|
||||
export interface StoredUser {
|
||||
id: string;
|
||||
email: string;
|
||||
displayName: string;
|
||||
passwordHash: string;
|
||||
salt: string;
|
||||
primaryDriverId?: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface IUserRepository {
|
||||
/**
|
||||
* Find user by email
|
||||
*/
|
||||
findByEmail(email: string): Promise<StoredUser | null>;
|
||||
|
||||
/**
|
||||
* Find user by ID
|
||||
*/
|
||||
findById(id: string): Promise<StoredUser | null>;
|
||||
|
||||
/**
|
||||
* Create a new user
|
||||
*/
|
||||
create(user: StoredUser): Promise<StoredUser>;
|
||||
|
||||
/**
|
||||
* Update user
|
||||
*/
|
||||
update(user: StoredUser): Promise<StoredUser>;
|
||||
|
||||
/**
|
||||
* Check if email exists
|
||||
*/
|
||||
emailExists(email: string): Promise<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user