feat(event): restore event model and migrate tenant event data

This commit is contained in:
2026-09-18 11:31:51 -03:00
parent 1e67d27a90
commit 0170a2eabb
13 changed files with 339 additions and 81 deletions

View File

@@ -3,11 +3,11 @@
namespace App\Domains\Ticketing\Event\Resources;
use App\Domains\Ticketing\Event\Services\EventDateGroupingService;
use App\Domains\Core\Tenant\Models\Tenant;
use App\Domains\Ticketing\Event\Models\Event;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin Tenant */
/** @mixin Event */
class EventResource extends JsonResource
{
/** @return array<string, mixed> */
@@ -17,14 +17,18 @@ class EventResource extends JsonResource
return [
'id' => $this->id,
'title' => $this->event_title,
'location' => $this->event_location,
'allow_ticket_refund' => $this->allow_ticket_refund,
'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,
'title' => $this->title,
'subtitle' => $this->subtitle,
'description' => $this->description,
'location' => $this->location,
'date_text' => $this->date_text,
'published_at' => $this->published_at?->toIso8601String(),
'allow_ticket_refund' => $this->tenant->allow_ticket_refund,
'allow_ticket_total_refund' => $this->tenant->allow_ticket_total_refund,
'allow_ticket_partial_refund' => $this->tenant->allow_ticket_partial_refund,
'ticket_partial_refund_percentage' => $this->tenant->ticket_partial_refund_percentage,
'dates' => EventDateResource::collection(
app(EventDateGroupingService::class)->group($this->eventDates)
app(EventDateGroupingService::class)->group($this->dates)
),
'social_media' => $this->socialMedia->map(fn ($item): array => [
'code' => $item->code,