29 lines
577 B
PHP
29 lines
577 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Domain\Models\ValueObjects\Inco;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Represents the storage/conservation conditions of a product.
|
||
|
|
*
|
||
|
|
* Maps to CONDIT_CONSERV.
|
||
|
|
*/
|
||
|
|
final readonly class StorageCondition
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
public readonly string $instructions,
|
||
|
|
) {
|
||
|
|
if (empty(trim($this->instructions))) {
|
||
|
|
throw new \DomainException(
|
||
|
|
'Invalid instructions: must not be empty'
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public function jsonSerialize(): mixed
|
||
|
|
{
|
||
|
|
return $this->instructions;
|
||
|
|
}
|
||
|
|
}
|