<?php

namespace App\Models\Finance;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Expense extends Model
{
    use SoftDeletes;

    protected $table = 'expenses';

    protected $fillable = [
        'tenant_id', 'date', 'vendor', 'description', 'category',
        'amount', 'status', 'payment_method', 'invoice_no', 'memo',
    ];

    protected $casts = [
        'date' => 'date',
        'amount' => 'integer',
    ];

    public function scopeForTenant($query, $tenantId)
    {
        return $query->where('tenant_id', $tenantId);
    }
}
