<?php

namespace App\Models\Machine;

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

class RemoteCommand extends Model
{
    use HasFactory;

    protected $fillable = [
        'machine_id',
        'command',
        'payload',
        'status',
        'response_payload',
        'executed_at',
    ];

    protected $casts = [
        'payload' => 'array',
        'response_payload' => 'array',
        'executed_at' => 'datetime',
    ];

    public function machine()
    {
        return $this->belongsTo(Machine::class);
    }
}
