package datastore

import (
	"awesome-back/internal/domain/entities"
	"awesome-back/internal/domain/repositories"
	"awesome-back/pkg/errors"
)

type MockCoffeeRepository struct {
	coffees []entities.Coffee
}

func NewMockCoffeeRepository() repositories.CoffeeRepository {
	return &MockCoffeeRepository{
		coffees: []entities.Coffee{
			{ID: 1, Name: "Эспрессо", Description: "Крепкий черный кофе", Price: 120.0, Size: "S"},
			{ID: 2, Name: "Капучино", Description: "Кофе с молочной пенкой", Price: 180.0, Size: "M"},
			// ... остальные данные
		},
	}
}

func (r *MockCoffeeRepository) FindAll() ([]entities.Coffee, error) {
	return r.coffees, nil
}

func (r *MockCoffeeRepository) FindByID(id int) (*entities.Coffee, error) {
	for _, coffee := range r.coffees {
		if coffee.ID == id {
			return &coffee, nil
		}
	}
	return nil, errors.NewNotFoundError("coffee not found")
}
