<?php

namespace App\Http\Resources\Reimbursements;

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

class ReimbursementBatchResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'batchId' => (int) ($this->resource['batchId'] ?? 0),
            'batchNumber' => (int) ($this->resource['batchNumber'] ?? 0),
            'label' => $this->resource['label'] ?? null,
            'sequence' => (int) ($this->resource['sequence'] ?? 0),
            'yearly_batch_number' => (int) ($this->resource['yearly_batch_number'] ?? 0),
            'slots' => $this->resource['slots'] ?? [],
            'itemIds' => $this->resource['itemIds'] ?? [],
            'status' => $this->resource['status'] ?? null,
        ];
    }
}
