ldc-cocotte/domain/Models/ValueObjects/Entities/ShopId.php

21 lines
427 B
PHP
Raw Normal View History

2026-06-14 21:32:07 +02:00
<?php
declare(strict_types=1);
namespace Domain\Models\ValueObjects\Entities;
use Ramsey\Uuid\UuidInterface;
use Shared\DDD\EntityId;
use Shared\Helpers\UuidHelper;
final readonly class ShopId extends EntityId
{
public function __construct(
public UuidInterface $value
) {
if (! UuidHelper::isV7($value)) {
throw new \DomainException('value shall be a valid UUID v7');
}
}
}