<?php

namespace App\Http\Resources;

use App\Models\TeamMemberAvailability;

class TeamMemberAvailabilityResource extends BaseResource
{
    public function toArray($request): array
    {
        /** @var TeamMemberAvailability $availability */
        $availability = $this->resource;

        return [
            'team_member_id' => $availability->team_member_id,
            'date' => $availability->date?->toDateString(),
            'availability' => (float) $availability->availability,
        ];
    }
}
