<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Transaction extends BaseModel
{
    public const UPDATED_AT = null;

    protected function casts(): array
    {
        return ['amount' => 'decimal:2', 'balance_before' => 'decimal:2', 'balance_after' => 'decimal:2', 'metadata' => 'array'];
    }

    public function wallet(): BelongsTo { return $this->belongsTo(Wallet::class); }
    public function payment(): BelongsTo { return $this->belongsTo(Payment::class); }
}