ldc-cocotte/domain/Models/ValueObjects/IcsContent.php
Jérémy Munsch 0ae05e031d
feat(jobs): enhance SendMissingOrderReminderJob with ICS content generation
- Added IcsGeneratorService for generating ICS content.
- Updated MissingOrderReminderNotification to include cutoff date and ICS content.
- Refactored SendMissingOrderReminderJob to utilize new ICS generation logic.
- Introduced IcsContent value object for better ICS content handling.
- Added tests for new functionality in SendMissingOrderReminderJob and IcsGeneratorService.
2026-11-15 19:49:48 +01:00

26 lines
648 B
PHP

<?php
declare(strict_types=1);
namespace Domain\Models\ValueObjects;
use Webmozart\Assert\Assert;
final readonly class IcsContent implements \Stringable
{
public function __construct(
public string $value,
) {
$trimmed = trim($value);
Assert::stringNotEmpty($trimmed, 'ICS content cannot be empty.');
Assert::startsWith($trimmed, 'BEGIN:VCALENDAR', 'ICS content must start with BEGIN:VCALENDAR.');
Assert::endsWith($trimmed, 'END:VCALENDAR', 'ICS content must end with END:VCALENDAR.');
}
#[\Override]
public function __toString(): string
{
return $this->value;
}
}