feat(event): restore event model and migrate tenant event data
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user