<?php

namespace App\Http\Resources;

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

class ProcessingLogResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    #[\Override]
    public function toArray(Request $request): array
    {
        return [
            'action' => $this->resource->action,
            'channel' => $this->resource->channel,
            'status' => $this->resource->status,
            'context' => $this->resource->context,
            'created_at' => $this->resource->created_at?->format('d/m/Y H:i'),
        ];
    }
}
