<?php

namespace App\Http\Resources;

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

class FeedConsumptionItemResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            "id" => $this->id,
            "feed_consumption_id" => $this->feed_consumption_id,
            "building_id" => $this->building_id,
            "batch_id" => $this->batch_id,
            "age" => $this->age_days,
            "item_id" => $this->item_id,
            "item_code_snapshot" => $this->item_code_snapshot,
            "item_name_snapshot" => $this->item_name_snapshot,
            "soh_snapshot" => $this->soh_snapshot,
            "quantity" => $this->quantity,
            "created_at" => $this->created_at,
            "updated_at" => $this->updated_at,
            "deleted_at" => $this->deleted_at,
        ];
    }
}
