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

@@ -2,6 +2,7 @@
namespace App\Domains\Event\Resources;
use App\Domains\Event\Services\EventDateGroupingService;
use App\Domains\Tenant\Models\Tenant;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -22,7 +23,9 @@ class EventResource extends JsonResource
'allow_ticket_total_refund' => $this->allow_ticket_total_refund,
'allow_ticket_partial_refund' => $this->allow_ticket_partial_refund,
'ticket_partial_refund_percentage' => $this->ticket_partial_refund_percentage,
'dates' => EventDateResource::collection($this->eventDates),
'dates' => EventDateResource::collection(
app(EventDateGroupingService::class)->group($this->eventDates)
),
'social_media' => $this->socialMedia->map(fn ($item): array => [
'code' => $item->code,
'url' => $item->pivot->url,