<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OwnerTransaction extends Model
{
    protected $fillable = [
        'user_id',
        'user_account_id',
        'type',
        'trx_no',
        'amount',
        'note',
        'posted_at',
    ];

    protected $casts = [
        'posted_at' => 'datetime',
        'amount' => 'decimal:2',
    ];

    public function account()
    {
        return $this->belongsTo(UserAccount::class, 'user_account_id');
    }
}