Ajout des fichiers de base pour le projet.
This commit is contained in:
26
src/domain/account/repository/AccoutRepository.ts
Normal file
26
src/domain/account/repository/AccoutRepository.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { DatabaseInterface } from "../../../database/DatabaseInterface";
|
||||
import { AccountEntity } from "../entity/AccountEntity";
|
||||
import { AccountRepositoryInterface } from "./AccountRepositoryInterface";
|
||||
|
||||
export default class AccountRepository implements AccountRepositoryInterface {
|
||||
constructor(private readonly database: DatabaseInterface) {}
|
||||
|
||||
async findByEmail(email: string): Promise<AccountEntity | null> {
|
||||
// Implémentation simple pour l'exemple
|
||||
// Dans un vrai projet, on ferait une requête à la base de données
|
||||
console.log(`Recherche du compte avec email: ${email}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
async save(account: AccountEntity): Promise<number> {
|
||||
// Implémentation simple pour l'exemple
|
||||
console.log(`Sauvegarde du compte: ${account.id}`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
async findById(id: string): Promise<AccountEntity | null> {
|
||||
// Implémentation simple pour l'exemple
|
||||
console.log(`Recherche du compte avec ID: ${id}`);
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user