- 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.
19 lines
417 B
PHP
19 lines
417 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Cqs\Queries\Recipes;
|
|
|
|
use App\Contracts\QueryInput;
|
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
|
use Webmozart\Assert\Assert;
|
|
|
|
final readonly class GetRelatedRecipesQueryInput implements QueryInput
|
|
{
|
|
public function __construct(
|
|
public ProductId $productId,
|
|
public int $limit = 10,
|
|
) {
|
|
Assert::greaterThan($this->limit, 0);
|
|
}
|
|
}
|