<?php

namespace App\Models;

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

class WeatherResult extends Model
{
    use HasFactory, HasUuids;

    protected $table = 'weather_results';

    public $timestamps = false;

    protected $primaryKey = 'id';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $fillable = [
        'cityId',
        'data',
        'resultDateTime'
    ];

    protected $casts = [
        'data' => 'array',
        'resultDateTime' => 'datetime'
    ];

    public function city()
    {
        return $this->belongsTo(City::class, 'cityId', 'id');
    }
}
