ldc-cocotte/domain/Events/Dto/OrderPlacedShop.php
2026-10-27 09:58:12 +01:00

28 lines
724 B
PHP

<?php
declare(strict_types=1);
namespace Domain\Events\Dto;
final readonly class OrderPlacedShop
{
public function __construct(
public string $name,
public string $address,
public string $postcode,
public string $city,
) {
if (empty(trim($name))) {
throw new \DomainException('Shop name is required');
}
if (empty(trim($address))) {
throw new \DomainException('Shop address is required');
}
if (empty(trim($postcode))) {
throw new \DomainException('Shop postcode is required');
}
if (empty(trim($city))) {
throw new \DomainException('Shop city is required');
}
}
}