<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class HistorialCaja extends Model
{
    protected $table = 'historial_caja';
    protected $primaryKey = 'id_movimiento';
    public $timestamps = false; // usamos fecha automática
    protected $fillable = [
        'id_caja', 'id_pago', 'tipo', 'concepto', 'monto', 'referencia', 'fecha'
    ];

    public function caja()
    {
        return $this->belongsTo(Caja::class, 'id_caja', 'id_caja');
    }

    public function pago()
    {
        return $this->belongsTo(PagoDetalle::class, 'id_pago', 'id_pago');
    }
}
