<?php

namespace App\Http\Resources\Reports;

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

class InventoryValuationResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'total_items' => (int) $this->total_items,
            'stock_quantity' => (float) $this->stock_quantity,
            'total_cost_value' => (float) $this->total_cost_value,
            'total_retail_value' => (float) $this->total_retail_value,
            'potential_profit' => (float) ($this->total_retail_value - $this->total_cost_value),
        ];
    }
}
