2026-07-08 14:55:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Contracts\Directories;
|
|
|
|
|
|
|
|
|
|
use App\Contracts\Directory;
|
2026-11-05 11:17:20 +01:00
|
|
|
use App\Dto\CategoryProductsDto;
|
2026-07-08 14:55:18 +02:00
|
|
|
use Domain\Models\Entities\Product;
|
2026-07-08 16:32:12 +02:00
|
|
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
2026-07-09 15:41:15 +02:00
|
|
|
use Domain\Models\ValueObjects\Entities\RecipeId;
|
2026-07-08 14:55:18 +02:00
|
|
|
use Domain\Models\ValueObjects\Pagination;
|
|
|
|
|
use Domain\Models\ValueObjects\Products\ProductCategory;
|
|
|
|
|
use Illuminate\Pagination\LengthAwarePaginator;
|
|
|
|
|
|
2026-11-05 11:17:20 +01:00
|
|
|
/** @extends Directory<int, \Domain\Models\Entities\Product> */
|
2026-07-08 14:55:18 +02:00
|
|
|
interface ProductDirectory extends Directory
|
|
|
|
|
{
|
2026-07-08 16:32:12 +02:00
|
|
|
public function find(ProductId $id): ?Product;
|
|
|
|
|
|
|
|
|
|
public function findBySlug(string $slug): ?Product;
|
2026-07-08 14:55:18 +02:00
|
|
|
|
2026-07-09 15:41:15 +02:00
|
|
|
/**
|
2026-11-05 11:17:20 +01:00
|
|
|
* @return \Domain\Models\ValueObjects\Products\ProductSummary[]
|
2026-07-09 15:41:15 +02:00
|
|
|
*/
|
2026-11-05 11:17:20 +01:00
|
|
|
public function getAllProductsSummaries(): array;
|
2026-07-09 15:41:15 +02:00
|
|
|
|
2026-07-08 14:55:18 +02:00
|
|
|
/**
|
|
|
|
|
* @return LengthAwarePaginator<array-key,Product>
|
|
|
|
|
*/
|
|
|
|
|
public function getPaginatedProducts(
|
|
|
|
|
Pagination $pagination,
|
|
|
|
|
string $search = '',
|
|
|
|
|
): LengthAwarePaginator;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param \Domain\Models\ValueObjects\Products\BreedingMethod[] $breedingMethods
|
|
|
|
|
* @param \Domain\Models\ValueObjects\Products\Technology[] $technologies
|
|
|
|
|
* @param \Domain\Models\ValueObjects\Products\Business[] $businesses
|
|
|
|
|
*/
|
|
|
|
|
public function getCategoryProducts(
|
|
|
|
|
ProductCategory $category,
|
|
|
|
|
array $breedingMethods = [],
|
|
|
|
|
array $technologies = [],
|
|
|
|
|
array $businesses = [],
|
|
|
|
|
?bool $isEgalim = null,
|
|
|
|
|
string $search = '',
|
|
|
|
|
int $limitPerCategory = 6
|
2026-11-05 11:17:20 +01:00
|
|
|
): ?CategoryProductsDto;
|
2026-07-09 15:41:15 +02:00
|
|
|
|
|
|
|
|
/** @return \Domain\Models\Entities\Product[] */
|
|
|
|
|
public function getRelatedProducts(RecipeId $recipeId, int $limit = 4): array;
|
2026-07-08 14:55:18 +02:00
|
|
|
}
|