<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RentalRenewal extends Model
{
    protected $fillable = [
        'rental_id', 'renewed_by', 'previous_end_date', 'new_end_date', 'added_days', 'amount_paid',
    ];

    protected $casts = [
        'previous_end_date' => 'date',
        'new_end_date'      => 'date',
        'amount_paid'       => 'decimal:2',
    ];

    public function rental() { return $this->belongsTo(Rental::class); }
    public function renewedBy() { return $this->belongsTo(User::class, 'renewed_by'); }
}
