<?php

namespace App\Jobs;

use App\Http\Controllers\API\v1\EmployeeAttendanceController;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Http\Request;

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

    protected $forRequest;

    /**
     * Create a new job instance.
     */
    public function __construct($forRequest)
    {
        $this->forRequest = $forRequest;
    }

    /**
     * Execute the job.
     */
    public function handle()
    {
        $processAttendance = new EmployeeAttendanceController();
        $request = new Request($this->forRequest);
        $processAttendance->processAttendance($request);
    }
}
