<?php 

namespace App\Http\Resources\Consumable;

use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\User;
use App\Http\Resources\BaseJsonResource;

class ConsumableConsumpationDetailResource extends BaseJsonResource
{
    public function toArray($request)
    {

        $array = [
            'id' => $this->id,
            'consumable' => new ConsumableItemResource($this->consumable),
            'qty' => $this->qty,
            'consumed_percentage' => $this->consumed_percentage
        ];

        $array = $this->base($array);
        
        return $array;
    }
}