import { IAchievementRepository } from "@core/identity/application/use-cases/achievement/CreateAchievementUseCase";
import { Achievement } from "@core/identity/domain/entities/Achievement";


export class InMemoryAchievementRepository implements IAchievementRepository {
  private readonly achievements: Map<string, Achievement> = new Map();

  async save(achievement: Achievement): Promise<void> {
    this.achievements.set(achievement.id, achievement);
  }

  async findById(id: string): Promise<Achievement | null> {
    return this.achievements.get(id) || null;
  }

  async findAll(): Promise<Achievement[]> {
    return Array.from(this.achievements.values());
  }
}
