<?php

namespace App\Http\Resources\Tenant;

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

class CreditLedgerResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'delta' => $this->delta,
            'reason' => $this->reason,
            'note' => $this->note,
            'related_purchase_id' => $this->related_purchase_id,
            'created_at' => $this->created_at->toISOString(),
        ];
    }
}