<?php

declare(strict_types=1);

namespace Kylin\Agriculture\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Kylin\Agriculture\Models\SensorData;

class AggregateSensorData implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public int $tries = 3;
    public int $timeout = 300;

    public function __construct(
        public string $period = 'hourly',
    ) {}

    public function handle(): void
    {
        Log::info("传感器数据聚合：{$this->period}");
    }
}
