<?php

namespace App\Http\Resources\Finance;

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

class FinancialExpenseSummaryResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'category' => $this->resource['category'] ?? null,
            'total_amount' => (float) ($this->resource['total_amount'] ?? 0),
        ];
    }
}
