<?php

namespace App\Http\Resources;

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

class DashboardClienteResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'headerBar'                  => data_get($this, 'headerBar'),
            'summaryInfos'               => data_get($this, 'summaryInfos'),
            'pendingSchedules'           => data_get($this, 'pendingSchedules'),
            'nextSchedules'              => data_get($this, 'nextSchedules'),
            'lastDoneSchedules'          => data_get($this, 'lastDoneSchedules'),
            'favoriteProviders'          => data_get($this, 'favoriteProviders'),
            'providersClose'             => data_get($this, 'providersClose'),
            'schedulesProposals'         => data_get($this, 'schedulesProposals'),
            'customSchedulesNoProposals' => data_get($this, 'customSchedulesNoProposals'),
            'todaySchedules'             => data_get($this, 'todaySchedules'),
            'notifications'              => data_get($this, 'notifications'),
            'has_payment_methods'        => data_get($this, 'has_payment_methods'),
            'pendingServicePackages'     => ServicePackageResource::collection(data_get($this, 'pendingServicePackages')),
        ];
    }
}
