feat(event): implement automatic tenant date text synchronization on save and delete; update related tests

This commit is contained in:
2026-08-11 09:49:59 -03:00
parent 19b506a465
commit 8d8e49fcfb
5 changed files with 55 additions and 5 deletions

View File

@@ -13,8 +13,6 @@ class EventService
'facebook_url' => 'facebook',
];
public function __construct(protected EventDateTextFormatter $eventDateTextFormatter) {}
public function forTenant(Tenant $tenant): Tenant
{
return $tenant->load(['eventDates', 'socialMedia']);
@@ -28,9 +26,6 @@ class EventService
$tenant->update([
'event_title' => $data['title'],
'event_location' => $data['location'],
'event_date_text' => $this->eventDateTextFormatter->format(
array_column($data['dates'], 'date')
),
]);
$this->syncDates($tenant, $data['dates']);