<?php

// app/Models/FiscalLocation.php

namespace App\Models;

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

class FiscalLocation extends Model
{
    use HasFactory;

    protected $fillable = [
        'fiscal_id', 'latitude', 'longitude', 'accuracy', 'recorded_at',
    ];

    protected $casts = [
        'latitude' => 'decimal:8',
        'longitude' => 'decimal:8',
        'accuracy' => 'decimal:2',
        'recorded_at' => 'datetime',
    ];

    public function fiscal()
    {
        return $this->belongsTo(Fiscal::class);
    }
}
