<?php
namespace Modules\SaveTheFood\Services;
use Modules\SaveTheFood\Repositories\Interfaces\SaveTheFoodRepositoryInterface;

class SaveTheFoodService
{
    public function __construct(
        private SaveTheFoodRepositoryInterface $repository
    ) {}

    public function getAll(): \Illuminate\Database\Eloquent\Collection
    {
        return $this->repository->all();
    }

    public function getFeatured(): \Illuminate\Database\Eloquent\Collection
    {
        return $this->repository->getFeatured();
    }

    public function getPageData(): array
    {
        return [
            'hero' => [
                'tag' => 'Rettungsmission',
                'title' => 'Gutes Essen retten, Geld sparen.',
                'subtitle' => 'Produkte kurz vor Ablaufdatum bis zu 70% günstiger',
            ],
            'stats' => $this->repository->getStats(),
            'products' => $this->repository->all(),
        ];
    }
}
