<?php

namespace App\Http\Resources\Reports;

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

class CategorySaleResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'category_id' => $this->category_id,
            'name' => $this->category_name,
            'total_revenue' => (float) $this->total_revenue,
            'total_quantity' => (float) $this->total_quantity,
        ];
    }
}
