<?php

namespace App\Domains\Sale\Resources\AdminApp;

use App\Domains\Ticket\Models\Ticket;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

/** @mixin Ticket */
class SaleTicketResource extends JsonResource
{
    /** @return array<string, mixed> */
    public function toArray(Request $request): array
    {
        return [
            'product' => $this->name,
            'id' => $this->id,
            'expires_at' => $this->getEffectiveExpiresAt(),
            'status' => $this->status,
        ];
    }
}
