ldc-cocotte/app/Cqs/Actions/Discounts/CreateDiscountInput.php
Jérémy Munsch d0efb0f527
refactor: update namespaces for actions and queries
Refactored the codebase to change the namespaces of various actions and queries from `App\Actions` to `App\Cqs\Actions` and `App\Queries` to `App\Cqs\Queries`. This restructuring improves organization and clarity in the codebase.
2026-11-10 15:13:26 +01:00

28 lines
826 B
PHP

<?php
declare(strict_types=1);
namespace App\Cqs\Actions\Discounts;
use App\Contracts\ActionInput;
use Domain\Enums\DiscountType;
use Domain\Models\ValueObjects\DatePeriod;
use Domain\Models\ValueObjects\DiscountValue;
use Webmozart\Assert\Assert;
final readonly class CreateDiscountInput implements ActionInput
{
/**
* @param array<string> $associatedProductsIds
*/
public function __construct(
public DiscountType $type,
public DiscountValue $value,
public bool $is_old_price_displayed,
public DatePeriod $period = new DatePeriod(),
public array $associatedProductsIds = [],
) {
Assert::same($this->type, $this->value->type, 'The discount value type must match the discount type.');
Assert::allString($this->associatedProductsIds);
}
}