<?php

namespace App\Models\Finance;

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

class DailyFundTransaction extends Model
{
    use SoftDeletes;

    protected $table = 'daily_fund_transactions';

    protected $fillable = [
        'tenant_id',
        'transaction_date',
        'type',
        'time',
        'account_id',
        'account_name',
        'description',
        'amount',
        'category',
        'note',
    ];

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

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