<?php

namespace App\Http\Resources;

use App\Classes\Modules\Steps\GetStep;
use Illuminate\Http\Resources\Json\JsonResource;

class OrderStep extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'complete' => $this->complete,
            'reference_id' => $this->reference_id,
            'details' => (new GetStep())->execute($this->reference_id)
        ];
    }
}
