<?php

namespace App\Models;

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

class BotSetting extends Model
{
    protected $fillable = [
        'user_id',
        'bot_enabled',
        'auto_trade',
        'bot_status',
        'scan_side',
        'last_scan_at',
        'started_at',
    ];

    protected function casts(): array
    {
        return [
            'bot_enabled' => 'boolean',
            'auto_trade' => 'boolean',
            'last_scan_at' => 'datetime',
            'started_at' => 'datetime',
        ];
    }

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