ldc-ovoteam/app/Cqs/Queries/Recipes/GetFrontRecipesQueryInput.php
Jérémy Munsch 6c691f77fc
feat(queries): add new product and recipe queries with inputs
- Implement GetCategoriesProductsQuery and GetCategoriesProductsQueryInput for product category retrieval.
- Implement GetRelatedProductsQuery and GetRelatedProductsQueryInput for related product fetching.
- Implement GetFrontRecipesQuery and GetFrontRecipesQueryInput for front-end recipe listing.
- Implement GetRelatedRecipesQuery and GetRelatedRecipesQueryInput for related recipe fetching.
- Update ProductController and RecipeController to utilize new query classes.
- Enhance IndexProductRequest and IndexRecipeRequest to convert requests to query inputs.
2026-11-05 12:02:36 +01:00

34 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Cqs\Queries\Recipes;
use App\Contracts\QueryInput;
use Domain\Models\ValueObjects\Products\ProductCategory;
use Domain\Models\ValueObjects\Recipes\ConsumptionTime;
use Domain\Models\ValueObjects\Recipes\Inspiration;
use Domain\Models\ValueObjects\Recipes\Season;
use Webmozart\Assert\Assert;
final readonly class GetFrontRecipesQueryInput implements QueryInput
{
/**
* @param ProductCategory[] $categories
* @param ConsumptionTime[] $consumptionTimes
* @param Inspiration[] $inspirations
* @param Season[] $seasons
*/
public function __construct(
public array $categories = [],
public array $consumptionTimes = [],
public array $inspirations = [],
public array $seasons = [],
public string $search = '',
) {
Assert::allIsAOf($this->categories, ProductCategory::class);
Assert::allIsAOf($this->consumptionTimes, ConsumptionTime::class);
Assert::allIsAOf($this->inspirations, Inspiration::class);
Assert::allIsAOf($this->seasons, Season::class);
}
}