<?php

// app/Models/StallHistory.php

namespace App\Models;

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

class StallHistory extends Model
{
    use HasFactory;

    protected $fillable = [
        'stall_id', 'merchant_id', 'occupied_from', 'occupied_until', 'monthly_fee', 'notes',
    ];

    protected $casts = [
        'occupied_from' => 'date',
        'occupied_until' => 'date',
    ];

    public function stall()
    {
        return $this->belongsTo(Stall::class);
    }

    public function merchant()
    {
        return $this->belongsTo(Merchant::class);
    }
}
