29 lines
976 B
PHP
29 lines
976 B
PHP
<?php
|
|
|
|
namespace App\Domains\Ticketing\Ticket\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class EntryReservationResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'catalog_item_id' => $this->catalog_item_id,
|
|
'variant_id' => $this->variant_id,
|
|
'catalog_item' => ['id' => $this->catalog_item_id, 'name' => $this->catalogItem?->nombre],
|
|
'variant' => $this->variant === null ? null : [
|
|
'id' => $this->variant_id,
|
|
'label' => $this->variant->getSelectionLabel(),
|
|
],
|
|
'ticket_id' => $this->ticket_id,
|
|
'fecha_reserva' => $this->fecha_reserva->toIso8601String(),
|
|
'tipo_pago' => $this->tipo_pago->value,
|
|
'tipo_pago_label' => $this->tipo_pago->label(),
|
|
'importe' => $this->importe,
|
|
];
|
|
}
|
|
}
|