<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LeadAdjustment extends Model
{
    protected $guarded = [];

    protected $casts = [
        'points' => 'float',
        'credited_before' => 'float',
        'credited_after' => 'float',
        'requested_amount' => 'float',
    ];

    public function lead(): BelongsTo
    {
        return $this->belongsTo(Lead::class);
    }

    public function admin(): BelongsTo
    {
        return $this->belongsTo(User::class, 'admin_id');
    }
}
