<?php

namespace App\Models\Fish;

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

class UserFavoriteSpot extends Model
{
    protected $table = 'user_favorite_spots';

    protected $fillable = [
        'user_id',
        'lat',
        'lon',
        'name',
        'species_ids',
        'notify_threshold',
    ];

    protected $casts = [
        'lat' => 'decimal:7',
        'lon' => 'decimal:7',
        'species_ids' => 'array',
        'notify_threshold' => 'integer',
    ];

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