<?php

namespace App\Http\Resources\Tenant;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class EventPurchaseResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'events_purchased' => $this->events_purchased,
            'amount' => $this->amount,
            'currency' => $this->currency,
            'provider' => $this->provider,
            'status' => $this->status,
            'external_receipt_id' => $this->external_receipt_id,
            'purchased_at' => $this->purchased_at ? $this->purchased_at->toISOString() : null,
            'created_at' => $this->created_at->toISOString(),
        ];
    }
}