<?php

declare(strict_types=1);

namespace App\Http\Resources;

use App\Contracts\Resource;
use App\Models\Bid;

/**
 * @mixin Bid
 */
class UserBidResource extends Resource
{
    #[\Override]
    public function toArray($request)
    {
        return [
            'id'         => $this->id,
            'user_id'    => $this->user_id,
            'flight_id'  => $this->flight_id,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'flight'     => new FlightResource($this->whenLoaded('flight')),
        ];
    }
}
