feat: add admin views, a booking horizon and confirmation modals

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
frommeandClaude Opus 5 committed 2026-09-14 09:40:17 +02:00
1 parent 8caf618950
commit 1a3640b15c
27 files changed
+1269 -62

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace App\Tests\Booking;
use App\Booking\Horizon;
use PHPUnit\Framework\TestCase;
class HorizonTest extends TestCase
{
public function testTheHorizonIsThreeMonthsFromTheGivenDay(): void
{
self::assertSame(
'2026-12-14',
Horizon::latest(new \DateTimeImmutable('2026-09-14'))->format('Y-m-d'),
);
}
/**
* PHP's "+3 months" from a 31st overflows into the next month (31 November does not exist,
* so it becomes 1 December). Pinned rather than clamped: this is a cap, and one extra day of
* horizon four times a year is not worth the arithmetic it would take to remove. The
* recurrence code deliberately avoids months for exactly this reason -- see
* RecurrenceRule::intervalDays() -- but a single boundary can live with it.
*/
public function testAMonthEndOverflowsByADayAndThatIsAccepted(): void
{
self::assertSame(
'2026-12-01',
Horizon::latest(new \DateTimeImmutable('2026-08-31'))->format('Y-m-d'),
);
}
public function testTheTimePartIsDroppedSoTheComparisonIsPerDay(): void
{
self::assertSame(
'00:00:00',
Horizon::latest(new \DateTimeImmutable('2026-09-14 17:42:13'))->format('H:i:s'),
);
}
public function testItDefaultsToToday(): void
{
self::assertEquals(
Horizon::latest(new \DateTimeImmutable('today')),
Horizon::latest(),
);
}
}