feat(event): add EventDateInfoFormatter to format event date messages and implement related tests

This commit is contained in:
2026-09-15 16:08:42 -03:00
parent dcf4383fbf
commit 51937ca93f
4 changed files with 108 additions and 5 deletions

View File

@@ -326,6 +326,8 @@ class AdminAppEventControllerTest extends TestCase
->assertOk()
->assertJsonCount(1, 'data.event.dates')
->assertJsonPath('data.event.dates.0.id', $destination->id)
->assertJsonPath('data.event.dates.0.info_text', '09/10/2027 se reprogramó para este día.')
->assertJsonPath('data.event.dates.0.isCanceled', false)
->assertJsonCount(1, 'data.event.date_changes')
->assertJsonPath('data.event.date_changes.0.type', 'rescheduled')
->assertJsonPath('data.event.date_changes.0.source_event_date_id', $original->id)
@@ -483,8 +485,13 @@ class AdminAppEventControllerTest extends TestCase
$this->assertSame('10 de Octubre 2027', $tenant->fresh()->event_date_text);
$this->getJson('/api/tenants/bootstrap?dominio=acme.test&path=%2F')
->assertOk()
->assertJsonCount(1, 'data.event.dates')
->assertJsonPath('data.event.dates.0.id', $otherDate->id)
->assertJsonCount(2, 'data.event.dates')
->assertJsonPath('data.event.dates.0.id', $suspendedDate->id)
->assertJsonPath('data.event.dates.0.info_text', 'Esta fecha fue cancelada.')
->assertJsonPath('data.event.dates.0.isCanceled', true)
->assertJsonPath('data.event.dates.1.id', $otherDate->id)
->assertJsonPath('data.event.dates.1.info_text', null)
->assertJsonPath('data.event.dates.1.isCanceled', false)
->assertJsonCount(1, 'data.event.date_changes')
->assertJsonPath('data.event.date_changes.0.type', 'suspended')
->assertJsonPath('data.event.date_changes.0.source_event_date_id', $suspendedDate->id)