This commit introduces new actions for adding, removing, and emptying items in the basket, along with their corresponding input classes. It also updates the BasketController to utilize these new actions, enhancing the basket management functionality.
19 lines
401 B
PHP
19 lines
401 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Actions\Basket;
|
|
|
|
use App\Contracts\ActionInput;
|
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
|
use Webmozart\Assert\Assert;
|
|
|
|
final readonly class RemoveQuantityFromBasketInput implements ActionInput
|
|
{
|
|
public function __construct(
|
|
public ProductId $productId,
|
|
public int $qty,
|
|
) {
|
|
Assert::greaterThan($qty, 0);
|
|
}
|
|
}
|