feat: add booking time ranges and repeating series

This commit is contained in:
fromme committed 2026-09-13 17:34:28 +02:00
1 parent 59feca2f8e
commit d433d271d0
29 files changed
+2135 -180

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace App\Booking;
use App\Entity\Booking;
use App\Entity\BookingSeries;
/**
* What creating a series actually achieved. A series is materialised best-effort: days that were
* already taken are skipped and reported, rather than failing the whole series.
*/
final readonly class SeriesResult
{
/**
* @param list<Booking> $created
* @param array<string, string> $skipped Y-m-d => reason
*/
public function __construct(
public BookingSeries $series,
public array $created,
public array $skipped,
) {
}
public function createdCount(): int
{
return \count($this->created);
}
public function skippedCount(): int
{
return \count($this->skipped);
}
public function isCompletelyBlocked(): bool
{
return [] === $this->created;
}
/**
* @return list<string>
*/
public function skippedDates(): array
{
return array_map(
static fn (string $date): string => (new \DateTimeImmutable($date))->format('j.n.'),
array_keys($this->skipped),
);
}
}