<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class FinancialMovement extends Model
{
    use HasFactory;

    protected $table = 'financial_movements';

    protected $fillable = [
        'date',
        'origin_id',
        'destination_id',
        'amount',
        'causal_id',
        'notes',
        'deleted',
    ];

    public function origin()
    {
        return $this->belongsTo(\App\Models\Bank::class, 'origin_id');
    }

    public function destination()
    {
        return $this->belongsTo(\App\Models\Bank::class, 'destination_id');
    }

    public function causal()
    {
        return $this->belongsTo(\App\Models\Causal::class, 'causal_id');
    }
}
