*/ final readonly class Shop implements Entity { public function __construct( public ShopId $id, public string $name, public string $address, public string $postcode, public string $city, public ?string $phone = null, public ?string $latitude = null, public ?string $longitude = null, public bool $isDefault = false ) { if (trim($name) === '') { throw new \DomainException('name cannot be empty'); } if (trim($address) === '') { throw new \DomainException('address cannot be empty'); } if (trim($postcode) === '') { throw new \DomainException('postcode cannot be empty'); } if (trim($city) === '') { throw new \DomainException('city cannot be empty'); } } #[\Override] public function id(): ShopId { return $this->id; } }