feat(event): implement EventDateGroupingService to group historical dates and update related resources and tests

This commit is contained in:
2026-09-15 16:28:39 -03:00
parent 51937ca93f
commit 24d87623cc
7 changed files with 293 additions and 4 deletions

View File

@@ -36,6 +36,25 @@ class EventDateInfoFormatterTest extends TestCase
);
}
public function test_it_includes_sources_that_reach_the_destination_through_intermediate_dates(): void
{
$date = new EventDate;
$date->id = 30;
$changes = collect([
$this->reschedule(13, 24, '2026-10-13'),
$this->reschedule(22, 24, '2026-10-22'),
$this->reschedule(24, 30, '2026-10-24'),
$this->reschedule(29, 30, '2026-10-29'),
$this->reschedule(10, 11, '2026-10-10'),
]);
$this->assertSame(
'13/10/2026, 22/10/2026, 24/10/2026 y 29/10/2026 se reprogramaron para este día.',
(new EventDateInfoFormatter)->format($date, $changes),
);
}
private function reschedule(int $sourceId, int $destinationId, string $previousDate): EventDateChange
{
$change = new EventDateChange;