ldc-ovoteam/app/Contracts/Directories/RecipeDirectory.php
Jérémy Munsch 57faeada75
feat(dto): add CategoryProductsDto, ProductDto, and ProductSummaryDto
Add new DTOs for handling product and category data structures.
These DTOs facilitate data transfer and serialization for products and categories.

refactor(controller): update ProductController to use executor pattern

Refactor ProductController to utilize an executor for handling product creation,
updating, and deletion, improving code organization and maintainability.

refactor(controller): update RecipeController to use executor pattern

Refactor RecipeController to utilize an executor for handling recipe creation,
improving code organization and maintainability.

chore: remove MediaController

Remove MediaController as it is no longer needed in the application.

feat(request): enhance StoreProductRequest and UpdateProductRequest

Enhance StoreProductRequest and UpdateProductRequest to include methods for
transforming request data into input objects for actions.

chore: add ActionExecutorService for executing actions and queries

Introduce ActionExecutorService to handle the execution of actions and queries
with logging and transaction management.

chore(deps): update composer dependencies

Update composer dependencies to include webmozart/assert for improved type assertions.
2026-11-05 11:37:20 +01:00

39 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Contracts\Directories;
use App\Contracts\Directory;
use Domain\Models\Entities\Recipe;
use Domain\Models\ValueObjects\Entities\ProductId;
use Domain\Models\ValueObjects\Entities\RecipeId;
use Domain\Models\ValueObjects\Pagination;
use Illuminate\Pagination\LengthAwarePaginator;
/** @extends Directory<int, \Domain\Models\Entities\Recipe> */
interface RecipeDirectory extends Directory
{
public function find(RecipeId $id): ?Recipe;
public function findBySlug(string $slug): ?Recipe;
/**
* @param \Domain\Models\ValueObjects\Products\ProductCategory[] $productRanges
* @param \Domain\Models\ValueObjects\Recipes\ConsumptionTime[] $consumptionTimes
* @param \Domain\Models\ValueObjects\Recipes\Inspiration[] $inspirations
* @param \Domain\Models\ValueObjects\Recipes\Season[] $seasons
* @return LengthAwarePaginator<array-key,Recipe>
*/
public function getPaginatedRecipes(
Pagination $pagination,
array $productRanges = [],
array $consumptionTimes = [],
array $inspirations = [],
array $seasons = [],
string $search = ''
): LengthAwarePaginator;
/** @return \Domain\Models\Entities\Recipe[] */
public function getRelatedRecipes(ProductId $productId, int $limit = 4): array;
}